I guess I may have answered my own question.
Looks like you must send JSON to the FMEServerNotifier and the attributes are accessible in the automation as user keys.
So if the JSON looks like this:
{
"EmailSubject" : fme:get-attribute("EmailSubject"),
"html_content" : fme:get-attribute("html_content")
}
Then in the FME Server Topic trigger you create user keys like this:
User.EmailSubject = {EmailSubject}
html_content = {html_content}
I would really prefer to be able to access the raw Content in the automation if anyone can see a way to do that?
I guess I may have answered my own question.
Looks like you must send JSON to the FMEServerNotifier and the attributes are accessible in the automation as user keys.
So if the JSON looks like this:
{
"EmailSubject" : fme:get-attribute("EmailSubject"),
"html_content" : fme:get-attribute("html_content")
}
Then in the FME Server Topic trigger you create user keys like this:
User.EmailSubject = {EmailSubject}
html_content = {html_content}
I would really prefer to be able to access the raw Content in the automation if anyone can see a way to do that?
Hi @braggken ,
All the FME Server Automation protocols parse messages as a string of JSON. Using the FMEServerNotifier transformer you can set the Content to send a string of JSON e.g.
{"key1":"helloworld"}
But you can also set the Content to plain text, if you do this it will still get stored as JSON but under a key with the name subscriber_content e.g.
{"subscriber_content":"helloworld"}
To use any portion of an event JSON string downstream in an Automation you do not need to create a new key, but wrap the key name in curly brackets and it will fetch the correct value e.g. {key1} or {subscriber_content}.
This was actually a great question, topics are a little funny and behave differently from all the other protocols because the user has full control over the message contents so FME can't expose the keys by default. That being said, I think it would be helpful to expose the subscriber_content key so I am going to file an enhancement request for consideration by our development team.
Thanks for your answer @hollyatsafe I didn't know about this "subscriber_content" so that's definitely helpful! And yes it would be great if that was a key you could see in the Notifier trigger. Also, and maybe I missed it, but I didn't see documentation on either using the json keys (I just kind of guessed on that) or the "subscriber_content" with the FME Server Automations Trigger here.
Might be good to have this documented on one of these two places:
https://docs.safe.com/fme/html/FME_Server_Documentation/WebUI/Automations-Triggers/Trigger-Topic.htm
https://docs.safe.com/fme/html/FME_Server_Documentation/WebUI/Automations-General/Working-with-Output-Keys-in-Workflows.htm
Thanks for your answer @hollyatsafe I didn't know about this "subscriber_content" so that's definitely helpful! And yes it would be great if that was a key you could see in the Notifier trigger. Also, and maybe I missed it, but I didn't see documentation on either using the json keys (I just kind of guessed on that) or the "subscriber_content" with the FME Server Automations Trigger here.
Might be good to have this documented on one of these two places:
https://docs.safe.com/fme/html/FME_Server_Documentation/WebUI/Automations-Triggers/Trigger-Topic.htm
https://docs.safe.com/fme/html/FME_Server_Documentation/WebUI/Automations-General/Working-with-Output-Keys-in-Workflows.htm
@braggken ,
Great point, I've requested some updates to our documentation. Thanks!