Skip to main content
Hi all,

 

 

 

I’m using FME Server and ActiveMQ to chain together a series of workbenches, running each in turn depending on the notification messages sent between FME Server and ActiveMQ (JMS).   The notifications sent from ActiveMQ are JSONs with the parameters required by the workbench to run successfully.  For example, the notification will contain Source Dataset, Coordinate System, File Type, etc.

 

 

 

My problem is that I need to pass the parameters defined in the notification to the workbench at runtime and don’t know how to accomplish this when the notification is being read from an FME Server Topic.

 

 

 

Initially I was going to use scripted parameters to read a json containing the required parameters from a url and extract the required information. This works really well if the notification and its endpoint is well defined but, now that I’m trying to read my notification message from an FME Server Topic, I don’t have a well defined JSON (notification message) to read from. 

 

 

 

As an alternative I tried Ken’s suggestion found here:

 

http://fmepedia.safe.com/AnswersQuestionDetail?id=906a0000000cnbVAAQ

 

but I couldn’t figure out how to extract the parameters from the data read by the Text File Reader and apply them to the runtime parameters – the required information is extracted too late in the process.

 

 

 

Then I tried using the WorkspaceRunner transformer.  My workspace consists of a text file reader that reads the notification from the FME Server topic.  The text data read is formatted into attributes using the JSONFlattener which is in-turn attached to a workspace runner.   The workspace runner runs the workbench that does the actual data manipulation required.  This method allows me to pass parameters from the notification message to the second workbench but causes problems with the notification back to ActiveMQ.  I publish my workbench (the one with the workspacerunner) to FME Server and set the Topics to notify on success and failure.  I then have a subscription that listens on those topics and when a message is posted, sends a return message to ActiveMQ.  Problem is, the success or fail being reported is not for the workbench that does the actual data manipulation (the one called by the WorkspaceRunner).  This is the important one and the one I want my success/failure notification to refer to.

 

 

 

Any ideas on the best way to tackle this process would be greatly appreciated and apologies for the overly long question.

 

 

 

Thanks

 

Rob

 

Hi Rob,

 

 

Will it be possible for you to add a middle ws to extract the parameters AND then let it notify a subscription that triggers the last ws (that does the job)?

 

 

if you are using FME server you can just keep on notifying for cases where a single or a two step processing is not enough.

 

 

cheers,

 

 

Itay
Thanks for the reply Itay.

 

I've split it up into a two step process.  The first reads the notification containing the parameters I need to run the second workspace and writes the notification to a .json on a local drive.  The second then extracts the required parameters from the json using scripted parameters (python).

 

I could find a way to extract the parameters without writing the notification to a well defined location that I could point to with the python script.

 

Although this works, I'd still be interested in any better solutions where I don't have to read then write the notification first - seems like a roundabout method for solving this problem.

 

Cheers

 

Rob

Reply