Skip to main content
Hello FME Universe,

 

 

I have created a project that consists of 7 different FME workspaces which have been published to FME server and are meant to be run as a chain via notifications (When WS1 is successful, run WS2, When WS2 is sucessfull, etc.). All of these workspaces have a seperate output DWG file that gets stored in a temporary folder where a final workspace combines all *.dwg files into one final output, places it on a shared drive and then through a python shutdown script, sends an email to me and deletes the output folder.

 

 

Now here is the problem, all of this works perfectly fine for me. But in order to make it universal so that my office can use it, I need to change certain parameters to have access to the FME system parameter $(FME_SECURITY_USER) (such as the temporary output folder so that it will read something like C:\\Temp\\$(FME_SECURITY_USER)\\*.dwg). Now this works fine for the first workspace (the one the external user initiates) and creates the folder C:\\Temp\\Dave@mcelhanney.net, but everything else that comes after (that is included in the chain through notifications) is defaulted to have my user name as the folder location. Even the fail email is defaulted to my username.

 

 

I was wondering if there was a way to pass system parameters from one workspace to the other within an FME Server environment via Notifications.

 

 

Note: I know there is a workflow controller script, however I wish to acheive this via notifications if possible.

 

 

Thank you!
Hi Moe,

 

First I just want to comment on the FME_SECURITY_USER parameter. 

 

Can you just tell us how you are triggering the notifcation from one workspace to the next?  I'll assume for the time being that when you publish workspace #1 you are setting the "Topic to Publish on Success" for the service you are starting the whole thing off with. And then for #2 when you publish it you set it to subscribe to that topic via the notifcation service. Is that about right?  In this case when you publish #2 and click the settings for the Notification service you can set the user there. That determines the user who is running #2. This can also be changed in WebUI on the Subscriptions tab.  This worked for me when I logged out the FME_SECURITY_USER in #2.  

 

 

I know this doesn't answer your question really but it seems like there might be a problem there.

 


To answer your question about passing parameters:

 

 

1. In workspace #1 add a TEXT file writer that will be used as your "Notification Writer".  It's intended that you send data in JSON but you can just send any string there and it should still work

 

2. Pass any parameters or other information into the text_line_data attribute of the above writer. For example you might use an AttributeCreator to make an attribute called _user from the system parameter and just connect that attribute to your text_line_data attribute on the notification writer.

 

3. When you publish #1 and you set "Topics to Publish on Success" for which ever service, select your TEXTLINE writer as the Notification Writer.

 

4. In workspace #2 add a TEXTLINE reader and set the reader parameter to "Read Whole File at Once". You can use any dummy text file to set this up. This reader is where the data you are passing will come.

 

5. When you publish #2 and select the subscribed topic for the notifcation service you can also select the TEXTLINE reader as the Notification Reader for the Notification service.

 

6. You may need some transformer after the TEXTLINE reader to parse out the data you are passing along.

 

 

BTW We recognize this is overly complicated and a much easier approach is coming for FME Server 2014.

 

 

Hope this helps
It works perfectly now, thanks!

 

 

Ended up having to use a Shutdown python script to do what I want, but a little python coding never hurt.

Reply