Global workflow context
We need to implement a global context for Mistral workflows. Currently 'publish' keyword in Mistral saves variables into a storage which are associated only with a branch.
Example:
my_wf:
tasks:
A:
action: std.noop
publish:
my_var: 1
on-success: A1
A1:
action: my_action param1=<% $.my_var %>
B:
action: std.noop
publish:
my_var: 2
on-success: B1
B1:
action: my_action param1=<% $.my_var %>
The expression "$.my_var" in the declaration of A1 will always evaluate to 1, for B1 will always evaluate to 2. This doesn't depend on order in which A and B will run. This is because we have two branches (A -> A1 and B -> B1) for which the variable "my_var" has its own different version.
Sometimes though we need to be able to pass data between branches. The concept of workflow global context can help solve this problem. A simple use case for this may be the following situation: one branch needs to notify the other one that it needs to stop.
Blueprint information
- Status:
- Complete
- Approver:
- Renat Akhmerov
- Priority:
- High
- Drafter:
- Renat Akhmerov
- Direction:
- Approved
- Assignee:
- Renat Akhmerov
- Definition:
- Superseded
- Series goal:
- Accepted for pike
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Renat Akhmerov
- Completed by
- Renat Akhmerov
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Rename package 'workbook' to 'lang'
Addressed by: https:/
WF global ctx: add "publish-global" into direct workflow task spec
Addressed by: https:/
WF global context: Implement global publishing using wf_ex.context
Addressed by: https:/
WF global context: add function global() to access global vars