Skip to main content
Question

Automating Reader/Writer Selection

  • August 13, 2019
  • 1 reply
  • 25 views

Forum|alt.badge.img

Is there a best way to automate what a MySQL Reader and Writer should use based on a specific file name?

 

For example if file name = foo.txt

Use the reader/writer DB connection for fooDB.

If file name = fooBar.txt

Use the reader/writer DB connection for fooBarDB

 

I know that User Params along with a Filter in the automation may make this possible, but I don't know if that's the best route to go. I would also like to refrain from having multiples of the same workflow for thier respective DB connections.

 

Thanks in advanced!

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

nag
Contributor
Forum|alt.badge.img
  • Contributor
  • August 14, 2019

Hello, Try following steps to automate the DB Connection.

1) Create published parameter as FileName and get the file name as variable by providing file name at the time of workspace run, Like below

2) Create private parameter and read the published parameter value through python script ex:-

import fme

DBName = fme.macroValues['FileName'].lower()

Return DB name and pass this variable as dataset for your MySql reader.

 

Hope this will work for you, I don't have environment to test this. Need to explore more from here.

 

Thanks..