Anda di halaman 1dari 12

Lab 3

Create & Run a Workflow

Lab at a Glance ..............................................................2


Objectives........................................................................2
Duration...........................................................................2
Exercises........................................................................3
Exercise 1: Create a Workflow .........................................3
Exercise 2: Create a Task and Run the Workflow .............7
Exercise 4: Monitor the Workflow ................................... 10

PowerCenter 9.xLevel I Developer Lab Guide 3- 1


Lab 3. Create & Run a Workflow

Lab at a Glance
The exercises in this lab familiarize the student with the process
of creating a simple workflow with a start task and session task.
This workflow will essentially define a run-time version of the
mapping created in the previous lab. The exercises will also
familiarize the student with the process of starting and
monitoring a workflow.

Objectives
After completing the lab, the student will be able to:
Use the Workflow Manager.
Create a new workflow.
Create and edit session tasks.
Link tasks within a workflow.
Validate a workflow.
Start a workflow.
Use the Workflow Monitor to monitor a workflow.
View session information and the session log after a
workflow has run.

Duration
This lab should take approximately 30 minutes.

3-2 PowerCenter 9.x Level I Developer Lab Guide


Lab 3. Create & Run a Workflow

Exercises

Exercise 1: Create a Workflow


In this exercise, the student will create a new workflow.

PowerCenter 9.x Level I Developer Lab Guide 3-3


Lab 3. Create & Run a Workflow

Step 1. Start the Workflow Manager.

Select Start | Programs | Informatica Platform 9.0 |


PowerCenter 9.0 - Client | Workflow Manager.

You can turn off the Start Page by selecting Windo ws |


Windows. Then select Start Page and click the Close
Window(s) button.

Connect to the PC_Course repository.


Open the studentxx folder by right-clicking the folder and
selecting Open.
Open the Workflow Designer by selecting Tools |
Workflow Designer or click the Workflow Designer

button above the workspace.


Step 2. Set the default target load type

Select Tools | Options, Miscellaneous tab, and set the


default target load type for all sessions to Normal.

Click OK.

3-4 PowerCenter 9.x Level I Developer Lab Guide


Lab 3. Create & Run a Workflow

Step 3. Create a new workflow.

Select Workflows | Create.


A w orkflow is a set of instructions that tells
the Informatica Serv er how to ex ecute The Create Workflow dialog box appears.
tasks. Ev ery w orkflow contains a start
task, w hich represents the beginning of On the General tab, enter wf_ODS_EMPLOYEE_xx (where
the w orkflow . xx represents the assigned student number) in the Name
field.

Click OK.
The Start task appears in the Workflow Designer
workspace:

The w orkflow is inv alid at this point.

Save the repository.


Step 4. Edit the workflows metadata extensions.

Right-click in the workspace and select Edit


Workflow/Worklet or select Workflows | Edit from the
menu.
Click on the Metadata Extensions tab.

PowerCenter 9.x Level I Developer Lab Guide 3-5


Lab 3. Create & Run a Workflow

Notice the two existing metadata extensions


Creation_Date and Workflow_A uthor. Both are defined as
reusable.
Enter the current date for the value of Creation_Date
[using the syntax mm/dd/yyyy].
Enter your name for the value of Workflow_A uthor.
Click OK.
Save the new entries to the repository by selecting Ctrl-S.

3-6 PowerCenter 9.x Level I Developer Lab Guide


Lab 3. Create & Run a Workflow

Exercise 2: Create a Task and Run the Workflow


In this exercise, the student will create a session task.
Step 1. Create a session task.

Session tasks represent mappings for the Click on the Session button on the Task toolbar.
Informatica Serv er to run. The Informatica
Serv er uses the instructions configured in
the session to mov e data from a source to
a target.
This appears by default at the top right of the Designer
window and may be part hidden. Click on the vertical bar
at the left of the toolbar to drag it to another position.
Move the pointer into the workspace and click.
Note that each session task is associated The Mappings dialog box appears.
w ith a single mapping.
Select the mapping m_ODS_EMPLOYEE_xx.
Click OK.
The session task s_m_ODS_EMPLOYEE_xx appears in the
workspace .
Save the repository.
Step 2. Edit the session tasks properties

