Skip to main content
Solved

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


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

View original
Did this help you find an answer to your question?

laurawatsafe
Safer
Forum|alt.badge.img+11

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
lauraatsafe wrote:

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+11
dane_stephenson wrote:
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
lauraatsafe wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings