• No results found

Types of Workflow Variables

In document Notes Informatica (Page 64-70)

Predefined workflow variables. The Workflow Manager provides predefined workflow variables for tasks within a workflow.

User-defined workflow variables. You create user-defined workflow variables when you create a workflow. Use workflow variables when you configure the following types of tasks:

1. Assignment tasks. Use an Assignment task to assign a value to a user-defined workflow variable. For Example, you can increment a user-defined counter variable by setting the variable to its current value plus 1.

2. Decision tasks. Decision tasks determine how the Integration Service runs a workflow. For example, use the Status variable to run a second session only if the first session completes successfully.

3. Links. Links connect each workflow task. Use workflow variables in links to create branches in the workflow. For example, after a Decision task, you can create one link to follow when the decision condition evaluates to true, and another link to follow when the decision condition evaluates to false.

4. Timer tasks. Timer tasks specify when the Integration Service begins to run the next task in the workflow. Use a user-defined date/time variable to specify the time the Integration Service starts to run the next task.

Predefined Workflow Variables:

Each workflow contains a set of predefined variables that you use to evaluate workflow and task conditions. Use the following types of predefined variables:

Task-specific variables. The Workflow Manager provides a set of task-specific variables for each task in the workflow. Use task-specific variables in a link condition to control the path the Integration Service takes when running the workflow. The Workflow Manager lists task- specific variables under the task name in the Expression Editor.

Built-in variables. Use built-in variables in a workflow to return run-time or system

information such as folder name, Integration Service Name, system date, or workflow start time. The Workflow Manager lists built-in variables under the Built-in node in the Expression Editor.

Task-Specific Variables

Description Task Types Data type

Condition Evaluation result of decision condition expression. If the task fails, the Workflow Manager keeps the condition set to

null.

Sample syntax:

$Dec_TaskStatus.Condition = <TRUE | FALSE | NULL | any

integer>

Decision Integer

End Time Date and time the associated task ended. Precision is to the second.

Sample syntax:

