Is that context parameters should be same in master and child job

Four Stars

Is that context parameters should be same in master and child job

Hi,

 

I have created master job in which I have child jobs connected with Run if(true) condition. 

Do I need to maintain all the connections and variables to be same in master and child jobs?

 

Thanks,

Meghana.


Accepted Solutions
Seven Stars

Re: Is that context parameters should be same in master and child job

@Suneel,

 

If your requirement is based on my previous comment, then you can follow below steps to resolve your issue.

 

You need to specify child's context group value in 'tRunJob' component in Master job as below.

 

Talend_context.jpg

 

Please mark the topic as resolved if my answer helped you and Kudos are also welcome.

Regards,

Vibin CT.


All Replies
Forteen Stars

Re: Is that context parameters should be same in master and child job

@Suneel,in tRunjob,if you enable transmit whole context then you should have same names ,if you specifically specifying the contexts by not needed.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: Is that context parameters should be same in master and child job

@Suneel,does it solve your question?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: Is that context parameters should be same in master and child job

The issue I am facing is, When I execute master job, then it's taking child job's only default environment context variables in all the environments. Do u have any suggestion on this?

Forteen Stars

Re: Is that context parameters should be same in master and child job

@Suneel,are you using the same context variable names in the both master and subjobs?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: Is that context parameters should be same in master and child job

No, varaibles are different in every child job

Forteen Stars

Re: Is that context parameters should be same in master and child job

@Suneel,can you show me that how the context defined and passing form main to sub?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Nine Stars

Re: Is that context parameters should be same in master and child job

You should use a context group to use in the master and child job to ensure the context variables you want to pass are the same name.

 

Thanks

 

David

Regards David
Dont forget to give Kudos when an answer is helpful or mark the answer as the solution.
Four Stars

Re: Is that context parameters should be same in master and child job

There is a master job with 4 env in context

default, dev, qa, prod. This is how it looks. 

VariableDefaultDevQAPROD
filePath/Desktop/files/files/files

 

Child1

filePath/Desktop/files/files/files
EmailABC@gmail.comsome@gmail.comsome@gmail.comsome@gmail.com

 

Child2

filePath/Desktop/files/files/files
EmailABC@gmail.comother@gmail.comother@gmail.comother@gmail.com

 

And have three environments in Talend cloud too.

So, when I execute master job, master job is executing it's respective environment but taking default context variables of child jobs in all the environments.

 

I hope u got my point. I don't if master job behaviour is this. But, Can I get any soultion for this?

Four Stars

Re: Is that context parameters should be same in master and child job

There is a master job with 4 env in context
default, dev, qa, prod

JobDefaultDevQAPROD
filePath/Desktop/files/files/files

Child1

filePath/Desktop/files`/files
EmailABC@gmail.comsome@gmail.comsome@gmail.comsome@gmail.com

Child2

filePath/Desktop/files/files/files
EmailABC@gmail.comother@gmail.comother@gmail.comother@gmail.com

 

master h=job looks like child1->RunIf(true)->child2.

 

Now when I execute master job in TIC, master job is taking default context variables of child job in all the environments. 

I wanted my master job to take child job's context parameters in it's respective environment. Can I get solution?

 

Thanks,

Suneel.

Four Stars

Re: Is that context parameters should be same in master and child job

There is a master job with 4 env in context
default, dev, qa, prod

JobDefaultDevQAPROD
filePath/Desktop/files/files/files

Child1

filePath/Desktop/files/files/files
EmailABC@gmail.comsome@gmail.comsome@gmail.comsome@gmail.com

Child2

filePath/Desktop/files/files/files
EmailABC@gmail.comother@gmail.comother@gmail.comother@gmail.com

 

master h=job looks like child1->RunIf(true)->child2.

 

Now when I execute master job in TIC, master job is taking default context variables of child job in all the environments. 

I wanted my master job to take child job's context parameters in it's respective environment. Can I get solution?

 

Thanks,

Suneel.

Four Stars

Re: Is that context parameters should be same in master and child job

here is a master job with 4 env in context
default, dev, qa, prod

Name   Default    Dev   QA     PROD
filePath /Desktop /files /files   /files
Child1

filePath /Desktop              /files                    /files                       /files
Email  ABC@gmail.com some@gmail.com some@gmail.com some@gmail.com
Child2

filePath   /Desktop            /files                   /files                       /files
Email ABC@gmail.com other@gmail.com other@gmail.com other@gmail.com

master h=job looks like child1->RunIf(true)->child2.

 

Now when I execute master job in TIC, master job is taking default context variables of child job in all the environments.

I wanted my master job to take child job's context parameters in it's respective environment. Can I get solution?

 

Thanks,

Suneel.

Highlighted
Four Stars

Re: Is that context parameters should be same in master and child job

There is a master job with 4 env in context
default, dev, qa, prod

Job Default Dev QA PROD
filePath /Desktop /files /files /files
Child1

filePath /Desktop /files ` /files
Email ABC@gmail.com some@gmail.com some@gmail.com some@gmail.com
Child2

