Sequencing Operations
Declarative
val step1 = WIO.pure(MyState(1)).autoNamed
val step2 = WIO.pure(MyState(2)).autoNamed
val step3 = WIO.pure(MyState(3)).autoNamed
val sequence1 = step1 >>> step2 >>> step3
val sequence2 = step1.andThen(step2).andThen(step3)
- Flowchart
- BPMN
- Model
{
"steps" : [
{
"meta" : {
"name" : "Step1",
"error" : null
},
"_type" : "Pure"
},
{
"meta" : {
"name" : "Step2",
"error" : null
},
"_type" : "Pure"
},
{
"meta" : {
"name" : "Step3",
"error" : null
},
"_type" : "Pure"
}
],
"_type" : "Sequence"
}
Dynamic
val step1 = WIO.pure(MyState(1)).autoNamed
val step2 = WIO.pure(MyState(2)).autoNamed
val step3 = WIO.pure(MyState(3)).autoNamed
val sequence1 = for {
a <- step1
b <- step2
c <- step3
} yield c
val sequence2 = step1.flatMap(_ => step2).flatMap(_ => step3)
- Flowchart
- BPMN
- Model
{
"steps" : [
{
"meta" : {
"name" : "Step1",
"error" : null
},
"_type" : "Pure"
},
{
"meta" : {
"error" : null
},
"_type" : "Dynamic"
}
],
"_type" : "Sequence"
}