Please note the WF is slightly different. This is another bug. There's a race condition on publishing vars. Whereas the one above failed to execute the join task.
EXPECTED: { "is_done": true, "var1": true, "var2": true }
ACTUAL: { "is_done": true, "var1": false, "var2": true }
~/st2$ cat ~/tmp/test-complex-join.yaml version: '2.0' name: test-complex-join
workflows:
main: type: direct output: var1: <% $.var1 %> var2: <% $.var2 %> is_done: <% $.is_done %> tasks: init: publish: var1: false var2: false is_done: false policies: wait-after: 1 on-success: - branch1 - branch2 branch1: workflow: work publish: var1: true policies: retry: count: 10 delay: 2 on-success: - done branch2: publish: var2: true on-success: - done done: join: all publish: is_done: true
work: type: direct tasks: do: action: std.echo output="Doing..." on-success: - exit exit: action: std.echo output="Exiting..."
~$ mistral workbook-create ~/tmp/test-complex-join.yaml Starting new HTTP connection (1): localhost +------------+----------------------------+ | Field | Value | +------------+----------------------------+ | Name | test-complex-join | | Tags | <none> | | Created at | 2015-02-22 23:15:42.201216 | | Updated at | None | +------------+----------------------------+
~$ mistral execution-create test-complex-join.main Starting new HTTP connection (1): localhost +------------+--------------------------------------+ | Field | Value | +------------+--------------------------------------+ | ID | 95b37c87-02c3-4991-903e-0a2619419a2d | | Workflow | test-complex-join.main | | State | RUNNING | | Created at | 2015-02-22T23:15:52.054730 | | Updated at | 2015-02-22T23:15:52.081809 | +------------+--------------------------------------+
~$ mistral execution-list Starting new HTTP connection (1): localhost +--------------------------------------+------------------------+---------+---------------------+---------------------+ | ID | Workflow | State | Created at | Updated at | +--------------------------------------+------------------------+---------+---------------------+---------------------+ | 95b37c87-02c3-4991-903e-0a2619419a2d | test-complex-join.main | SUCCESS | 2015-02-22 23:15:52 | 2015-02-22 23:15:54 | | 1f1951df-4cc6-4b7f-b93f-f0ab4288d589 | test-complex-join.work | SUCCESS | 2015-02-22 23:15:53 | 2015-02-22 23:15:54 | +--------------------------------------+------------------------+---------+---------------------+---------------------+
~$ mistral task-list Starting new HTTP connection (1): localhost +--------------------------------------+---------+------------------------+--------------------------------------+---------+ | ID | Name | Workflow name | Execution ID | State | +--------------------------------------+---------+------------------------+--------------------------------------+---------+ | 6842c2ed-0b25-4c73-a75b-2a8c06da7cca | init | test-complex-join.main | 95b37c87-02c3-4991-903e-0a2619419a2d | SUCCESS | | 0f0b1f00-4887-4834-a3be-4b64fa95ee9a | branch1 | test-complex-join.main | 95b37c87-02c3-4991-903e-0a2619419a2d | SUCCESS | | 15efe17f-6d44-406f-ae05-87970b5ca274 | do | test-complex-join.work | 1f1951df-4cc6-4b7f-b93f-f0ab4288d589 | SUCCESS | | 35a90db5-4543-43d5-80f4-398db522f8b1 | branch2 | test-complex-join.main | 95b37c87-02c3-4991-903e-0a2619419a2d | SUCCESS | | aaeabc83-1b68-40fc-92fc-62822e80fae3 | done | test-complex-join.main | 95b37c87-02c3-4991-903e-0a2619419a2d | SUCCESS | | b35f81a0-8b55-4a10-9bf2-c0e9d8cc8b1b | exit | test-complex-join.work | 1f1951df-4cc6-4b7f-b93f-f0ab4288d589 | SUCCESS | +--------------------------------------+---------+------------------------+--------------------------------------+---------+
~$ mistral execution-get-output 95b37c87-02c3-4991-903e-0a2619419a2d Starting new HTTP connection (1): localhost { "is_done": true, "var1": false, "var2": true }
Please note the WF is slightly different. This is another bug. There's a race condition on publishing vars. Whereas the one above failed to execute the join task.
EXPECTED:
{
"is_done": true,
"var1": true,
"var2": true
}
ACTUAL:
{
"is_done": true,
"var1": false,
"var2": true
}
~/st2$ cat ~/tmp/test- complex- join.yaml
version: '2.0'
name: test-complex-join
workflows:
main:
is_ done: <% $.is_done %>
publish:
var1: false
var2: false
is_ done: false
policies:
wait- after: 1
on-success:
- branch1
- branch2
branch1:
workflow: work
publish:
var1: true
policies:
retry:
count: 10
delay: 2
on-success:
- done
branch2:
publish:
var2: true
on-success:
- done
join: all
publish:
is_ done: true
type: direct
output:
var1: <% $.var1 %>
var2: <% $.var2 %>
tasks:
init:
done:
work:
action: std.echo output="Doing..."
on-success:
- exit
action: std.echo output="Exiting..."
type: direct
tasks:
do:
exit:
~$ mistral workbook-create ~/tmp/test- complex- join.yaml ------+ ------- ------- ------- ------- + ------+ ------- ------- ------- ------- + ------+ ------- ------- ------- ------- +
Starting new HTTP connection (1): localhost
+------
| Field | Value |
+------
| Name | test-complex-join |
| Tags | <none> |
| Created at | 2015-02-22 23:15:42.201216 |
| Updated at | None |
+------
~$ mistral execution-create test-complex- join.main ------+ ------- ------- ------- ------- ------- ---+ ------+ ------- ------- ------- ------- ------- ---+ 02c3-4991- 903e-0a2619419a 2d | join.main | 22T23:15: 52.054730 | 22T23:15: 52.081809 | ------+ ------- ------- ------- ------- ------- ---+
Starting new HTTP connection (1): localhost
+------
| Field | Value |
+------
| ID | 95b37c87-
| Workflow | test-complex-
| State | RUNNING |
| Created at | 2015-02-
| Updated at | 2015-02-
+------
~$ mistral execution-list ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ----+-- ------- ------- -----+- ------- ------- ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ----+-- ------- ------- -----+- ------- ------- ------+ 02c3-4991- 903e-0a2619419a 2d | test-complex- join.main | SUCCESS | 2015-02-22 23:15:52 | 2015-02-22 23:15:54 | 4cc6-4b7f- b93f-f0ab4288d5 89 | test-complex- join.work | SUCCESS | 2015-02-22 23:15:53 | 2015-02-22 23:15:54 | ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ----+-- ------- ------- -----+- ------- ------- ------+
Starting new HTTP connection (1): localhost
+------
| ID | Workflow | State | Created at | Updated at |
+------
| 95b37c87-
| 1f1951df-
+------
~$ mistral task-list ------- ------- ------- ------- ----+-- ------- +------ ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ----+ ------- ------- ------- ------- ----+-- ------- +------ ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ----+ 0b25-4c73- a75b-2a8c06da7c ca | init | test-complex- join.main | 95b37c87- 02c3-4991- 903e-0a2619419a 2d | SUCCESS | 4887-4834- a3be-4b64fa95ee 9a | branch1 | test-complex- join.main | 95b37c87- 02c3-4991- 903e-0a2619419a 2d | SUCCESS | 6d44-406f- ae05-87970b5ca2 74 | do | test-complex- join.work | 1f1951df- 4cc6-4b7f- b93f-f0ab4288d5 89 | SUCCESS | 4543-43d5- 80f4-398db522f8 b1 | branch2 | test-complex- join.main | 95b37c87- 02c3-4991- 903e-0a2619419a 2d | SUCCESS | 1b68-40fc- 92fc-62822e80fa e3 | done | test-complex- join.main | 95b37c87- 02c3-4991- 903e-0a2619419a 2d | SUCCESS | 8b55-4a10- 9bf2-c0e9d8cc8b 1b | exit | test-complex- join.work | 1f1951df- 4cc6-4b7f- b93f-f0ab4288d5 89 | SUCCESS | ------- ------- ------- ------- ----+-- ------- +------ ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ----+
Starting new HTTP connection (1): localhost
+------
| ID | Name | Workflow name | Execution ID | State |
+------
| 6842c2ed-
| 0f0b1f00-
| 15efe17f-
| 35a90db5-
| aaeabc83-
| b35f81a0-
+------
~$ mistral execution- get-output 95b37c87- 02c3-4991- 903e-0a2619419a 2d
Starting new HTTP connection (1): localhost
{
"is_done": true,
"var1": false,
"var2": true
}