Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Assignment - 15

Source Data (Flat file or DB table)

EMP_ID ENAME DEPT_ID SALARY


101 Max 1 40000
102 Steve 2 30000
103 Alex 3 50000
104 Tim 1 20000
105 Tony 2 35000

Output should be like as below.

First run:

EMP_ID ENAME DEPT_ID SALARY


101 Max 1 40000
104 Tim 1 20000

Second Run:

EMP_ID ENAME DEPT_ID SALARY


101 Max 1 40000
104 Tim 1 20000
102 Steve 2 30000
105 Tony 2 35000

Third Run:

EMP_ID ENAME DEPT_ID SALARY


101 Max 1 40000
104 Tim 1 20000
102 Steve 2 30000
105 Tony 2 35000
103 Alex 3 50000
Mapping as shown below.

Before adding transformations create a mapping variable with initial value 1

In Sorter Transformation Sort data for Dept id only.

Page 2 of 7
Expression is not having any logic (Just only added Sequence NEXTVAL port)

In Filter Transformation use NEXTVAL <= $$DEPT_NO

Connect required ports to Target

Now go to workflow manger tool

Create Workflow and non-reusable session as shown below.

Page 3 of 7
Now, Edit workflow to create a workflow variable as shown below.

Click on variables tab then create a variable $$DEPT_ID with Default value is 1

As shown below.

Now create assignment task by using tasks tab in workflow designer.

Page 4 of 7
Link Assignment task as below.

Now, edit session properties goto components tab

Add pre-session variable as shown below.

Page 5 of 7
Now, Edit assignment task (goto expressions tab) to assign user defined variables.

This is useful to increment $$DEPT_ID value after workflow run and same will be storing in
workflow pre-session assignment.

Trigger workflow you can see the desired results.

To reset variable values

Right click on the workflow

Page 6 of 7
View Persistant values

Choose Reset Values

Page 7 of 7

You might also like