diff --git a/swf/models/workflow.py b/swf/models/workflow.py index f2192f8..b3ee612 100644 --- a/swf/models/workflow.py +++ b/swf/models/workflow.py @@ -313,6 +313,7 @@ class WorkflowExecution(BaseModel): 'workflow_id', 'run_id', 'status', + 'workflow_type', 'task_list', 'child_policy', 'close_status', @@ -322,17 +323,18 @@ class WorkflowExecution(BaseModel): 'decision_tasks_timeout', ] - def __init__(self, domain, - workflow_id, run_id=None, - status=STATUS_OPEN, task_list=None, - child_policy=None, close_status=None, - execution_timeout=None, input=None, - tag_list=None, decision_tasks_timeout=None, + def __init__(self, domain, workflow_id, run_id=None, + status=STATUS_OPEN, workflow_type=None, + task_list=None, child_policy=None, + close_status=None, execution_timeout=None, + input=None, tag_list=None, + decision_tasks_timeout=None, *args, **kwargs): self.domain = domain self.workflow_id = workflow_id self.run_id = run_id self.status = status + self.workflow_type = workflow_type self.task_list = task_list self.child_policy = child_policy self.close_status = close_status diff --git a/swf/querysets/workflow.py b/swf/querysets/workflow.py index 696ba78..2c8bcb7 100644 --- a/swf/querysets/workflow.py +++ b/swf/querysets/workflow.py @@ -430,10 +430,17 @@ def get_workflow_type(self, execution_info): ) def to_WorkflowExecution(self, domain, execution_info, **kwargs): + workflow_type = WorkflowType( + self.domain, + execution_info['workflowType']['name'], + execution_info['workflowType']['version'] + ) + return WorkflowExecution( domain, get_subkey(execution_info, ['execution', 'workflowId']), # workflow_id run_id=get_subkey(execution_info, ['execution', 'runId']), + workflow_type=workflow_type, status=execution_info.get('executionStatus'), close_status=execution_info.get('closeStatus'), tag_list=execution_info.get('tagList'),