Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
DaveTaylor
Contributor III
Contributor III

Access TDI Custom Code Routine(s) from with TDM (Mapper)

I am using version 6.2.1 presently.

I have a generic TDI Custom Code Routine;

0683p000009LrfN.png

that I would like to be able to access from within my TDM Mapper Map.

Is this possible?

I am aware of how to build your own custom jars; and load them so that the mapper can use them; but in this situation; I am wanting to access 

already existing TDI Code Routines; in the same manner you can do within TDI tJava/tJavaRow components.

Has anyone found a way to access existing TDI Code Routines from within a Map?

Labels (3)
4 Replies
Anonymous
Not applicable

Hi,

 

Yes, it is possible.

 

Here is a tutorial

https://www.youtube.com/watch?v=sO8cCY_-Vos

 

Eric

DaveTaylor
Contributor III
Contributor III
Author

Hi Eric, thanks for your reply; but either I misunderstood; or your answer didn't answer my question.

 

I have seen that video.
I am aware of how to create your own custom Jar files; and make them available to the Mapper via the mapper Java function.

 

However, I am not wanting to create a custom jar; nor load a custom jar into the mapper.


Rahter, I am wanting to use some of the static custom TDI Code-Routines that have been built.

They already exist; and can be callable via any TDI tJava or tJavaRow component without loading any external jars.

 

Is it possible to reference those TDI Code-Routines from the Mapper?


These static routines here below:

 

0683p000009LqwI.png

 

So for example; in TDI; in a tJavaRow component; I could write this:
String test = Base_65_enc.getResult(inputParam); 

Is it also possible inside of Mapper; to access that same TDI-Code-Routines-Base_64_enc static function?



 

 

Anonymous
Not applicable

Hi,

 

I will clarify.

 

You can call a routine from TDM with java function.

 

For instance, in class name you can enter routines.StringHandliung and in method name LEFT.

 

To be able to run a map from mapping perespective, you will have to add the routines.jar as in the video.

 

To create this jar:
1-Create a dummy job with just a tJava component.
2-Build this job
2-Unzip the zip created at last step and pick up the jar routines.jar

 

To run the map from a job, this jar is not required.

 

See also https://jira.talendforge.org/browse/TDM-5382

 

Eric

DaveTaylor
Contributor III
Contributor III
Author

Thanks Eric; that is exactly what I needed.

Just really needed to see the format of what the mapper was expecting.

The the Repository has it Code.Routines camelcase, and mapper java function was wanting it as just routines(lowercase) .functionname

is what was throwing it off.
All is good now.
Much appreciated!