Accessing globalMap inside custom routine block

Five Stars

Accessing globalMap inside custom routine block

I have a function defined inside the Code->Routines which accepts String & Integer as input parameters and returns a String. This function is then accessed by all the tMap’s of the job.

I want to define a Global globalMap which will be loaded ( globalMap.put ) somewhere in the Talend job using javaFlex , before the tMap and will be accessed inside the custom routine function ( globalMap.get ). The globalMap should be accessible within the customer routine function. I don’t want to change the input parameters of the custom routine function as this will require to change all the tMaps where the function is used.

 

Can anyone please suggest the solution for this.

 

Thanks

Aanchal


Accepted Solutions
Eleven Stars

Re: Accessing globalMap inside custom routine block

@aanchal

 

You could create a local static Concurrent  hashmap in your Routine like routineMap.

Copy for GlobalMap to routineMap by setter method.use the values in your routine as you need.

 

or 

 

https://community.talend.com/t5/Design-and-Development/accessing-globalMap-inside-a-custom-routine/t...

 

 

Regards
Abhishek KUMAR

All Replies
Eleven Stars

Re: Accessing globalMap inside custom routine block

@aanchal

 

You could create a local static Concurrent  hashmap in your Routine like routineMap.

Copy for GlobalMap to routineMap by setter method.use the values in your routine as you need.

 

or 

 

https://community.talend.com/t5/Design-and-Development/accessing-globalMap-inside-a-custom-routine/t...

 

 

Regards
Abhishek KUMAR
Five Stars

Re: Accessing globalMap inside custom routine block

Hi Kumar,

Thanks for your prompt solution. It worked well.

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch