Skip to content

Commit 7f6ecbd

Browse files
committed
support set custom status
Signed-off-by: Fabian Martinez <[email protected]>
1 parent 8b478a7 commit 7f6ecbd

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

examples/workflow/task_chaining.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def task_chain_workflow(ctx: wf.DaprWorkflowContext, wf_input: int):
2727
except Exception as e:
2828
yield ctx.call_activity(error_handler, input=str(e))
2929
raise
30+
# TODO update to set custom status
3031
return [result1, result2, result3]
3132

3233

ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_context.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def current_utc_datetime(self) -> datetime:
5353
def is_replaying(self) -> bool:
5454
return self.__obj.is_replaying
5555

56+
def set_custom_status(self, custom_status: str) -> None:
57+
self._logger.debug(f'{self.instance_id}: Setting custom status to {custom_status}')
58+
self.__obj.set_custom_status(custom_status)
59+
5660
def create_timer(self, fire_at: Union[datetime, timedelta]) -> task.Task:
5761
self._logger.debug(f'{self.instance_id}: Creating timer to fire at {fire_at} time')
5862
return self.__obj.create_timer(fire_at)

ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ def is_replaying(self) -> bool:
8484
"""
8585
pass
8686

87+
@abstractmethod
88+
def set_custom_status(self, custom_status: str) -> None:
89+
"""Set the custom status.
90+
"""
91+
pass
92+
8793
@abstractmethod
8894
def create_timer(self, fire_at: Union[datetime, timedelta]) -> task.Task:
8995
"""Create a Timer Task to fire after at the specified deadline.

0 commit comments

Comments
 (0)