Interface IWorkflowTaskRunner

  • All Known Implementing Classes:
    WorkflowTaskRunner

    public interface IWorkflowTaskRunner
    Starts the workflow for a given WorkflowTask of a project. This task runner is concerned only with running the task, it does not coordinate which task should be run when, and it also does not check whether a task is already being run. Usually you should not use this directly, use IWorkflowEventRunner to run the tasks of triggers that correspond to a certain event.

    Note on how tasks are run:

    • The task runner receives a list of tasks to run and puts them in a queue. It then removes one item from the queue, executes that item, processes the result, and proceeds with the next item; until the queue is empty.
    • Before a task is run, the precondition of the task's trigger is checked. When it is not satisfied, the task is skipped.
    • Workflow nodes may use the triggerEvent method of the workflow context to add additional task to the queue. That method also provides an option whether the task should be added to the beginning or end of the queue. These additional tasks are executed once the current task finishes.
    • When any task throws an unhandled exception, the queue is emptied and remaining tasks are aborted. When the workflow contains one or more triggers that reacts to a IUnhandledExceptionEventData, the corresponding tasks are considered error handlers and are added to the queue. In that case, execution proceeds with these error handling tasks. Otherwise, when there are no such handlers, workflow execution finishes with an exception.
    • When a task for an error trigger throws an unhandled exception, no further error triggers are fired; and workflow execution finishes with an exception.
    • Each trigger handler may define a onTaskBegin and onTaskFinish callback. If they do, the start callback is invoked just before the trigger starts. If that callback throws an error, this is treated as if the task had thrown an error; and the finish callback is skipped. Otherwise, the finish callback is executed after the task was executed, irrespective of whether the task completed successfully. When the finish callback throws an exception, it is treated as if the task had failed.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH