Skip to content
This repository was archived by the owner on Apr 12, 2018. It is now read-only.

Commit 06568df

Browse files
committed
Expose more workflow execution attributes
1 parent 0efb820 commit 06568df

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

swf/models/workflow.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ class WorkflowExecution(BaseModel):
337337
'decision_tasks_timeout',
338338
'close_timestamp',
339339
'start_timestamp',
340+
'cancel_requested',
341+
'latest_execution_context',
342+
'latest_activity_task_timestamp',
343+
'open_counts',
344+
'parent',
340345
]
341346

342347
def __init__(self, domain, workflow_id, run_id=None,
@@ -347,6 +352,11 @@ def __init__(self, domain, workflow_id, run_id=None,
347352
decision_tasks_timeout=None,
348353
close_timestamp=None,
349354
start_timestamp=None,
355+
cancel_requested=None,
356+
latest_execution_context=None,
357+
latest_activity_task_timestamp=None,
358+
open_counts=None,
359+
parent=None,
350360
*args, **kwargs):
351361
Domain.check(domain)
352362
self.domain = domain
@@ -363,6 +373,11 @@ def __init__(self, domain, workflow_id, run_id=None,
363373
self.decision_tasks_timeout = decision_tasks_timeout
364374
self.close_timestamp = close_timestamp
365375
self.start_timestamp = start_timestamp
376+
self.cancel_requested = cancel_requested
377+
self.latest_execution_context = latest_execution_context
378+
self.latest_activity_task_timestamp = latest_activity_task_timestamp
379+
self.open_counts = open_counts or {} # so we can query keys in any case
380+
self.parent = parent or {} # so we can query keys in any case
366381

367382
# immutable decorator rebinds class name,
368383
# so have to use generice self.__class__

swf/querysets/workflow.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ def to_WorkflowExecution(self, domain, execution_info, **kwargs):
447447
tag_list=execution_info.get('tagList'),
448448
start_timestamp=execution_info.get('startTimestamp'),
449449
close_timestamp=execution_info.get('closeTimestamp'),
450+
cancel_requested=execution_info.get('cancelRequested'),
451+
parent=execution_info.get('parent'),
450452
**kwargs
451453
)
452454

@@ -473,6 +475,9 @@ def get(self, workflow_id, run_id, *args, **kwargs):
473475
child_policy=execution_config.get('childPolicy'),
474476
execution_timeout=execution_config.get('executionStartToCloseTimeout'),
475477
decision_tasks_timeout=execution_config.get('taskStartToCloseTimeout'),
478+
latest_activity_task_timestamp=response.get('latestActivityTaskTimestamp'),
479+
latest_execution_context=response.get('latestExecutionContext'),
480+
open_counts=response['openCounts'],
476481
)
477482

478483
def filter(self,

0 commit comments

Comments
 (0)