An example of the XML of a decision table task is:
<bpmn2:serviceTask id="ServiceTask_4" implementation="dmn-connector.EXECUTE_TABLE" />
An example of the Extensions Editor JSON of a process containing a decision table task is:
"constants": {
"ServiceTask_2f85xew": {
"_activiti_dmn_table_": {
"value": "my-decision-table-1"
}
}
},
An example of the XML for an element that contains sequential multi-instance elements is:
<bpmn2:multiInstanceLoopCharacteristics isSequential="true" />
An example of the XML for an element that contains parallel multi-instance elements is:
<bpmn2:multiInstanceLoopCharacteristics isSequential="false" />
or
<bpmn2:multiInstanceLoopCharacteristics />
An example of the XML of multi-instance cardinality is:
<bpmn2:multiInstanceLoopCharacteristics> <bpmn2:loopCardinality>5</bpmn2:loopCardinality> </bpmn2:multiInstanceLoopCharacteristics>
An example of the XML of a multi-instance collection is:
<bpmn2:userTask id="UserTask_1n1uk4a" activiti:assignee="${user}">
<bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
<bpmn2:multiInstanceLoopCharacteristics activiti:collection="${userList.users}" activiti:elementVariable="user">
</bpmn2:multiInstanceLoopCharacteristics>
</bpmn2:userTask>
{"users":["user1", "user2", "user3"]}
In the example:
- Three user tasks will be created because there are three items in the process variable that activiti:collection uses.
- A variable will be created for each instance called users with the values user1, user2 and user3 because the activiti:elementVariable is set to "users".
- A user tasks will be assigned to each of the users because the activiti:assignee is set to {users} which is the name of the variable created in each instance by the element variable.
An example of the XML of a multi-instance completion condition is:
<bpmn2:multiInstanceLoopCharacteristics>
<bpmn2:loopCardinality>10</bpmn2:loopCardinality>
<bpmn2:completionCondition>${nrOfCompletedInstances/nrOfInstances >= 0.6 }</bpmn2:completionCondition>
</bpmn2:multiInstanceLoopCharacteristics>
An example of the XML of a multi-instance element is:
<bpmn2:userTask id="UserTask_1n1uk4a" activiti:assignee="${users}">
<bpmn2:multiInstanceLoopCharacteristics isSequential="true">
<bpmn2:loopCardinality>4</bpmn2:loopCardinality>
<bpmn2:loopDataOutputRef>choices</bpmn2:loopDataOutputRef>
<bpmn2:outputDataItem name="flavor" />
</bpmn2:multiInstanceLoopCharacteristics>
</bpmn2:userTask>
The user task will run 4 times sequentially and the values of flavor from the form will be stored as a JSON object in the variable choices. The process variable choices will contain a list of results similar to the following:
["chocolate", "mint", "strawberry"]