We can create and use variables in a workflow to reference values and record information.
Types of workflow variables:
- Predefined workflow variables
- User-defined workflow variables
Predefined workflow variables :
The Workflow Manager provides predefined workflow variables for tasks within a workflow. Types of Predefined workflow variables are:
Use the SYSDATE and WORKFLOWSTARTTIME system variables within a workflow.
The Workflow Manager provides a set of task-specific variables for each task in the workflow. The Workflow Manager lists task-specific variables under the task name in the Expression Editor.
Result of decision condition expression. NULL if task fails.
Date and time when a task ended.
Last error code for the associated task. 0 if there is no error.
Last error message for the associated task. Empty String if there is no error.
Error code for the first error message in the session. 0 if there is no error.
First error message in the session. Empty String if there is no error.
Status of the previous task in the workflow that IS ran. Can be ABORTED, FAILED, STOPPED,
Total number of rows the Integration Service failed to read from the source.
Total number of rows successfully read from the sources.
|StartTime||Date and time when task started.||All Tasks|
Status of the previous task in the workflow. Can be ABORTED, DISABLED, FAILED, NOTSTARTED,STARTED, STOPPED, SUCCEEDED.
Total number of rows the Integration Service failed to write to the target.
Total number of rows successfully written to the target
|TotalTransErrors||Total number of transformation errors.|| |
User-Defined Workflow Variables
We can create variables within a workflow. When we create a variable in a workflow, it is valid only in that workflow. Use the variable in tasks within that workflow. We can edit and delete user-defined workflow variables.
Integration Service holds two different values for a workflow variable during a workflow run:
- Start value of a workflow variable
- Current value of a workflow variable
The Integration Service looks for the start value of a variable in the following order:
- Value in parameter file
- Value saved in the repository (if the variable is persistent)
- User-specified default value
- Data type default value
Persistent means value is saved to the repository.
To create a workflow variable:
- In the Workflow Designer, create a new workflow or edit an existing one.
- Select the Variables tab.
- Click Add and enter a name for the variable.
- In the Data type field, select the data type for the new variable.
- Enable the Persistent option if we want the value of the variable retained from one execution of the workflow to the next.
6. Enter the default value for the variable in the Default field.
7. To validate the default value of the new workflow variable, click the Validate button.
8. Click Apply to save the new workflow variable.
9. Click OK to close the workflow properties.