Skip to main content
Question

Set WorkspaceRunner parameters programmatically

  • August 28, 2015
  • 6 replies
  • 201 views

joep
Contributor
Forum|alt.badge.img+2
  • Contributor
  • 1 reply
Hi folks,

 

 

I have a main workspace that calls a bunch of data validation workspace, my 'child' workspaces. All child workspaces have exactly the same published parameters (values may be different of course). In the main workspace each feature has a parameter WsName with the full name of the child workspace that needs to be called.

 

 

When I use a WorkspaceRunner and set the parameter 'FME Workspace' to the WsName (rather than actually selecting a workspace), I cannot specify any parameters to pass on to the workspace. Is there any way to overwrite this and specify them anyway programmatically?

 

 

I am aware that I could use a PythonCaller to run the child workspaces and pass whatever parameters, as explained on

 

https://knowledge.safe.com/articles/Samples_and_Demos/Run-an-FME-Workspace-from-Python-using-FMEWorkspaceRunner

 

however, for reasons of controlling the flow of workspaces that are called I prefer to use a WorkspaceRunner, not a PythonCaller.

 

 

 Thanks,

 

Joep
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.

6 replies

david_r
Celebrity
  • 8391 replies
  • August 31, 2015
Hi

 

 

The easiest and most transparent way might be to use a TestFilter to branch to different WorkspaceRunners, depending on your attribute "WsName".

 

 

David

 

 

jdh
Contributor
Forum|alt.badge.img+36
  • Contributor
  • 2001 replies
  • August 31, 2015
An alternative (to use with caution!) is to pick one of your child workspace and set all of the WorkspaceRunner parameters to the variables or parameters you want via the transformer dialogue box.  Once that is done, in the navigator panel you can edit the FME Workspace parameter and point it to the WsName attribute.

 

 

 

 

 

Note that if you open the WorkspaceRunner again in the main canvas, all of the parameters will be erased

ddecoene
Contributor
Forum|alt.badge.img+4
  • Contributor
  • 9 replies
  • January 11, 2018
An alternative (to use with caution!) is to pick one of your child workspace and set all of the WorkspaceRunner parameters to the variables or parameters you want via the transformer dialogue box.  Once that is done, in the navigator panel you can edit the FME Workspace parameter and point it to the WsName attribute.

 

 

 

 

 

Note that if you open the WorkspaceRunner again in the main canvas, all of the parameters will be erased
I was able to use this bypass in FME 2015.1 . Anyone an idea how you could do this in FME 2017? because FME 2017 always uses the main parameter window, clicking OK wipes all the variables clean.

 

 


LizAtSafe
Safer
Forum|alt.badge.img+17
  • Safer
  • 1541 replies
  • January 16, 2018

Hi @ddecoene, Thanks for bringing this to our attention. We created PR81325 to fix this issue. In the meantime, we have created a workaround that will hopefully work for you in FME 2017.

Parent Workspace Overview:

\\

1. In your parent workspace with the Workspace Runner, in the Workspace Runner parameters, set the FME workspace to point to a real .fmw and set the parameters as desired. Then close the dialog

2. In the Navigator, browse to Transformers > WorkspaceRunner > FME Workspace, then right click and create a User Parameter. Just click OK to accept the default values.

3. Once the User Parameter is created [WORKSPACE_FILE], double click on it to edit the value. Change the value from your original workspace path to @Value(AttributeName), for the screenshot example, it would be @Value(WsName). Click OK.

4. The @Value(AttributeName)/@Value(WsName), should appear next to Transformers > WorkspaceRunnner > FMEWorkspace.

Delete the User Parameter [WORKSPACE_FILE] under User Parameters > Published Parameters.

5. Once the User Parameter is deleted, the @Value(AttributeName)/@Value(WsName) should still be next to the FME Workspace for the Workspace Runner. You can then run your translation normally.

Hopefully, that works for you,

Please let us know if you were successful, and we will post on this question once the PR81325 has been resolved.

 

-Liz


ddecoene
Contributor
Forum|alt.badge.img+4
  • Contributor
  • 9 replies
  • January 17, 2018

Thanks, this workaround is working.


LizAtSafe
Safer
Forum|alt.badge.img+17
  • Safer
  • 1541 replies
  • November 29, 2018

Thanks, this workaround is working.

Hi @ddecoene

I'm glad you got the workaround working. Just wanted to let you know that this issue has been fixed for FME 2019. You can download a beta and try it out.

 

-Liz