Configuring Attachment Agents to Create New Documents

In this section:

This section describes how to configure attachment agents that are used to create new documents based on a string expression, contents of a file, or contents of a document.


Top of page

x
XDAddAttachmentAgent

The XDAddAttachmentAgent adds a new attachment with the contents determined by the value of a string expression. The Java Character Set parameter specifies how the Java characters in the string are converted to bytes in the body of the attachment. The attachment headers are specified by the special registers of type HDR in the MIME Header Namespace.

There are also four parameters available to specify the most common MIME headers. When used, these parameters override special registers of the same name. Notice the value of the Content-ID header is taken as is, so the value must contain the surrounding angle brackets. For example, a valid value for Content-ID might be <cid>. This agent follows the OnSuccess edge upon successful execution, otherwise it follows OnError.



x
Procedure: How to Configure the XDAddAttachmentAgent

To configure the XDAddAttachmentAgent:

  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 Add Attachment {com.ibi.agents.XDAddAttachmentAgent} 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 XDAddAttachmentAgent parameters.

    For more information, see XDAddAttachmentAgent Configuration Parameters.

  6. Click Next.

    You are returned to the Select listener type pane.

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

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



x
Reference: XDAddAttachmentAgent Configuration Parameters

The following table lists and describes parameters for the XDAddAttachmentAgent.

Parameter

Description

Input Data

An expression that returns the contents of the attachment.

Java Character Set

The character set used to convert from Java characters to an array of bytes. If no value is specified, the default character set will be used.

Content-Type

Value of the Content-Type MIME header.

Content-Description

Value of the Content-Description MIME header.

Content-Disposition

Value of the Content-Disposition MIME header.

Content-ID

Value of the Content-ID MIME header.

MIME Header Namespace

Special register namespace from which additional MIME headers for the attachment are taken. If no value is specified, no MIME headers are added beyond those generated by the header-specific agent parameters.



x
XDAddAttachmentFromFileAgent

The XDAddAttachmentFromFileAgent adds a new attachment with the contents determined by the contents of a file. This agent is convenient to provide binary data without first going through a Java character set encoding. The attachment headers are specified by the special registers of type HDR in the MIME Header Namespace.

There are also four parameters to specify the most common MIME headers. When used, these parameters override special registers of the same name. Notice the value of the Content-ID header is taken as is, so the value must contain the surrounding angle brackets. For example, a valid value for Content-ID might be <cid>. This agent follows the OnSuccess edge upon successful execution, otherwise it follows OnError.



x
Procedure: How to Configure the XDAddAttachmentFromFileAgent

To configure the XDAddAttachmentFromFileAgent:

  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 Add Attachment From File {com.ibi.agents.XDAddAttachmentFromFileAgent} 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 XDAddAttachmentFromFileAgent parameters.

    For more information, see XDAddAttachmentFromFileAgent Configuration Parameters.

  6. Click Next.

    You are returned to the Select listener type pane.

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

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



x
Reference: XDAddAttachmentFromFileAgent Configuration Parameters

The following table lists and describes parameters for the XDAddAttachmentFromFileAgent.

Parameter

Description

Input File

Path to the file that contains the attachment data.

Content-Type

Value of the Content-Type MIME header.

Content-Description

Value of the Content-Description MIME header.

Content-Disposition

Value of the Content-Disposition MIME header.

Content-ID

Value of the Content-ID MIME header.

MIME Header Namespace

Special register namespace from which additional MIME headers for the attachment are taken. If no value is specified, no MIME headers are added beyond those generated by the header-specific agent parameters.



x
XDAttachmentFromDocAgent

The XDAttachmentFromDocAgent adds a new attachment with the contents determined by the input document. The attachment headers are specified with user parameters. The name and value of the user parameter become the name and value of the header. Notice the value of the Content-ID header is taken as is, so the value must contain the surrounding angle brackets.

For example, a valid value for Content-ID might be <cid>. The Attachment Type parameter specifies the attachment Content-Type. If the Attachment Type is omitted, a Content-Type is chosen based on the document data: application/binary if the document contains bytes, text/plain if the document is flat, application/xml otherwise. The optional Attachment Name parameter controls the name sub-parameter of the Content-Type header. The Content-Type name can also be given directly in the Content-Type header value if desired.

The Body Result parameter specifies what to return in the output document: "keep" copies the input document to the output document, "empty" returns an empty document instead. This agent follows OnSuccess upon successful execution, otherwise it follows the fail_attach edge.



x
Procedure: How to Configure the XDAttachmentFromDocAgent

To configure the XDAttachmentFromDocAgent:

  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 Document to Attachment {com.ibi.agents.XDAttachmentFromDocAgent} 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 XDAttachmentFromDocAgent parameters.

    For more information, see XDAttachmentFromDocAgent Configuration Parameters.

  6. Click Next.

    You are returned to the Select listener type pane.

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

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



x
Reference: XDAttachmentFromDocAgent Configuration Parameters

The following table lists and describes parameters for the XDAttachmentFromDocAgent.

Parameter

Description

Attachment Name

The name of this attachment, for example, file name.

Attachment type

The MIME type. If no value is specified, the attachment type is generated based on the data format.

Body Result

Specify how to handle the body of this document by selecting one of the following values from the drop-down list:

  • keep (default)
  • empty


iWay Software