$s_item_summary.EndTime > TO_DATE('11/10/2004

08:13:25')

All tasks Date/Time

ErrorCode Last error code for the associated task. If there is no error, the Integration Service sets ErrorCode

to 0 when the task completes.

Sample syntax:

$s_item_summary.ErrorCode = 24013.

Note: You might use this variable

when a task consistently fails with this final error message.

All tasks Integer

ErrorMsg Last error message for the associated task.If there is no error,

the Integration Service sets ErrorMsg to an empty string when

the task completes.

Sample syntax:

$s_item_summary.ErrorMsg =

'PETL_24013 Session run completed with failure Variables of type Nstring can have

a maximum length of 600 characters.

Note: You might use this variable

when a task consistently fails with this final error message. First Error Code Error code for the first error

message in the session. If there is no error, the Integration

Service sets FirstErrorCode to 0 when the session completes.

Sample syntax:

$s_item_summary.FirstErrorCode = 7086

Session Integer

FirstErrorMsg First error message in the session.If there is no error, the

Integration Service sets FirstErrorMsg to an empty string

when the task completes.

Sample syntax:

$s_item_summary.FirstErrorMsg = 'TE_7086 Tscrubber: Debug info… Failed to evalWrapUp'Variables of type Nstring can have a maximum

length of 600 characters.

Session Nstring

PrevTaskStatus Status of the previous task in the workflow that the Integration Service ran. Statuses include:

1.ABORTED 2.FAILED 3.STOPPED 4.SUCCEEDED

Use these key words when writing expressions to evaluate the status

of the previous task.

Sample syntax:

$Dec_TaskStatus.PrevTaskStatus = FAILED

All Tasks Integer

SrcFailedRows Total number of rows the Integration Service failed to read

from the source.

Sample syntax:

$s_dist_loc.SrcFailedRows = 0

Session Integer

SrcSuccessRows Total number of rows successfully read from the sources.

Sample syntax:

$s_dist_loc.SrcSuccessRows > 2500

Session Integer

StartTime Date and time the associated task started. Precision is to the second.

Sample syntax:

$s_item_summary.StartTime > TO_DATE('11/10/2004

08:13:25')

All Task Date/Time

Status Status of the previous task in the workflow. Statuses include:

- ABORTED

- DISABLED - FAILED - NOTSTARTED - STARTED - STOPPED - SUCCEEDED

Use these key words when writing expressions to evaluate the status

of the current task.

Sample syntax:

$s_dist_loc.Status = SUCCEEDED TgtFailedRows Total number of rows the

Integration Service failed to write to the target.

Sample syntax:

$s_dist_loc.TgtFailedRows = 0

Session Integer

TgtSuccessRows Total number of rows successfully written to the target.

Sample syntax:

$s_dist_loc.TgtSuccessRows > 0

Session Integer

TotalTransErrors Total number of transformation errors.

Sample syntax:

$s_dist_loc.TotalTransErrors = 5

Session Integer

User Defined Workflow Variables:

 We can create variables within a workflow.

 When u create variable in the workflow, it is valid only in that workflow.

 Use user-defined variables when you need to make a workflow decision based on criteria you specify.

WORKING WITH EVENT TASKS

We can define events in the workflow to specify the sequence of task execution.

Types of Events:

Pre-defined event: A pre-defined event is a file-watch event. This event Waits for a

specified file to arrive at a given location.

User-defined event: A user-defined event is a sequence of tasks in the Workflow. We

create events and then raise them as per need.

Steps for creating User Defined Event:

2. Click Workflow-> Edit -> Events tab.

3. Click to Add button to add events and give the names as per need. 4. Click Apply -> Ok. Validate the workflow and Save it.

Types of Events Tasks:

EVENT RAISE: Event-Raise task represents a user-defined event. We use this task to

raise a user defined event.

EVENT WAIT: Event-Wait task waits for a file watcher event or user defined event to

occur before executing the next session in the workflow.

Example1: Use an event wait task and make sure that session s_filter_example runs when abc.txt

file is present in D:\FILES folder.

TIMER TASK

The Timer task allows us to specify the period of time to wait before the Power Center Server runs the next task in the workflow. The Timer task has two types of settings:

Absolute time: We specify the exact date and time or we can choose a user-defined

workflow variable to specify the exact time. The next task in workflow will run as per the date and time specified.

Relative time: We instruct the Power Center Server to wait for a specified period of time

after the Timer task, the parent workflow, or the top-level workflow starts.

Example: Run session s_m_filter_example relative to 1 min after the timer task. DECISION TASK

 The Decision task allows us to enter a condition that determines the execution of the workflow, similar to a link condition.

 The Decision task has a pre-defined variable called $Decision_task_name.condition that represents the result of the decision condition.

 The Power Center Server evaluates the condition in the Decision task and sets the pre- defined condition variable to True (1) or False (0).

 We can specify one decision condition per Decision task.

Example: Command Task should run only if either s_m_filter_example or

S_M_TOTAL_SAL_EXAMPLE succeeds. If any of s_m_filter_example or

CONTROL TASK

 We can use the Control task to stop, abort, or fail the top-level workflow or the parent workflow based on an input link condition.

 A parent workflow or worklet is the workflow or worklet that contains the Control task.

 We give the condition to the link connected to Control Task.

ASSIGNMENT TASK

 The Assignment task allows us to assign a value to a user-defined workflow variable

Parameter File

 Parameters file provides us with the flexibility to change parameter and variable values every time we run a session or workflow.

 A parameter file contains a list of parameters and variables with their assigned values.  $$LOAD_SRC=SAP

 $$DOJ=01/01/2011 00:00:01

[email protected]

 Each heading section identifies the Integration Service, Folder, Workflow, Worklet, or Session to which the parameters or variables apply.

 [Global]

 [Folder_Name.WF:Workflow_Name.WT:Worklet_Name.ST:Session_Name]  [Session_Name

 To assign a null value, set the parameter or variable value to <null> or simply leave the value blank.

 $PMCacheDir=

In document Notes Informatica (Page 64-70)

Related documents