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

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch