Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
desanip
Contributor
Contributor

Pass Tcontextload values to parent job

Hello everyone,

 

I am trying to load database parameter values from an external file to tcontextload  and then used a  tBufferOutput in the child job to push the informations Iwant to return to the parent job.

The schema of the tBufferOutput is be the same as the one which is declared for the tRunJob.

 In the parent job i have redshift and aws components that i have to connect to.Can someone tell me how to set context variables in code (in tJava) components? 

 

If someone can send me the job flow or how it should look like, it would be great.

Thanks.

Labels (4)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

I am not sure what is your use case but if you want to transfer context from child to Parent , you can simply follow the screen shot which I gave above.

 

in Child 

tContextDump -- tBufferOutput

 

in Parent -

tRunjob ( same schema as tContextDump ) -- tContextLoad

 

 

 

 

View solution in original post

11 Replies
akumar2301
Specialist II
Specialist II

In tjava

context.variablename = newvalue


desanip
Contributor
Contributor
Author

Hi akumar,

 

Can you please elaborate? In the trunjob, i checked the option "Transmit whole context" and "Die on child error" and i am not passing any context parameters. Next, in the tjava component you said i should have context.variablename = newvalue. what do you mean by new value? I didn't get you. When i use the code context.AWS_accountid = row3.AWS_accountid in tjava, it says aws_accountid variable cannot be resolved or is not a field

Anonymous
Not applicable

Hi @desanip 

 

While assigning the value context.AWS_accountid = row3.AWS_accountid could you please try using tjavarow instead of tjava and see if it works.

 

Regards,

Pratheek Manjunath

akumar2301
Specialist II
Specialist II

in ParentJob 

 

0683p000009M3di.jpg

desanip
Contributor
Contributor
Author

Thanks for the replies everyone.

 

I am afraid i still dont get it. All i am trying to do is to return the values of the child job to parent job. In job4 i am bringing the database conenction parameters as a key/value pair and passign to tbuuferout. in job3 I am using trunjob to call the child job and then use a tjavarow to set the context so that i can use them in s3 and redshift components. In the trunjob, do i just check "Transmit whole context" and it should take care of everything? 

In the tjavarow, i am setting contexts like this "context.AWS_accountid = input_row.AWS_accountid". Is this correct? 

 

Job3 screenshot has the parent job.

Job4 is the child job.

 


job3.PNG
job4.PNG
akumar2301
Specialist II
Specialist II

"Transmit whole context"  is to transfer context from Parent to child not otherway around.

 

http://garpitmzn.blogspot.com/2012/11/transmit-whole-context-from-parent-to.html

desanip
Contributor
Contributor
Author

Ok abhishek. In that case what should i be passing the context param section of trunjob? Should i assign context variables in tjavarow? If so, can you please show me how?

 

Thanks for your patience and prompt replies

akumar2301
Specialist II
Specialist II

I am not sure what is your use case but if you want to transfer context from child to Parent , you can simply follow the screen shot which I gave above.

 

in Child 

tContextDump -- tBufferOutput

 

in Parent -

tRunjob ( same schema as tContextDump ) -- tContextLoad