The "context" parameter of Action.run() isn't filled properly for asynchronous actions. Asynchronous actions need things like "workflow_execution_id" but this parameter is just a MistralContext object that holds security info which is in conflict with the description of this parameter (see [1]). I think we didn't fully account for that during "mistral-lib" related refactoring.
So, "context" parameter, in my opinion, should be more structured so that we know what it contains. The suggestion is to create a class in mistral-lib called something like ActionContext that would look like:
class ActionContext(object):
def __init__(security_ctx, execution_ctx):
...
class SecurityContext(object):
# Same info as we have in MistralContext class..
class ExecutionContext(object):
def __init__(workflow_execution_id, task_execution_id, ...)
...
Once this is made we need to validate that pure asynchronous actions work properly (all contextual info is available) as well as ad-hoc actions built on top of them. See [2].
links:
[1] https://github.com/openstack/mistral-lib/blob/master/mistral_lib/actions/base.py#L40
[2] https://github.com/openstack/mistral/blob/master/mistral/engine/actions.py#L338
WIP patch which better illustrates the problem: https:/ /review. openstack. org/#/c/ 505508/