State Task Sorting
Step 1: Removing cycles
Workflows cannot be sorted if they contain cycles. To solve this problem, some stateTasks are removed to make the workflows acyclic. This is done by walking through the workflow graph and removing any state transitions (begin to end state or begin to failed state) that end in states we have already seen.
Step 2: Sorting the states
The workflow graph is then sorted in a list of states in a way that for each two states that are connected by a state transition, the begin state occurs before the end or failed state.
Step 3: States to stateTasks
Finally, the list of states is mapped to a list of stateTasks by mapping each state to all stateTasks that begin in that state.
Consequences of this implementation
Because of the nature of this implementation, the following effects may occur:
- In case of cyclic workflows, instances may not reach their final end state in 1 sequence
- Branching end states are not taken into account
|201712||3.2.0||Implemented sorting of stateTasks before processing|
|201803||184.108.40.206||Fixed issue with single-state workflows|