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