Skip to content

Commit

Permalink
add is_canceled method to WorkflowContext
Browse files Browse the repository at this point in the history
  • Loading branch information
msaipraneeth committed Jun 12, 2024
1 parent 3a7890c commit 7520e94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmem_plugin_base/dataintegration/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ def status(self) -> Literal['Idle', 'Waiting', 'Running', 'Canceling', 'Finished
- Canceling: Plugin has been requested to stop.
- Finished: Plugin has finished execution."""

def is_canceled(self) -> bool:
"""Check if the workflow is in the 'Canceling' state."""
return self.status() == 'Canceling'


class ExecutionContext:
"""Combines context objects that are available during plugin execution."""
Expand Down

0 comments on commit 7520e94

Please sign in to comment.