Attachment Parsing Service

The Attachment Parsing service extracts attachments from the MIME messages according to either the file name or file extension of the attachment.

The following table provides an overview of the Attachment Parsing service:

System name AttachmentParsingService
Graphical Process Modeler (GPM) categories All Services, Translation
Description The Attachment Parsing service retains the desired attachments in the MIME message of the primary document according to the filename or file extension, and removes unidentified attachments.
Business usage In a business process, use this service to manipulate attachments in a primary document.
Usage example After receiving a multipart MIME message that contains multiple documents, such as a Word attachment and an Excel attachment, you can use this service to forward one of the attachments. For example, if you want to send the Excel document to another department, use the Attachment Parsing service in a business process. The service deletes the Word document from the MIME message by passing in the specified file name or file extension. Then, using one of the communications adapters in the business process, such as the SMTP Send adapter, the Excel documents forwards to the other department.
Preconfigured? Yes
Requires third-party files? No
Platform availability All supported platforms
Related services No
Application requirements No
Initiates business processes? No
Invocation No, this is an internal service.
Business process context considerations The configuration parameters and the documents are picked up by the adapter in the business process context.
Returned status values
Returned status values:
  • Error occurred and the Message is xxx
  • Exit Status is x
Restrictions The Attachment Parsing process operates only on the file name or file extension of the attachments. Use only the preconfigured service.
Persistence level System default
Testing considerations None

Business Scenario

In this scenario, the B2B Mail Client adapter is used to read a multipart mime message with two attachments. You want to filter the attachments and send the entire Excel document to a specific user. To do this:
  1. Configure the B2B Mail Client adapter to extract all the mail headers into process data. On the adapter configuration URI page, you select a business process called SMTPExcelDoc to associate with this adapter configuration. The SMTPExcelDoc business process will process the e-mail read by B2B Mail Client adapter.
  2. Configure two business processes: SMTPExcelDoc and Attachment_Parsing_Process.

SMTPExcelDoc Business Process Example

The following example illustrates the SMTPExcelDoc business process:

<process name="SMTPExcelDoc"> 
      <sequence name="xlsSequence"> 
      <assign to="fileExt">xls</assign> 
      <assign to="xport-smtp-mailhost">00.000.00.000</assign> 
      <assign to="xport-smtp-mailport">25</assign>
      <assign to="xport-smtp-mailto">John_Doe@company.com</assign> 
      <assign to="xport-smtp-mailfrom" >John_Doe@company.com</assign> 
      <spawn ref="ATTACHMENT_PARSING_PROCESS"/> 
      </sequence> 
</process> 

The SMTPExcelDoc business process spawns the Attachment_Parsing_Process business process. When a business process is instantiated as a spawn activity, as Attachment_Parsing_Process is in this example, a copy of process data is passed to the new business process.

Attachment_Parsing_Process Business Process Example

The following example illustrates the Attachment_Parsing_Process business process:


<process name="ATTACHMENT_PARSING_PROCESS"> 
   <sequence name="AnySequence"> 
     <operation name="trueOp"> 
     <participant name="AttachmentParsingService"/> 
     <output message="Xout"> 
        <assign to="." from="*"/> 
        <assign to="fileExt" from="/ProcessData/fileExt/text()"/> 
     </output> 
     <input message="Xin"> 
           <assign to="." from="*"/> 
     </input> 
     </operation> 
     <operation name="SMTP Send"> 
     <participant name="SMTP_SEND_ADAPTER_SMTP_POP3_AUTO_TEST"/> 
     <output message="SMTP_SEND_ADAPTERInputMessage"> 
       <assign to="." from="*"/> 
       <assign to="xport-smtp-mailhost" 
               from="/ProcessData/xport-smtp-mailhost/text()"/> 
       <assign to="xport-smtp-mailport" 
               from="/ProcessData/xport-smtp-mailport/text()"/> 
       <assign to="xport-smtp-mailto" 
               from="/ProcessData/xport-smtp-mailto/text()"/> 
       <assign to="xport-smtp-mailfrom" 
               from="/ProcessData/xport-smtp-mailfrom/text()"/> 
     </output> 
     <input message="inmsg"> 
       <assign to="." from="*"/> 
       </input> 
       </operation> 
    </sequence> 
</process> 

Output from Business Process to Service

The following parameters can be passed to the service when it is run from a business process:

Parameter Description
fileName File name of the mime part which should be retained
fileExt File extension of the mime parts those should be retained.

Implementing the Attachment Parsing Service

To implement the Attachment Parsing service, complete the following tasks:
  1. Create an Attachment Parsing service configuration.
  2. Use the Attachment Parsing service in a business process.