cancel
Showing results for 
Search instead for 
Did you mean: 

How to migrate User Define Function to another mapping in other namespace

Former Member
0 Kudos

Hi Everybody

I have define many User Define Functions in mapping

How can i use them in other mapping

Thank you in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

User defined functions are specific for a particular mapping. So u cant reuse them.

One work around is to do the UDF as a java program. Create a Jar and import it into SWCV. Then u can use it in all mapping prpograms.

Hope this helps.

Regards,

P.Venkat

Former Member
0 Kudos

Hi Venkat

Could you be more specific on ""<b>do the UDF as a java program</b>

Thanks again

Former Member
0 Kudos

Hi ,

You can transfer entire logic of your UDF into Java class and import this class into imported archieves.As a result you can reuse the UDF's.

Check this thread...

Sekhar

henrique_pinto
Active Contributor
0 Kudos

> Hi Venkat

>

> Could you be more specific on ""<b>do the UDF as a

> java program</b>

>

> Thanks again

You'd create a Java API which contains a class with the methods you want to use. Then, in your UDFs, you will just import this class and call the methods.

Regards,

Henrique.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I tried to explain the steps.

1. Take the JAVA code of your User-Defined Functions

2. Go to a JAVA editor (e.g NWDS, Eclipse, etc...)

2.1. create a Java project

2.2. create a Java class

2.3. inside your Java class, put each JAVA code of your User-Defined Function inside a Method

2.4. Export your Java class to a JAR file (e.g my_tools.jar)

3. Go to IR

3.1 create an Imported Archive (IA) and upload your JAR file.

3.2 in this IA, you see your Java class which contains all your methods.

4. inside your mapping,

4.1 create a User-Defined Function <u>and import</u> your class

4.2 use your method.

So, you define in only one place your code (thanks to a IA) and you will be able to use it inside several mappings.

I hope I don't forget steps...

Advantage: if tomorrow, you want to create a new function, just add a new method to your Java class and re-import your JAR file

Oh, I missed: your IA must be created inside a specific Software Component (SC__TOOLS) and this one must be linked with the others by a "Usage dependency", else your IA will be recognise only in one Software Component (and maybe only in one namespace)

Mickael

Former Member
0 Kudos

Hi ,

Check this thread...

Sekhar