xcode
xcode

Reputation: 1717

How to Loop inside Pentaho Data Integration Transformation

I have following pdi job structure:

START ---> TR1 ---> TR2 ---> TR3

where:

TR1 will return 3 rows,

TR2 had execute every input row enabled by me, and will return 5 rows,

TR3 had execute every input row enabled by me, and it was supposedly run 15 times (5 times for each of those 3 TR2).

My expectation was:

TR1 will run exactly 1 time, TR2 will run exactly 3 times in parallel (since TR1 returning 3 rows),

and TR3 will run exactly 15 times (since each of TR2 returning 5 rows).

But then the reality was

TR2 was executed 3 times, as expected,

but TR3 is only executed 1 time, not as expected.

My questions are:

  1. Why is this happening?

  2. How to make TR3 act as like loop inside TR2's rows

Upvotes: 0

Views: 3318

Answers (2)

Anup
Anup

Reputation: 250

I assume, TR represents transformation and all the TR's are part of a job? if that's the case, then all you need to do is - in TR1 send the results to TR2 by connecting the last step in TR1 with "Copy rows to result", upon which double click on the TR2 with in the job and go to "Advanced" and check "Copy previous results to parameters" and "execute to every input row".

Now, within that add the column names from TR1 under the parameters tab of TR2 in the same sequence with same names. And then within the TR2 properties add those as parameters with a null default value so that you can use the values generated from the previous transformation as variables in TR2. And now include TR3 within the TR2 so that it even executes for each row generated by TR1. I hope I didn't confuse. Let me know if doesn't make sense.

Upvotes: 0

Primit
Primit

Reputation: 865

for that you need to create job try this sequence

Start-tr1-(job1(tr2-subjob2(tr3)))-End

job1 and job2 will be checked with execute every input raw.

Dis- create job1 and connect to tr1 and put tr2 inside it after that create subjob2 and connect to tr2 after that put tr3 inside subjob2

Upvotes: 1

Related Questions