Task Events |
Task events along with task functions are core features in programming that make complex, high level automation routines more comprehensible. They enable the flow of a program to be determined by specific events that take place, which in turn, triggers execution of a callback function.
Automate is capable of raising task events as it performs the steps necessary to complete a task. This capability allows specific event driven information to be returned when a task starts, when it completes (either successfully or unsuccessfully) or during various other stages in between (i.e. when a task step starts, ends or generates an error). Tasks become more robust when task events are implemented. This is because events make a task more intelligent with their ability to monitor execution status and provide notification when a status has changed.
Task events are managed through a drop-down UI display that is accessible from the Steps panel of Task Builder.
To Set a Task Event
-
From the Task Builder's Steps panel, select Events.
-
Click the drop-down combo box to display a list of pre-defined task events (see the table below for more details).
-
Select the desired task event.
Parameters
The following table describes available task event parameters:
Property | Type | Description |
---|---|---|
Name | Text | The name of the parameter. |
Return type | Text | The return value type. Task event value types are always in the form of a variable. |
Is Optional | TRUE/FALSE | Specifies whether the parameter is optional (TRUE) or required (FALSE). This option is always marked FALSE for task events. |
Default value | Text | The task event's default value. |
Description | Text | A description of the parameter. |
Available Events
Automate provides six task events in which you can subscribe (also known as pre-defined task functions). The following table lists the available task events along with their description. For additional information regarding a specific task event, click the event's associated link.
Event | Description |
---|---|
OnStepStart | This event is fired each time a step executes. |
OnStepEnd | This event occurs each time a step is completed. |
OnStepError | This event occurs each time a task step generates an error. |
OnTaskFailure | This event is fired each time a task step causes an error. Depending on how the step is configured, the task may either continue after the error occurs or may be aborted. In the latter case, the OnTaskEnd event is fired immediately afterwards. |
OnTaskStart | This event is fired when a task is started. This is normally the first event fired when task execution starts. |
OnTaskEnd | This event is fired when a task ends. |