Skip to main content
Question

Set published parameters by another workspace


whkarto
Contributor
Forum|alt.badge.img+14

Hi Guys,

I'm looking for a possibility to set published parameters of a workspace by running another workspace. My scenario is as follows:

  • I've a set of workspaces with a lot of published parameters in a repository folder
  • for some users, these workspaces are copied from my repositors to user-folders
  • inside these user-folders the published parameters must be set to different values workspace.

Copying the workspaces to the user-folders is done by a workspace to avoid interactive work. But I can't figure out if the second part of my task (definition of the published parameters) can also be addressed to any FME functionality, or if I have to do this manually.

 

To be 100% clear at this point, usage of a batch-command or a Workspace Runner to set published parameters at runtime is no option in my case! I must be able to run the user workspaces in FME Workbench without any tweaking of the published parameters, except input/output path.

16 replies

sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • November 15, 2019

An option might be to create a PRIVATE Parameter with choice and alias.

 

And then at runtime you fetch the FME_SECURITY_USER parameter (not sure about the name - but I think there is a parameter that gets the username of the user that runs the workspace)

And then you can "select" that path in the workspace by saying runninguser = find correct choice.

Not sure if this helps @whkarto ?

 

Full list of parameters and description can be found here: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/FME_Server_Parameters.htm

 


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
sigtill wrote:

An option might be to create a PRIVATE Parameter with choice and alias.

 

And then at runtime you fetch the FME_SECURITY_USER parameter (not sure about the name - but I think there is a parameter that gets the username of the user that runs the workspace)

And then you can "select" that path in the workspace by saying runninguser = find correct choice.

Not sure if this helps @whkarto ?

 

Full list of parameters and description can be found here: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/FME_Server_Parameters.htm

 

Ohh this is cool, I'm going to make some user specific office pranks. :-D


redgeographics
Celebrity
Forum|alt.badge.img+49
virtualcitymatt wrote:

Ohh this is cool, I'm going to make some user specific office pranks. :-D

Please share :)


sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • November 15, 2019
virtualcitymatt wrote:

Ohh this is cool, I'm going to make some user specific office pranks. :-D

Make all the workspaces run by your boss, with a fail message :)


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
sigtill wrote:

Make all the workspaces run by your boss, with a fail message :)

Yes, or send him here http://tiny.cc/ffabgz

 

 

 


redgeographics
Celebrity
Forum|alt.badge.img+49
virtualcitymatt wrote:

Yes, or send him here http://tiny.cc/ffabgz

 

 

 

I wonder if we can build a RickrollDetector custom transformer...


whkarto
Contributor
Forum|alt.badge.img+14
  • Author
  • Contributor
  • November 15, 2019

@sigtil, interesting idea, but I it's going to be quite complicated if there are several parameters to be set with multiple users. I had hoped for some sort of look up table solution where I can set up the proper configuration in some external software (e.g. Excel) and use the published parameter name as join attribute. That way I don't have the need to edit the workspace itself for every new client/parameter


sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • November 15, 2019
redgeographics wrote:

I wonder if we can build a RickrollDetector custom transformer...

This got me thinking - and since it is friday - ENJOY :) https://hub.safe.com/publishers/sigtill/transformers/webpageopener


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
sigtill wrote:

This got me thinking - and since it is friday - ENJOY :) https://hub.safe.com/publishers/sigtill/transformers/webpageopener

Blast you beat me to it! Well here's the RickRoller: https://hub.safe.com/publishers/virtualcitymatt/transformers/rickroller

 

Enjoy Pranking

 

 


sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • November 15, 2019
virtualcitymatt wrote:

Blast you beat me to it! Well here's the RickRoller: https://hub.safe.com/publishers/virtualcitymatt/transformers/rickroller

 

Enjoy Pranking

 

 

You can use the link to my Custom transformer inside your Custom transformer. Then your RickRoller can benefit opening it on multiple browsers. Well, time for a beer and weekend now. Have a nice weekend!


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
whkarto wrote:

@sigtil, interesting idea, but I it's going to be quite complicated if there are several parameters to be set with multiple users. I had hoped for some sort of look up table solution where I can set up the proper configuration in some external software (e.g. Excel) and use the published parameter name as join attribute. That way I don't have the need to edit the workspace itself for every new client/parameter

I mean, at the end of the day FME workspaces are just text files. You could try with the txtfile reader/writer to replace the places needed.

 

 

But I would guess this could end up being more work than simply opening the workspaces and setting them specifically

sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • November 15, 2019
whkarto wrote:

@sigtil, interesting idea, but I it's going to be quite complicated if there are several parameters to be set with multiple users. I had hoped for some sort of look up table solution where I can set up the proper configuration in some external software (e.g. Excel) and use the published parameter name as join attribute. That way I don't have the need to edit the workspace itself for every new client/parameter

Then I guess you can use a python startupscript to read a "settings file" in the users folder or something?

https://knowledge.safe.com/articles/59997/startup-python-scripts-in-fme.html


ebygomm
Influencer
Forum|alt.badge.img+35
  • Influencer
  • November 15, 2019

If you want to have a 'helper' file for each user, you could go down the route of using a scripted python parameter to read a csv file and create a dictionary as a global parameter

Then further scripted parameters to retrieve all the relevant parameters

 


whkarto
Contributor
Forum|alt.badge.img+14
  • Author
  • Contributor
  • November 15, 2019
virtualcitymatt wrote:

I mean, at the end of the day FME workspaces are just text files. You could try with the txtfile reader/writer to replace the places needed.

 

 

But I would guess this could end up being more work than simply opening the workspaces and setting them specifically

I've already worked on this approach and am quite sure that I could do it that way. But if I simulate this manually with just one parameter and do a file compare in notepad++ alot more lines than expected are highlighted. So I'm absolute not sure If I can guarantee file integrity! Maybe someone form Safe could comment on this.


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
whkarto wrote:

I've already worked on this approach and am quite sure that I could do it that way. But if I simulate this manually with just one parameter and do a file compare in notepad++ alot more lines than expected are highlighted. So I'm absolute not sure If I can guarantee file integrity! Maybe someone form Safe could comment on this.

I think this is why FME doesn't really work with the Git/versioning workflow. They are working on it though


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
sigtill wrote:

You can use the link to my Custom transformer inside your Custom transformer. Then your RickRoller can benefit opening it on multiple browsers. Well, time for a beer and weekend now. Have a nice weekend!

https://hub.safe.com/publishers/virtualcitymatt/transformers/3dclipper-notproductionready Mwahahaha!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings