WriteQueue

Use the WriteQueue activity to write messages to a data queue on an IBM i system.

General

The General tab contains the following fields:

Field Process Property? Module Property? Description
Name No No The name to be displayed as the label for the activity in the process.
IBM i Connection No Yes Click to select an IBM i shared resource.

If no matching IBM i shared resources are found, click Create Shared Resource to create one. See Creating an IBM i Shared Resource for more details.

Data Queue Yes Yes The name of the data queue(*DTAQ) to write messages to. The format of the data queue name is library_name/data_queue_name.

Type the data queue name manually, or click to open the Fetch Object dialog. All libraries are listed in the dialog, you can expand each library to view a list of available data queues.

Note: The plug-in supports the wildcard queries, you can also use the *LIBL/data_queue_name format to specify a data queue.

Description

A short description of the WriteQueue activity.

Advanced

In the Advanced tab, you can customize a message schema to write messages to a data queue.

Click Initialize Schema to initialize a message schema. To create a message schema, see Creating a Message Schema for more information. Click Copy to copy the message schema to another activity. Click Paste to overwrite the current schema with a schema copied from another activity.

Column Name Description
Input Source Select either a DedicatedSchema or Binary input for the activity. If you select a dedicated schema, you can construct the format of the message in the wizard below. If you select a binary input, the input schema will present fields for the key and raw bytes to be mapped. This is useful when rendering data via the Data Conversion Plug-in. The schema construction wizard is disabled if you select binary input.
Schema The schema that you want to define.
Note: If the data queue you want write message to is a keyed data queue, after clicking Initialize Schema, a key item is displayed in this column. If the data queue you are writing messages to is using the shared message concept, the first field in the schema (after the key field, if any) must be a character field named sharedMessage.
Description A short description of the parameter.
IBM i Type The data type of a parameter that is defined on an IBM i system.
Plugin Type The data type used in this plug-in corresponding to the data type on the IBM i system.
Sequence

Enter an integer for the corresponding item or schemaNode.

The entered value indicates the maximum occurrences of the attribute in the Input tab.

For example, if you enter 3 as the sequence value for a NAME parameter, then in the Input tab, you can right-click the NAME parameter and click Duplicate to create a same NAME parameter. You can create two NAME parameters at most because the specified sequence is 3.

Directionality This field can be one of three values: "inout", "in" or "out". These values control whether the field will fall on the input, output, or both schema tabs for mapping purposes. It is only applicable for program and service program activities and should be defaulted to "inout" for all others.

Input

The input elements for WriteQueue activity vary depending on the message schema you defined in the Advanced tab. The input tab contains the following element:
Input Item Description
dataqueue The name of the data queue(*DTAQ) to write messages to. The format of the data queue name is library_name/data_queue_name.
Note: If you enter nothing in this element, the WriteQueue activity writes the message to the data queue you specified in the Data Queue field in the General tab.

If you enter a data queue name which is different from the data queue you specified in the Data Queue field in the General tab, the WriteQueue activity write the message to the data queue in the Input tab.

key If the data queue is a keyed queue, a key value can be specified in this column.

Output

The following is the output for WriteQueue activity:

Output Item Data Type Description
Success Boolean A value of true indicates the operation succeeded.

A value of false indicates the operation failed.

Fault

The Fault tab lists exceptions that are thrown by the WriteQueue activity:

Fault Thrown When...
IBMiPluginException The plug-in fails to get a status response due to a plug-in error.
ActivityTimedOutException The plug-in fails to get a status response due to a timeout error.
IBMiParameterConvertException The plug-in fails to convert the schema parameters.
IBMiRemoteException The plug-in fails to communicate with an IBM i system.