Closed sumeetisp closed 6 years ago
The problem with your first option is that since you don't have any on-success:
criteria for get_box_details
, it executes tasks in parallel, not sequentially. So it is trying to reference $.result
in print_result
before it has been published.
See https://docs.stackstorm.com/mistral.html
In this example, we have a second task named “task2”. It might be natural to think that “task2” will be executed after “task1”, i.e, in sequential order. However, when no tasks attributes like on-complete, on-success and on-error are defined, tasks are run in parallel. This is possible with Mistral because it provides a join flow control which allows us to synchronize multiple parallel workflow branches and aggregate their data.
Consider following workflows,
Scenario 1:
This above scenario gives an error as follows,
Failed to handle action completion [error=Can not evaluate YAQL expression [expression=$.result
Scenario 2:
The above scenario executes successfully.
To access variables published by task1 in task2, should task2 be specified in on-success criteria of task1?
If not, then why does scenario 1 fail?