Show Table of Contents

4.12. Assignment
The assignment mechanism allows you to pass data into, and retrieve data out of, Activities in Business Processes. Assignments that pass data into Activities are executed before the Activity itself is executed. Assignments map from Business Process variables to local data items in activities, known as DataInputs. Assignments that retrieve data from Activities are executed after the Activity has executed. They map from local data items in activities, known as DataOutputs, to Business Process variables.
4.12.1. Data I/O Editor
The Data I/O Editor is the dialog used to define Activity DataInputs and DataOutputs, as well as the mappings between them and process variables.
Like Process Variables, DataInputs and DataOutputs have a name and data-type, such as Integer, String, or a subclass of Java Object, such as a user-defined Data Object created within JBoss BPM Suite. The data-types of DataInputs and DataOutputs should match the data-types of the Process Variables which they are mapped to or from. Their names may be the same as the corresponding Process Variables, but this is not a requirement.
Process Variables are defined in the property of the Business Process. Element DataInputs and DataOutputs are defined in one of three properties of Activities, depending on the element type:
- Elements such as
User TasksandCall Activities, which have both DataInputs and DataOutputs, use a property calledAssignments. - Elements such as
Start EventsandIntermediate Catch Events, which have DataOutputs but do not have DataInputs, use a property calledDataOutputAssociations. - Elements such as
End EventsandIntermediate Throw Events, which have DataInputs but do not have DataOutputs, use a property calledDataInputAssociations.
The
Assignments, DataOutputAssociations, and DataInputAssociations properties are all edited in the Data I/O Editor. DataInputs can have values assigned to them either by mapping from process variables or by assigning constant values to them. DataOutputs are mapped to Process Variables.
To define the DataInputs, DataOutputs and Assignments for an Element, select the Element in the Business Process and click the
button to open the Data I/O Editor. Data Input Assignments and Data Output Assignments can be added by clicking the button.
button to open the Data I/O Editor. Data Input Assignments and Data Output Assignments can be added by clicking the button.

You can also open the Data I/O Editor to edit the Data Inputs and/or Outputs by editing the appropriate property for the activity:
Assignments, DataOutputAssociations, or DataInputAssociations.
Note
The Data I/O Editor tool is available in Red Hat JBoss BPM Suite 6.2 or better.
4.12.2. Data I/O Editor Example
In the following example, the Data I/O Editor has been used to create some Data Inputs and Data Outputs for the User Activity 'Check Invoice'. The example makes use of two Process Variables that have been defined in the process:
invoicewith typeorg.kie.test.Invoice.reasonwith typeString.

The following Inputs have been added:
- invoice
- reason
- maxamount
- myvar
The Data Inputs and Outputs are linked to the corresponding Process Variables by setting the and fields in the dialog.
The Data I/O Editor allows you to create and assign a constant to a DataInput when setting the column for a DataInput. This is demonstrated by the'maxamount' DataInput, that has the constant
1000.00, which will be assigned to it at runtime.
The 'myvar' DataInput and DataOutput demonstrates a custom 'com.test.MyType', which is entered in the dialog by the user.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.