TimerTask Class

Represents a pending timer.

All pending timers must be completed or canceled for an orchestration to complete.

Example: Cancel a timer

``<<` timeout_task = context.df.create_timer(expiration_date) if not timeout_task.is_completed():

timeout_task.cancel()

``<<>>`<<

Inheritance
TimerTask

Constructor

TimerTask(action: CreateTimerAction, is_completed, timestamp, id_, is_played=False)

Parameters

Name Description
action
Required
is_completed
Required
timestamp
Required
id_
Required
is_played
default value: False

Methods

cancel

Cancel a timer.

is_cancelled

Check of a timer is cancelled.

cancel

Cancel a timer.

cancel()

Exceptions

Type Description

Raises an error if the task is already completed and an attempt is made to cancel it

is_cancelled

Check of a timer is cancelled.

is_cancelled() -> bool

Returns

Type Description

Returns whether a timer has been cancelled or not

Exceptions

Type Description

Raises an error if the task is already completed and an attempt is made to cancel it