Merge "Add 'runtime_context' to task execution REST resource"
This commit is contained in:
commit
d71b48d40a
|
@ -297,6 +297,8 @@ class Task(resource.Resource):
|
|||
state_info = wtypes.text
|
||||
"an optional state information string"
|
||||
|
||||
runtime_context = types.jsontype
|
||||
|
||||
result = wtypes.text
|
||||
published = types.jsontype
|
||||
processed = bool
|
||||
|
@ -318,6 +320,14 @@ class Task(resource.Resource):
|
|||
workflow_execution_id='123e4567-e89b-12d3-a456-426655440000',
|
||||
name='task',
|
||||
state=states.SUCCESS,
|
||||
runtime_context={
|
||||
'triggered_by': [
|
||||
{
|
||||
'task_id': '123-123-123',
|
||||
'event': 'on-success'
|
||||
}
|
||||
]
|
||||
},
|
||||
result='task result',
|
||||
published={'key': 'value'},
|
||||
processed=True,
|
||||
|
|
|
@ -30,6 +30,14 @@ from mistral.workflow import states
|
|||
|
||||
RESULT = {"some": "result"}
|
||||
PUBLISHED = {"var": "val"}
|
||||
RUNTIME_CONTEXT = {
|
||||
'triggered_by': [
|
||||
{
|
||||
'task_id': '123-123-123',
|
||||
'event': 'on-success'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
WF_EX = models.WorkflowExecution(
|
||||
id='abc',
|
||||
|
@ -59,7 +67,7 @@ TASK_EX = models.TaskExecution(
|
|||
state=states.RUNNING,
|
||||
tags=['a', 'b'],
|
||||
in_context={},
|
||||
runtime_context={},
|
||||
runtime_context=RUNTIME_CONTEXT,
|
||||
workflow_execution_id=WF_EX.id,
|
||||
created_at=datetime.datetime(1970, 1, 1),
|
||||
updated_at=datetime.datetime(1970, 1, 1),
|
||||
|
@ -82,7 +90,7 @@ WITH_ITEMS_TASK_EX = models.TaskExecution(
|
|||
state=states.RUNNING,
|
||||
tags=['a', 'b'],
|
||||
in_context={},
|
||||
runtime_context={},
|
||||
runtime_context=RUNTIME_CONTEXT,
|
||||
workflow_execution_id=WF_EX.id,
|
||||
created_at=datetime.datetime(1970, 1, 1),
|
||||
updated_at=datetime.datetime(1970, 1, 1),
|
||||
|
@ -101,6 +109,7 @@ TASK = {
|
|||
'updated_at': '1970-01-01 00:00:00',
|
||||
'result': json.dumps(RESULT),
|
||||
'published': json.dumps(PUBLISHED),
|
||||
'runtime_context': json.dumps(RUNTIME_CONTEXT),
|
||||
'processed': True
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue