Sie sind auf Seite 1von 8

BANGALORE TECHNICAL TRAININGS Onlinetrainingsbglr@gmail.

com +917411642061

Lab 23
User-Defined Event, Event Raise, and Event Wait

Lab at a Glance................................................................2 Objectives..............................................................2 Summary................................................................2 Duration.................................................................3 Exercises..........................................................................4 Exercise 1: Create a Workflow with Events............4

PowerCenter 9.x Level I Developer Lab Guide

23 - 1

Lab 23. User-Defined Event, Event Raise, and Event Wait

Lab at a Glance
The exercise in this lab is designed to walk the student through the process of creating a user-defined event, an Event Raise task, and an Event Wait task.

Objectives
After completing the lab, the student will be able to: Create a user-defined event. Create an Event Raise task. Create an Event Wait task.

Summary
The two employee loads must occur before the sales fact table is loaded. The ETL lead would like to take advantage of the Event Raise and Event Wait to ensure the employee load completes successfully. Two concurrent flows will be created. The first flow will load employees and employee types. The second flow will load the various customer sales dimension tables and the fact sales table. The second flow will wait until the employee flow completes. To ensure accuracy in the load ordering, take advantage of the user-defined event Event Raise and Event Wait tasks.

23 - 2

PowerCenter 9.x Level I Developer Lab Guide

Lab 23. User-Defined Event, Event Raise, and Event Wait

The completed workflow should look as follows:

Duration
This lab should take approximately 30 minutes.

PowerCenter 9.x Level I Developer Lab Guide

23 - 3

Lab 23. User-Defined Event, Event Raise, and Event Wait

Exercises
Exercise 1: Create a Workflow with Events
Step 1. Create the workflow. Make a copy of wf_FACT_SALES_xx . Change the workflow name to wf_EMPLOYEE_FACT_SALES_LOAD_xx. Drag and drop wf_EMPLOYEE_FACT_SALES_LOAD_xx into the Workflow Designer. Remove the link between the Start task and wl_CUSTOMER_SALES_INFO_XX. Save the repository. Step 2. Create a user-defined event.
.

Edit the wf_ EMPLOYEE_FACT_SALES_LOAD_xx workflow and click on the Events tab. Add a user-defined event called EMPLOYEE_LOAD_COMPLETE.

Click OK. Save the repository.

23 - 4

PowerCenter 9.x Level I Developer Lab Guide

Lab 23. User-Defined Event, Event Raise, and Event Wait

Step 3. Promote sessions to reusable.


.

Re-open the wf_ODS_EMPLOYEE_xx workflow created in a previous lab. Promote the s_m_ODS_EMPLOYEE_xx session to reusable. Open the wf_ODS_EMPLOYEE_TYPE_xx workflow created in a previous lab. Promote the s_m_ODS_EMPLOYEE_TYPE_xx session to reusable. Save the repository Step 4. Add reusable session instances to a workflow. Re-open the wf_EMPLOYEE_FACT_SALES_LOAD_xx workflow in Workflow Manager. Place instances of the two new reusable sessions into the wf_EMPLOYEE_FACT_SALES_LOAD_xx workflow, from the Sessions node in the Navigator. The properties and connections for these sessions were set in a previous lab.
s_m_ODS_EMPLOYEE_xx s_m_ODS_EMPLOYEE_TYPE_xx

Save the repository. Step 5. Create an event raise task.


.

Create an Event Raise task and name it er_EMPLOYEE_LOAD_COMPLETE. Click on Properties tab. Click on the Value field to select the user-defined event, as show below:

PowerCenter 9.x Level I Developer Lab Guide

23 - 5

Lab 23. User-Defined Event, Event Raise, and Event Wait

Click OK. Click OK again. Save the repository. Step 6. Create an event wait task.
.

Create an Event Wait task and name it ew_EMPLOYEE_LOAD_COMPLETE. Edit ew_EMPLOYEE_LOAD_COMPLETE and click on the Events tab. Select the User Defined radio button.

Click on the Events Browser

button to select an event.

Select EMPLOYEE_LOAD_COMPLETE.

23 - 6

PowerCenter 9.x Level I Developer Lab Guide

Lab 23. User-Defined Event, Event Raise, and Event Wait

Click OK. Click OK again. Save the repository. . Step 7. Link tasks EMPLOYEE flow.
.

Create a link from the Start task to s_m_ODS_EMPLOYEE_xx. Create a link from s_m_ODS_EMPLOYEE_xx to s_m_ODS_EMPLOYEE_TYPE_xx. Double click on the second link and add the following condition:
$s_m_ODS_EMPLOYEE_xx.Status=SUCCEEDED

Create a link between s_m_ODS_EMPLOYEE_TYPE_xx and er_EMPLOYEE_LOAD_COMPLETE. Double click on that link and add the following condition:
$s_m_ODS_EMPLOYEE_TYPE_xx.Status=SUCCEEDED

Step 8. Link tasks CUSTOMER SALES flow.


.

Create a concurrent link from the Start task to the ew_EMPLOYEE_LOAD_COMPLETE task. Create a link from ew_EMPLOYEE_LOAD_COMPLETE to the wl_CUSTOMER_SALES_INFO_xx worklet.

Save, validate and start the workflow. Monitor and review the results for each of the session tasks in the Workflow Monitor.

PowerCenter 9.x Level I Developer Lab Guide

23 - 7

Lab 23. User-Defined Event, Event Raise, and Event Wait

Step 9. Verify results workflow results.

23 - 8

PowerCenter 9.x Level I Developer Lab Guide

Das könnte Ihnen auch gefallen