OnTaskEnd

Syntax

OnTaskEnd(Reason)

Description

This event is fired when a task ends, which can occur in the following scenarios:

  • The task finishes by executing its last step.

  • The task is aborted (either manually by a user or automatically by a Task - Stop activity with a return status set to Error).

  • The task is stopped (because of a task error that is set to stop the task or a Task - Stop activity is executed with a return status set to Error).

  • The task fails on error.

NOTE: Line numbers are 0-based within the Task Interpreter (for example, step 1 inside the Task Builder is step 0 when using this object).

Parameters

Parameter Description
Reason The reason the task ended. The following numeric values may be returned:
  • 0 = The task ended in an unknown state.
  • 1 = The task ended successfully.
  • 2 = The task failed.
  • 3 = The task was aborted. For example, using the Task - Stop activity with status set to Error.
  • 4 = The task was stopped by the user, either manually or by way of the Task - Stop activity with status set to Error.

Example


Sub Main
MsgBox OnTaskEnd()
End Sub

See also

Main | OnStepEnd | OnStepError | OnStepStart | OnTaskEnd | OnTaskFailure | OnTaskStart |