Sunday, 17 April 2011

WORKFLOW VARIABLES

                                                            

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:

System variables:

Use the SYSDATE and WORKFLOWSTARTTIME system variables within a workflow.

Task-specific variables:

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.

Task-specific

variable

Description

Task Type

Condition

Result of decision condition expression. NULL if task fails.

Decision Task

EndTime

Date and time when a task ended.

All Tasks

ErrorCode

Last error code for the associated task. 0 if there is no error.

All Tasks

ErrorMsg

Last error message for the associated task. Empty String if there is no error.

All Tasks

FirstErrorCode

Error code for the first error message in the session. 0 if there is no error.

Session
FirstErrorMsg

First error message in the session. Empty String if there is no error.

Session
PrevTaskStatus

Status of the previous task in the workflow that IS ran. Can be ABORTED, FAILED, STOPPED,

SUCCEEDED.

All Tasks
SrcFailedRows

Total number of rows the Integration Service failed to read from the source.

Session
SrcSuccessRows

Total number of rows successfully read from the sources.

Session

StartTime Date and time when task started. All Tasks

Status

Status of the previous task in the workflow. Can be ABORTED, DISABLED, FAILED, NOTSTARTED,STARTED, STOPPED, SUCCEEDED.

All Tasks

TgtFailedRows

Total number of rows the Integration Service failed to write to the target.

Session
TgtSuccessRows

Total number of rows successfully written to the target

Session
TotalTransErrors Total number of transformation errors.

Session

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:

  1. Value in parameter file
  2. Value saved in the repository (if the variable is persistent)
  3. User-specified default value
  4. Data type default value

Persistent means value is saved to the repository.

To create a workflow variable:

  1. In the Workflow Designer, create a new workflow or edit an existing one.
  2. Select the Variables tab.
  3. Click Add and enter a name for the variable.
  4. In the Data type field, select the data type for the new variable.
  5. Enable the Persistent option if we want the value of the variable retained from one execution of the workflow to the next.

clip_image001

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.

No comments :

Post a Comment