filePath /Desktop /files /files /files
Email ABC@gmail.com other@gmail.com other@gmail.com other@gmail.com

master h=job looks like child1->RunIf(true)->child2.

 

Now when I execute master job in TIC, master job is taking default context variables of child job in all the environments.

I wanted my master job to take child job's context parameters in it's respective environment. Can I get solution?

 

Thanks,

Suneel.

Four Stars

Re: Is that context parameters should be same in master and child job

There is a master job with 4 env in context
default, dev, qa, prod

Job Default Dev QA PROD
filePath /Desktop /files /files /files
Child1

filePath /Desktop /files ` /files
Email ABC@gmail.com some@gmail.com some@gmail.com some@gmail.com
Child2

filePath /Desktop /files /files /files
Email ABC@gmail.com other@gmail.com other@gmail.com other@gmail.com


master h=job looks like child1->RunIf(true)->child2.



Now when I execute master job in TIC, master job is taking default context variables of child job in all the environments.

I wanted my master job to take child job's context parameters in it's respective environment. Can I get solution?



Thanks,

Suneel.
Four Stars

Re: Is that context parameters should be same in master and child job

Master and child has four environments,
Default, Dev, qa and prod.
Master is executing taking child jobs default context variables in all the environments
Nine Stars

Re: Is that context parameters should be same in master and child job

Hi,

For what you’re doing, consider using a Shared Connection rather than passing the credentials down to the child job

Thanks

David
Regards David
Dont forget to give Kudos when an answer is helpful or mark the answer as the solution.
Four Stars

Re: Is that context parameters should be same in master and child job

I did not get ur point

Seven Stars

Re: Is that context parameters should be same in master and child job

@Suneel: As per your explanation,  my understanding is that you want to run child's context group based on master's. i.e suppose you have selected 'QA' from master job and job want to select 'QA' parameters in child too. Please confirm?

Seven Stars

Re: Is that context parameters should be same in master and child job

@Suneel,

 

If your requirement is based on my previous comment, then you can follow below steps to resolve your issue.

 

You need to specify child's context group value in 'tRunJob' component in Master job as below.

 

Talend_context.jpg

 

Please mark the topic as resolved if my answer helped you and Kudos are also welcome.

Regards,

Vibin CT.

Four Stars

Re: Is that context parameters should be same in master and child job

Yes this is my exact requirement and thanks for ur response.

 

I have seen that option of changing context. Does we have any possibility like it changes automatically depending on it's environment rather we change it manually?

Seven Stars

Re: Is that context parameters should be same in master and child job

Hi @Suneel,

 

If you have same context variable in both master and child, then you can activate '"Transmit whole context" in tRunJob component property, then job will run based on the master job context group.

There is one more way to achieve this while building the job as follows,

 

NB: After building the master job (all the reference children jobs also will be attached automatically), you can run using windows task scheduler or crone scheduler (UNIX).

 

build.JPG

 

 

build_1.jpg

 

Please mark the topic as resolved if my answer helped you and Kudos are also welcome.
Regards,
Vibin CT.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog