Example Workflows
What This Is About
The following paragraphs showcase example Workflows which can be used to learn and understand commonly used structures and usecases. Every paragraph title is a link allowing you to download the corresponding BPMN and try it out yourself.
Structural Patterns
The following paragraph explores commonly used structural pattern, which can be used to better control the flow of a Workflow.
Loops
The Editor has no explicit element representing loops. But this does not hinder to use loops in the Workflows anyway. Gateways are the solution and the following paragraphs will show examples for different loop types.
For Loop
The Workflow shows how to create a For
loop as known from Java. The known form of
for(int i = 0;i<5;i++){
LOG.info(String.format("Current value i == %d",i));
}
is represented in the Write Value
-Command for int i = 0
, the path condition for i<5
and the Counter
-Command for i++
.
For Each
The Workflow shows how to create a For Each
loop. The core command is Collection Iterator
and runs the loop until all items of the collection are handled once.
The Collection Iterator cannot handle initially empty collections and will throw an exception.
|
For Each (Empty Collection)
The Workflow shows how to create a For Each
loop. The core command is Collection Iterator
and runs the loop until all items of the collection are handled once. Furthermore, it does not fail like the For Each
before when the loop is started with an initial empty collection, but will skip the loop instead and continue with the tasks afterwards.
While
The Workflow shows how to create a While
loop. You give in a word and it iterates over all its chars until all are logged once. It is structurally the same as the For-Each
loop but is not dependent on the Collection Iterator
-Command.
Do-While
The Workflow shows how to create a Do-While
loop. You give in a word and it iterates over all its chars until all are logged once. It executes the commands in the ‚do‘-part once before checking the condition to repeat the ‚do‘-part.