|
BPMN-OS
BPMN for optimization and simulation
|
A token at an activity with a multi-instance marker changes its state as follows:
stateDiagram-v2
state departure <<choice>>
[*] --> ARRIVED
note left of ARRIVED
If an activity does not have any incoming sequence flows,
the ARRIVED state is skipped
end note
ARRIVED --> WAITING: ready event
WAITING --> departure
WAITING --> FAILING
WAITING --> FAILED
FAILING --> FAILED
departure --> DEPARTED: [outgoing sequence flow]
departure --> DONE: [no outgoing sequence flow]
DEPARTED --> [*]
DONE --> [*]
FAILED --> [*]
A token in ARRIVED state waits for a ready event indicating that all relevant data has become known. When the event occurs, the token state is updated to WAITING after token copies for each activity instance are created as described below.
If a loop cardinalty parameter is provided, the respective number of token copies is created. If the token is at a multi-instance send task or receive task, a token copy is created for each message definition.
If a loop index parameter is provided, the respective attribute of the i th token copy receives the value i. Moreover, for each attribute for which a collection is provided, the i th token copy receives the value of the i th element in the collection.
Depending on whether the multi-instance activity is parallel or sequential, each token copy is advanced in parallel or sequential fashion. These tokens change their states as described in Subprocesses and ad-hoc subprocesses or Tasks except that the ARRIVED, DEPARTED, and DONE states are skipped.
A token in WAITING state remains in this state until all token copies have passed the EXITING state or have terminated with a failure. The token state is then updated accordingly.
When the token reaches DEPARTED state, the token moves to the next node.
When the token reaches DONE state, the token remains at the node until all other tokens in the parent scope have reached DONE state or a failure occurred.
Upon failure, the state of a token at an error boundary event is changed to COMPLETED. If no such error boundary event exists, the error is bubbled up to its parent scope.