Configuring Attachment Agents to Inspect Document Contents

In this section:

This section describes how to configure attachment agents that are used to inspect the contents existing attachments.


Top of page

x
XDAttachmentToDocAgent

This agent finds an attachment and makes it the body of the document. The attachment can be selected by index or by Content-ID. If the Attachment Number is specified, it takes precedence over the Content- ID. The attachment index is base 0. If present, the Content-ID must NOT contain the surrounding angle brackets.

For example, the value cid for the Content-ID parameter will match an attachment with a Content-ID header equal to <cid>. The Header Namespace is the special register namespace where MIME headers for the selected attachment will be stored. The attachment will be stored as bytes if the "Keep Document Flat" parameter is enabled. Otherwise, the attachment will be parsed as XML. If the attachment is itself a Multipart, then the document will contain the parse of the Main Body Part and the other parts will appear as document attachments.

The MIME headers of the Main Body Part will be saved as registers in the Main Body Part Header Namespace. This is needed to keep them distinct from the Multipart headers. The "Delete Attachment" parameter determines what to do with the selected attachment when it is not a Multipart: the attachment can be preserved or deleted. This agent follows OnSuccess upon successful execution, otherwise it follows fail_notfound if the attachment cannot be found, or it follows fail_operation if there is another error.



x
Procedure: How to Configure the XDAttachmentToDocAgent

To configure the XDAttachmentToDocAgent:

  1. Ensure that iWay Service Manager is running and logon to the iWay Service Manager Administration Console.
  2. Click Registry in the top pane, and then click Services in the left pane.

    The Services pane opens.

    The table provided lists all the previously configured services (agents) and a brief description each.

  3. Click Add.

    The Select service type pane opens.

  4. Select Attachment to Document {com.ibi.agents.XDAttachmentToDocAgent} from the Type drop-down list and click Next.

    The Configuration parameters for the Internal Listener pane opens.

    Note: The parameters prefixed with a (*) in the listener configuration pane are required.

  5. Provide the appropriate values for the XDAttachmentToDocAgent parameters.

    For more information, see XDAttachmentToDocAgent Configuration Parameters.

  6. Click Next.

    You are returned to the Select listener type pane.

  7. Enter a name for the XDAttachmentToDocAgent and description (optional).
  8. Click Finish.

    You are returned to the Services pane and the XDAttachmentToDocAgent is now added to the table listing all configured services (agents), as shown in the following image.



x
Reference: XDAttachmentToDocAgent Configuration Parameters

The following table lists and describes parameters for the XDAttachmentToDocAgent.

Parameter

Description

Attachment Number

The number of the attachment to be retrieved. If specified, it takes precedence over the Content-ID.

Content-ID

The Content-ID of the attachment to be retrieved. This value is ignored if the attachment number is specified.

Header Namespace

Special register namespace where MIME headers for the selected attachment will be stored.

Main Body Part Header Namespace

If the current attachment is itself a Multipart, this is the special register namespace where the MIME headers for the main body part will be stored.

Keep Document Flat

Determines whether to keep the body of the document as an array of bytes. This parameter is set to false by default.

Delete Attachment

Determines whether to delete the attachment after it becomes the body of the document. This parameter is set to false by default.



x
XDIterAttachments

XDIterAttachments handles each attachment of the input document iteratively. At each iteration, an attachment is assigned to the body of the output document. The Handling Option determines how to treat the original attachment: "delete" removes each attachment from current document after processing; "replace" replaces the original attachment with the modified document; "leave alone" leaves the original attachments unchanged.

The index of the first attachment to be processed is given by the Start Index parameter, base 0. If omitted, the default Start Index is 0, therefore all attachments will be processed. The Header Namespace is the special register namespace where MIME headers for the current attachment will be stored. The attachment will be stored as bytes if the "Keep Document Flat" parameter is enabled. Otherwise, the attachment will be parsed as XML. If the attachment is itself a Multipart, then the document will contain the parse of the Main Body Part and the other parts will appear as document attachments.

The MIME headers of the Main Body Part will be saved as registers in the Main Body Part Header Namespace. This is needed to keep them distinct from the Multipart headers. With the "Replace" handling options, the special registers in the Header Namespace (and possibly the Main Body Part Header Namespace) are used to create headers for the new attachment. At each iteration, the header special registers from the previous iteration are erased before the new set is assigned. This iterator follows the OnSuccess edge upon successful execution, otherwise it follows fail_operation.



x
Procedure: How to Configure the XDIterAttachments

To configure the XDIterAttachments:

  1. Ensure that iWay Service Manager is running and logon to the iWay Service Manager Administration Console.
  2. Click Registry in the top pane, and then click Services in the left pane.

    The Services pane opens.

    The table provided lists all the previously configured services (agents) and a brief description each.

  3. Click Add.

    The Select service type pane opens.

  4. Select Attachment Iterator {com.ibi.agents.XDIterAttachments} from the Type drop-down list and click Next.

    The Configuration parameters for the Internal Listener pane opens.

    Note: The parameters prefixed with a (*) in the listener configuration pane are required.

  5. Provide the appropriate values for the XDIterAttachments parameters.

    For more information, see XDIterAttachments Configuration Parameters.

  6. Click Next.

    You are returned to the Select listener type pane.

  7. Enter a name for the XDIterAttachments and description (optional).
  8. Click Finish.

    You are returned to the Services pane and the XDIterAttachments is now added to the table listing all configured services (agents), as shown in the following image.



x
Reference: XDIterAttachments Configuration Parameters

The following table lists and describes parameters for the XDIterAttachments.

Parameter

Description

Handling Option

Select one of the following values from the drop-down list:

  • Delete attachment - Removes each attachment from the current document after processing.
  • Replace attachment - Replaces the original attachment with the modified document.
  • Leave unchanged - Leaves the original attachments unchanged. This value is selected by default.

Start Index

Index of the first attachment to process in the mail object. The first attachment to the main document has an index of 0.

Header Namespace

Special register namespace where MIME headers for the current attachment will be stored. If Replace attachment is selected as the handling option, registers in this namespace will be added to the replaced attachment.

Main Body Part Header Namespace

If the current attachment is itself a Multipart, this is the special register namespace where the MIME headers for the main body part will be stored.

Keep Document Flat

Determines whether to keep the body of the document as an array of bytes. This parameter is set to false by default.


iWay Software