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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Labels (3)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

@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...

 

 

View solution in original post

2 Replies
akumar2301
Specialist II
Specialist II

@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...

 

 

Anonymous
Not applicable
Author

Hi Kumar,

Thanks for your prompt solution. It worked well.