cancel
Showing results for 
Search instead for 
Did you mean: 

regarding user defined functions(UDF)

Former Member
0 Kudos

Hi,

I created a UDF(user defined function) in Message Mapping.

my question is: is it possible to save the UDF which i created, if so i can reuse this UDF in other mapping.

Can any one help me

thanking you

regards

harsha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Harsha !

You can copy your whole message mapping object containing the UDFs you need to the new message mapping you need to use, and then change its message types to the new ones...this will copy all your UDFs in just one step.

Example: you have a working interface with message mapping object MM_MyMapping that contains several UDFs. And now you need to develop a new message mapping for a new interface/scenario..just select the MM_MyMapping object in repository, use the copy object option, enter the new name (e.g. MM_NewMappingWithUDFs) and select the current namespace...then you will have the MM_NewMappingWithUDFs containing all the MM_MyMapping UDFs..now you just have to change the source and target message types for the new interface in the "Messages" tab.

Hope it helps !

Good luck !

Matias

Answers (6)

Answers (6)

Former Member
0 Kudos

another nice possibility is to use a new softwarcomponent version or only a new namespace called "patterns or templates".

We store a lot of patterns, templates (java-udf, mapping) in that Namespace to have them centralized. Searching is not needed.

Now you have a central space of your udf codes and can copy the (code only) udf to your needs.

maybe useful!

Gordon

Former Member
0 Kudos

Hi,

UDF's cannot be used across different mappings as of now. But his will be possible in PI 7.1.

As of now, you can write the UDF code into a Java Class and then import this Java code as a JAR utility in your Imported Archives.

Across different mappings, you will need to give the path to the imported archive (package name) and then call the respective function.

Former Member
0 Kudos

Hi Harsh,

UDF is only for Mapping where you defined. Not for local to scnario and Not for Global. So if you want resue it in another mappping , just copy and past by creating new UDF in another mapping. This is the only way you can do.

In the Next version , they may correct it. Probabaly.

Warm Regards,

Vijay.

Former Member
0 Kudos

you can't reuse UDF, but there is one alternative here,

you can create reuse logic in java program, then upload to XI, then in each UDF, call this java class, that will be reusable.

Former Member
0 Kudos

Hi,

Moreover, you can create a mapping template, put all your UDF there and reuse this template for all your mappings. But, for that you need to use a dummy message type source and target and replace it to the required message type.

I hope it helps.

Cheers,

Ricardo.

justin_santhanam
Active Contributor
0 Kudos

Harsha,

<b><i> Is it possible to save the UDF</i></b> .... Do you mean you want to copy this UDF and use it another mapping? There is no option of copying UDF as whole, what u can do is u can copy the code from the exisitng UDF and paste the same in ur new UDF.Also try to create the new UDF with the same parameters as defined in the existing one.

I doesn't know it helps u or not, its my suggestion. This how I'll use to do.

Best regards,

raj.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

no - currently, it is not possible to reuse them

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>