Double-click on the s_m_ODS_EMPLOYEE_xx session task.


The Edit Tasks dialog appears.
Select the Properties tab.

PowerCenter 9.x Level I Developer Lab Guide 3-7


Lab 3. Create & Run a Workflow

Note that the default Session Log File Name ,


s_m_ODS_EMPLOYEE_xx.log , and the default Session
Log File directory , $PMSessionLogDir, may be
overridden, but we will use the defaults for this lab.
Select the Mapping tab.
In the Navigator window, select the source
sq_EMPLOYEE.
In the Connections section, click on the down arrow ,
select native_source and click OK.

In the Navigator window, select the target


ODS_EMPLOYEE.
In the Connections section, click on the down arrow
, select native_target_xx (where xx represents the
assigned student number) and click OK.
In the Properties section, the Target load type
should be defaulted to Normal.
Scroll down (if necessary) and check the Truncate
target table option checkbox.

3-8 PowerCenter 9.x Level I Developer Lab Guide


Lab 3. Create & Run a Workflow

Click OK to close the Edit Tasks dialog box.


Save the repository.
Step 3. Link the workflow tasks.

Click the Link button on the Task toolbar.


Left-click and drag the cursor between the Start task and
the s_m_ODS_EMPLOYEE_xx task:

Toggle off the link mode by clicking again on the Link


button, or single click on one of the objects.
Step 4. Validate the workflow.

Save the repository.


In order for a w orkflow to be v alid, all tasks
must be linked. Locate the Save tab in the Output Window at the bottom of
the Workflow Manager and view the results of the
validation check:

Step 5. Start the workflow.

Select Workflows | Start workflow, or right-click in the


workspace and select Start Workflow.
The Workflow Manager dialog box appears:

PowerCenter 9.x Level I Developer Lab Guide 3-9


Lab 3. Create & Run a Workflow

Exercise 4: Monitor the Workflow


Step 1. Navigate in Workflow Monitor.

The Workflow Monitor window opens automatically


You may w is h to max im ize the w indow for
readability .
when a workflow is started and automatically logs into
the repository, displaying the workflow status.
The Workflow Monitor has two tabs Gant Chart and
Task View. Look at the Task View.

Notice the two objects:


wf_ODS_EMPLOYEE_xx(workflow)
s_m_ODS_EMPLOYEE_xx (session task)

The Status column shows the session status:


A w orkflow w ill show a Succeeded status if
it starts up and complete successfully, in Succeeded indicates that the Informatica Server was
and of itself. There may be sev eral tasks
w ithin the w orkflow and each will succeed
able to successfully complete a workflow or task.
or fail but the w orkflow itself w ill can
complete successfully. One of the only
Failedindicates that the Informatica Server could not
reasons a w orkflow will fail is w hen the complete the workflow or task due to a fatal
Serv er cannot w rite the w orkflow log. processing error.

Step 2. View the session properties.

Locate the s_m_ODS_EMPLOYEE_xx session task under the


Session properties prov ide detailed
Workflow Run column:
information about processing, such as the
number of row s loaded into the target by a
session task.

View the session properties by right-clicking anywhere


on the line selected and selecting Properties, or by
selecting the session and clicking on the Session
Properties button..

3 - 10 PowerCenter 9.x Level I Developer Lab Guide


Lab 3. Create & Run a Workflow

The Properties tab of the s_m_ODS_EMPLOYEE_xx dialog


box opens:

Note that the number of rows written to the target is


displayed as Target Success Rows.
Click on the Transformation Statistics tab.
More detail on the number of rows handled by the Server
is shown here:

Step 4. View the session log.

Right-click on the session in the Task Name column ( Time


window) and select Get Session Log, or by clicking on the

Session Log button.

The session log is copied (v ia ftp) from the


The session log is displayed:
Informatica Serv er machine, and
display ed on the client machine as
TmpSessionLog_x .

PowerCenter 9.x Level I Developer Lab Guide 3 - 11


Lab 3. Create & Run a Workflow

If errors hav e occurred, rev iew the session


log to determine w hat the problem is. Test
and rerun as necessary.

3 - 12 PowerCenter 9.x Level I Developer Lab Guide

Anda mungkin juga menyukai