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 Stop task activity with a return status set toAbort).

  • The task is stopped (because of a task error that is set to stop the task or a Stop task activity is executed).

  • The task fails on error.

 

NOTE: Line numbers are 0 based within the Task Interpreter (i.e. 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 Stop task activity with status set to Abort.

  • 4 = The task was stopped by the user, either manually or by way of the Stop task activity with status set to Stop.

 

Example:


Sub Main
MsgBox OnTaskEnd()
End Sub


See Also:

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