Job orchestration and global vars with iterations

Seven Stars

Job orchestration and global vars with iterations

I created this sample job which has multiple flow to iterate components and iterations are set to 40 and 2

 

Question; can I trust that the globalVar which is set in subjob1 will be the same in subjob2? or could it be a different one caused by the number of concurrent iterations?

 

 

Screenshot from 2017-07-11 10-51-35.png

-----------------------------------------------------------------------------------------------------------
When you like my answer, please accept it as solution and send some kudos

Accepted Solutions
Highlighted
Community Manager

Re: Job orchestration and global vars with iterations

Hi
You can set the key with the current iteration number, eg:
"Key"+((Integer)globalMap.get("tFlowToIterate_1_CURRENT_ITERATION"))
It ensures the global var is always the same in subjob1 and subjob2 even though you use concurrent iterations.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post


All Replies
Highlighted
Community Manager

Re: Job orchestration and global vars with iterations

Hi
You can set the key with the current iteration number, eg:
"Key"+((Integer)globalMap.get("tFlowToIterate_1_CURRENT_ITERATION"))
It ensures the global var is always the same in subjob1 and subjob2 even though you use concurrent iterations.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

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