Skip to main content

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.

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


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.

 

 


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

 

 


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.

 

 


Reply