Rework workflow step scheduling to improve stacktraces

The initial implementation caused them to be flaky when working
with loops.
This commit is contained in:
Tomaž Jerman
2021-08-17 09:18:50 +02:00
parent fdbf7e6d53
commit 244b0cf8ed
13 changed files with 474 additions and 34 deletions
@@ -0,0 +1,25 @@
namespaces:
ns1:
name: ns1 name
modules:
mod1:
name: mod1 name
fields:
f1:
label: f1 label
kind: String
required: false
records:
mod1:
- values:
f1: 1
- values:
f1: 2
- values:
f1: 3
- values:
f1: 4
- values:
f1: 5
+29
View File
@@ -0,0 +1,29 @@
workflows:
testing:
enabled: true
trace: true
triggers:
- enabled: true
stepID: 10
steps:
- stepID: 10
kind: iterator
ref: composeRecordsEach
arguments:
- { "target": "module", "value": "mod1", "type": "Handle" }
- { "target": "namespace", "value": "ns1", "type": "Handle" }
results:
- { "target": "r", "expr": "record" }
- { "target": "i", "expr": "index" }
- { "target": "t", "expr": "total" }
- stepID: 11
kind: continue
- stepID: 12
kind: termination
paths:
- { parentID: 10, childID: 11 }
- { parentID: 10, childID: 12 }
@@ -0,0 +1,19 @@
workflows:
testing:
enabled: true
trace: true
triggers:
- enabled: true
stepID: 10
steps:
- stepID: 10
kind: expressions
arguments:
- { "target": "test", "value": "42", "type": "Any" }
- stepID: 11
kind: termination
paths:
- { parentID: 10, childID: 11 }
@@ -0,0 +1,13 @@
workflows:
testing:
enabled: true
trace: true
triggers:
- enabled: true
stepID: 10
steps:
- stepID: 10
kind: expressions
arguments:
- { "target": "test", "value": "42", "type": "Any" }
@@ -0,0 +1,120 @@
workflows:
case1:
enabled: true
trace: true
triggers:
- enabled: true
stepID: 10
steps:
- stepID: 10
kind: gateway
ref: excl
- stepID: 11
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 1", type: "String"}
- stepID: 12
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 2", type: "String"}
- stepID: 13
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 3", type: "String"}
- stepID: 14
kind: termination
paths:
- { parentID: 10, childID: 11, expr: "true == true" }
- { parentID: 10, childID: 12, expr: "true == true" }
- { parentID: 10, childID: 13, expr: "" }
- { parentID: 11, childID: 14 }
- { parentID: 12, childID: 14 }
- { parentID: 13, childID: 14 }
case2:
enabled: true
trace: true
triggers:
- enabled: true
stepID: 10
steps:
- stepID: 10
kind: gateway
ref: excl
- stepID: 11
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 1", type: "String"}
- stepID: 12
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 2", type: "String"}
- stepID: 13
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 3", type: "String"}
- stepID: 14
kind: termination
paths:
- { parentID: 10, childID: 11, expr: "true == false" }
- { parentID: 10, childID: 12, expr: "true == true" }
- { parentID: 10, childID: 13, expr: "" }
- { parentID: 11, childID: 14 }
- { parentID: 12, childID: 14 }
- { parentID: 13, childID: 14 }
case3:
enabled: true
trace: true
triggers:
- enabled: true
stepID: 10
steps:
- stepID: 10
kind: gateway
ref: excl
- stepID: 11
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 1", type: "String"}
- stepID: 12
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 2", type: "String"}
- stepID: 13
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 3", type: "String"}
- stepID: 14
kind: termination
paths:
- { parentID: 10, childID: 11, expr: "true == false" }
- { parentID: 10, childID: 12, expr: "true == false" }
- { parentID: 10, childID: 13, expr: "" }
- { parentID: 11, childID: 14 }
- { parentID: 12, childID: 14 }
- { parentID: 13, childID: 14 }
@@ -0,0 +1,46 @@
workflows:
case1:
enabled: true
trace: true
triggers:
- enabled: true
stepID: 10
steps:
- stepID: 10
kind: gateway
ref: fork
- stepID: 11
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 1", type: "String"}
- stepID: 12
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 2", type: "String"}
- stepID: 13
kind: function
ref: logInfo
arguments:
- {target: "message", value: "log 3", type: "String"}
- stepID: 14
kind: gateway
ref: join
- stepID: 15
kind: termination
paths:
- { parentID: 10, childID: 11 }
- { parentID: 10, childID: 12 }
- { parentID: 10, childID: 13 }
- { parentID: 11, childID: 14 }
- { parentID: 12, childID: 14 }
- { parentID: 13, childID: 14 }
- { parentID: 14, childID: 15 }