Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

cinar
2011-12-27 11:05:44

Thanks for your help. I resolved the problem by combining your ideas with my Talend knowledge.

pedro
2011-12-27 10:25:33

Hi

Add a context variable in your subjob.  ----context.subjobvalue
Add a context variable in your mainjob. ----context.new1
Set tRunjob component as follows.
Then context.new1 in mainjob will be passed into context.subjobvalue in subjob.

Best regards!
Pedro

cinar
2011-12-27 09:49:19

Yes, I've used TRunjob which is linked to another job - runs 28 times-, and I need a variable that must have  an incremental value in the subjob.
For example;

at first run of my subjob, i must have a variable such as context.xxx which has value of 1.
at second run, it must increase to value of 2.
at third run, it must be 3.

So I can use this variable in any component in my subjob.

pedro
2011-12-27 09:29:58

Hi

Context variable is a global variable and you can get it with most components.
Ctrl+Space. Then you will find it in the first place.
Or you mean you have used a tRunjob?

Best regards!
Pedro

cinar
2011-12-27 09:25:45

Thanks for your response. But How will I get the variable in my subjob?

pedro
2011-12-27 09:11:44

Hi

You can add a context variable in Contexts tag.
Then modify your job as follows.
tLoop(28 times)--Iterate-->tJava--Iterate-->subjob.

Code:

//Java code in tJava
context.new1=((Integer)globalMap.get("tLoop_1_CURRENT_VALUE"));
System.out.println(context.new1);

Best regards!
Pedro

cinar
2011-12-27 09:02:21

Hello,

I have a subjob which is running 28 times, and I need to have a variable in subjob which will starts from 1 and increase one by one untill 28.
How can I define a variable which will increase one by one at each run of subjob?

Thanks.

Board footer

Powered by FluxBB