Attachment to Document Service (com.ibi.agents.XDAttachmentToDocAgent)

Syntax:

com.ibi.agents.XDAttachmentToDocAgent

iIT Service Object:

attachments: Attachment to Document

Description:

This service 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 XML or JSON, depending on the MIME subtype (for example, application/json or application/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 service 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.

Parameters:

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.

Edges:

The following table lists the available line edges for the Attachment to Document Service (com.ibi.agents.XDAttachmentToDocAgent).

Line Edge

Description

OnError

Error

OnSuccess

Success

OnFailure

Failure

OnCustom

  • OnError
  • OnSuccess
  • OnFailure
  • fail_operation
  • fail_parse
  • fail_notfound