...
To change the value of varTaskStatus variable, drop a Code shape from the ADVANCED group in left panel onto the workspace.
Click to the Code shape and fill fx input on the top of the workspace as
Code Block | ||
---|---|---|
| ||
:varTaskStatus: := :enumStatusSUCCESS: |
Because of that, the The task always will be marked as SUCCESS
Others examples:
Assume you have For a task translator:
If you set value of the Code shape as
Code Block | ||
---|---|---|
| ||
:varTaskStatus: := :enumStatusFAILED: |
The task will always will be FAILED
But if status is FAILED you must set the description of the error to the TSR message will be full.
...
To do it add to the Code shape next code
Code Block | ||
---|---|---|
| ||
:varErrorDescr: := 'Some description' |
So the Code shape will consist of two lines
Code Block | ||
---|---|---|
| ||
:varTaskStatus: := :enumStatusFAILED:; |
...
:varErrorDescr: := 'Some description'; |
If you set value of the Code shape as
Code Block | ||
---|---|---|
| ||
:varTaskStatus: := :enumStatusNODATA: |
The task Task status always will be display NO_DATA
Task Status for a Decision Shape
There Below is an example of using status of a task as condition of a Decision shape.
The Decision shape is available on the left panel in - GATEWAYS group GATEWAYS
The shape has two branches TRUE and FALSE. To set the condition property, click to the shape and set condition property on in the right panel.
The status of a task is stored in variable in TASK_[name_of_a_task]_STATUSSTATUS variable
For example, in our case it’s it is TASK_test_task_translator_STATUS (test_task_translator it’s task from which depends others)There are all possible values for the construction is the main task)
TASK_[name_of_a_task]_STATUSSTATUS can get the following values:
- SUCCESS
- FAILED
- NO_DATA
In our case the Decision shape has a condition :TASK_test_task_translator_STATUS: = 'SUCCESS' , so: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
The Decision_1 shape has the following condition :TASK_test_task_translator_STATUS: = 'FAILED'
So then , task_translator_false will be executeexecuted
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
...