Skip to main content
I have a process on fme server where the user emails in a file to be processed. Right now it works great but it can only handle 1 file at a time. I would like the user to be able to attach several files and have them all be processed. The process uses a publisher notification to receive the email and give the file name to the workspace.

 

 

thanks
Hi mapdog,

 

When FME Server receives a email with multiple attachments the notification message provides the path to them in the json message something like this:

 

...email_publisher_attachment{0}":"/path_tmpdir/kbragg145655207383139_ForPR.log",...

 

email_publisher_attachment{1}": "/path_tmpdir/kbragg145655214986767_logo.gif"

 

....

 

So you should have access to the file paths of multiple attachments in your workspace.  You didn't mention how you read the single attachment, but one approach might be to use a FeatureReader transformer.  There are more details here:

 

http://fmepedia.safe.com/articles/How_To/Receiving-email-Part-3-Using-email-attachments
Thanks for the response

 

 

My process involves 2 workspaces the first recieves the attachments and creates a published parameter to be used as the output file.  The input and output parameters are sent to a second workspace using a fmeseverjobsubmitter.  I tried to use the fmeserverworkspacerunner but it doesn't allow me to use parameters or attributes as input for the information that is to be sent to the next workspace like the jobsubmitter does. 

 

 

I relize how the attachments are sent to the workspace but even using a feature reader I have to specify the index of the attachemnt. I want to be able to process 1 or 25 attached files depending on what is sent in by the user
Hi MapDog

 

I see what is going on now. We actually have two transformers that submit jobs to FME Server. (This is obviously confusing and they are being combined into one in FME 2015.1).  But the transformer you want is called the FMEServerJobSubmitter as this one accepts attributes for parameters. 

 

 

You will need to do one other step. Because, as you noticed, there is a list attribute for each attachment called email_publisher_attachement{} you will need to explode this list with a ListExploder so you have one feature for each attachment. Each feature (for each attachment) entering the FMEServerJobSubmitter will result in running the child workspace.

 

Hope this helps

 

Ken

 

 

 

 

Reply