Skip to main content
Solved

Varying Multiple Attachment Email Used to Trigger Workspace and Populate Publish Parameters

  • October 17, 2018
  • 4 replies
  • 52 views

Forum|alt.badge.img+1

I can receive emails at FME Server and trigger a specific workspace if I attach only one of each file type (DWG and PDF) in the same order (DWG before PDF) so that I can specify the published parameter for my SourceDataset_ACAD (which requires a single value) to be the email_publisher_attachment{0} and the published parameter for my SourceDataset_PATH to email_publisher_attachment{1}.

However, I would like to be able to receive an email with any number of attachments, in any order, and filter and apply them correctly to their respective published parameters (potentially more than one DWG, but I would not know how many in advance and/or what order they were received to apply the correct list values). Any ideas or examples of similar implementations would be greatly appreciated. Thank you in advance.

Best answer by laurawatsafe

Hi @dane_stephenson,

One option for doing this might be to make use of a ListExploder transformer to create one feature for each incoming attachment. Then use a TestFilter to filter them based on the file extension. Next you could use an Aggregator transformer set to 'Merge Incoming Attributes' and concatenate the email_publisher_attachment attribute with the Separator Character set to a comma to combine multiple DWG file paths into a single attribute that could be passed into the FMEServerJobSubmitter.

Here's a sample workspace showing this idea: none2none.fmw

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

laurawatsafe
Safer
Forum|alt.badge.img+12
  • Safer
  • 158 replies
  • Best Answer
  • October 18, 2018

Hi @dane_stephenson,

One option for doing this might be to make use of a ListExploder transformer to create one feature for each incoming attachment. Then use a TestFilter to filter them based on the file extension. Next you could use an Aggregator transformer set to 'Merge Incoming Attributes' and concatenate the email_publisher_attachment attribute with the Separator Character set to a comma to combine multiple DWG file paths into a single attribute that could be passed into the FMEServerJobSubmitter.

Here's a sample workspace showing this idea: none2none.fmw


Forum|alt.badge.img+1

Hi @dane_stephenson,

One option for doing this might be to make use of a ListExploder transformer to create one feature for each incoming attachment. Then use a TestFilter to filter them based on the file extension. Next you could use an Aggregator transformer set to 'Merge Incoming Attributes' and concatenate the email_publisher_attachment attribute with the Separator Character set to a comma to combine multiple DWG file paths into a single attribute that could be passed into the FMEServerJobSubmitter.

Here's a sample workspace showing this idea: none2none.fmw

I think this will get the job done. On a side note, (minimal experience with json) how do you generate an test json file to spoof an email so that I could test this? I have attempted downloading workspace templates from other posts that included one to run the workspace against, but have been unable to find the file that I could manipulate for my own test cases.

 

 


laurawatsafe
Safer
Forum|alt.badge.img+12
  • Safer
  • 158 replies
  • October 18, 2018
I think this will get the job done. On a side note, (minimal experience with json) how do you generate an test json file to spoof an email so that I could test this? I have attempted downloading workspace templates from other posts that included one to run the workspace against, but have been unable to find the file that I could manipulate for my own test cases.

 

 

Ah, good question! When I'm testing workflows like this, I typically would turn on Topic Monitoring within FME Server to watch the topic I'm using, then send in a test email. The monitoring page will show what the JSON will look like. I'd just copy and paste that json into a text editor and save it to use as the source for running the workspace locally.

 

 

The documentation also has some examples of what the json will look like for each of the publishers, so you could copy/paste out of that for testing as well (check the bottom of this page): https://docs.safe.com/fme/html/FME_Server_Documentation/Content/ReferenceManual/Configure_Email_SMTP_Publication.htm

 

 


Forum|alt.badge.img+1

Hi @dane_stephenson,

One option for doing this might be to make use of a ListExploder transformer to create one feature for each incoming attachment. Then use a TestFilter to filter them based on the file extension. Next you could use an Aggregator transformer set to 'Merge Incoming Attributes' and concatenate the email_publisher_attachment attribute with the Separator Character set to a comma to combine multiple DWG file paths into a single attribute that could be passed into the FMEServerJobSubmitter.

Here's a sample workspace showing this idea: none2none.fmw

Thank you for the tip.