Skip to main content
Kinetic Community

Task Handler Pausing

Pausing a specific task handler.

Feature

Pausing a task handler will prevent that handler from being executed if it is encountered while processing a task tree.  The processing of that tree will wait until resumed (whether manually or via a task handler).

What are the benefits of this feature?

The primary benefit of pausing task handlers is preventing handler failures by pausing the process before the handler is executed.

When to use this feature?

Pausing a task handler is useful when you are expecting downtime for the external system the handler connects to.  Instead of dealing with a number of handler failures, the handler can be paused and any processes using that handler will wait until resumed.

Pausing a task handler is also useful when, for some reason, there have been a significant number of handler failures to prevent more failures during the troubleshooting of the problem.

Details

Task handler pausing will affect all nodes that use the paused handler.  When a paused handler is encountered during processing a few actions are performed by the task engine.

First, a task instance is created.  This is done to allow developers to display paused tasks in portals and consoles to give their end users more visibility.  A task instance message is also automatically related to the paused task instance, it contains the Display Message provided when the handler was paused (see Pausing a Task Handler).

Second, a task trigger is created.  The trigger points to the paused task instance.  It also contains a special flag that indicates to the engine that it was generated as a result of a paused handler.  If resumed, the flag tells the engine that processing can continue regardless of the task handler's current status.  This is done so that you may select and resume specific executions to ensure things are working before unpausing the handler and resuming all of the paused processing.

Finally, execution for that branch of the task tree is stopped.

Note about deferred tasks.  Task handler pausing comes into effect only when a new task instance would be created.  Imagine that a task handler was paused after an instance was created for a deferred node.  Now an update or complete trigger for that instance is created.  The engine will process the update or complete action normally, as if the handler was not paused.

Pausing a Task Handler

To pause a task handler, navigate to the Task Configuration Console and select the handler to be paused.  Click the edit button and change the status from Active to Paused.  When you change the status of the task handler you will be prompted with two fields: Display Message and Internal Message (descriptions below).  Finally, save the handler.

Display message is intended to be a message written for end users. It is used in the task instance message that is associated to the paused task instance.  When modifying the status of a task handler we require that a display message is provided.

Internal message is intended to be a message for other developers, notes and comments about the reason the handler was paused.

Unpausing a Task Handler

To unpause a task handler, return to the Task Configuration Console and select the paused handler.  Click the edit button and change the status back from Paused to Active.  You will be prompted for display and internal messages again.  Finally, save the handler.  Now that the handler is active, it will be executed normally when encountered during processing.

Even though the task handler is now unpaused, all of the processing that was paused for this handler will still be waiting to be resumed.  Processing can be resumed two ways.  Manually updating the task trigger record, changing the status from Paused to Unpaused.  Or, the recommended method, using the Kinetic Task Trigger Resume handler.  Click the link below to download and see more details about the use of this handler.

Resume Paused Task Triggers