Tutorial: Utilizing Task Status

Setting Status for a Task

If you want to set status for a task, you need to change the variable varTaskStatus

List of valid values forĀ varTaskStatus:

  1. enumStatusSUCCESS;

  2. enumStatusFAILED;

  3. enumStatusNODATA.

To change the value of varTaskStatus variable, drop aĀ Code shape from the ADVANCEDĀ group inĀ left panel onto the workspace.

Example of Setting Status for a Task

Click the Code shape and fill fx input on the top of the workspace as

:varTaskStatus: := :enumStatusSUCCESS:
Example of Setting Status for a Task

The task always will be marked as SUCCESS

Others examples:

For a task translator:

Task Translator example

If you set value of the Code shape as

:varTaskStatus: := :enumStatusFAILED:
Example of Setting Status for a Task

The task will always be FAILED

But if status is FAILED you must set the description of the error to the TSR message will be full.

TSR message

To do it add to the Code shape next code

:varErrorDescr: := 'Some description'

So the Code shape will consist of two lines

:varTaskStatus: := :enumStatusFAILED:; :varErrorDescr: := 'Some description';

If you set value of the Code shape as

:varTaskStatus: := :enumStatusNODATA:

Task status always will display NO_DATA

Ā 

Task Status for a Decision Shape

Below is an example of using status of a task as condition of a Decision shape.

Task Status for a Decision Shape

Ā 

Decision shape is available on the left panel in GATEWAYSĀ group

Decision Shape Gateway group

The shape has two branches TRUE and FALSE. To set the condition property, click the shape and set condition property in the right panel.

Example of Task Status

The status of a task is stored inĀ TASK_[name_of_a_task]_STATUSĀ variable

For example, in our case it isĀ TASK_test_task_translator_STATUS (test_task_translator is the main task)

TASK_[name_of_a_task]_STATUSĀ can get the following values:

  1. SUCCESS

  2. FAILED

  3. NO_DATA

In our case the Decision shape has a condition :TASK_test_task_translator_STATUS: = 'SUCCESS' , so:

  • if test_task_translator status is SUCCESS then task_translator_true will be executed

  • if test_task_translator status is FAILED then condition of Decision shape will be FALSE and Decision_1 shape will be executed

Example of Task Status

The Decision_1 shape has the following condition :TASK_test_task_translator_STATUS: = 'FAILED'

So,Ā task_translator_false will be executed

If test_task_translator status is NO_DATA then condition of Decision shape will be FALSE and condition of Decision_1 shape will be FALSE as well. AndĀ  task_translator_nodata will be executed