Workflow ES 2.2
Workflow ES 2.2
Parallel Sequences
Run several sequences of steps in parallel
class Parallel_Workflow {
build(builder) {
builder
.startWith(SayHello)
.parallel()
.do(branch1 => branch1
.startWith(PrintMessage)
.input((step, data) => step.message = "Running in branch 1")
.delay(data => 5000)
.then(DoSomething)
)
.do(branch2 => branch2
.startWith(PrintMessage)
.input((step, data) => step.message = "Running in branch 2")
)
.do(branch3 => branch3
.startWith(PrintMessage)
.input((step, data) => step.message = "Running in branch 3")
)
.join()
.then(SayGoodbye);
}
}