cancel
Showing results for 
Search instead for 
Did you mean: 

UDF

Former Member
0 Kudos

can any body send me few examples related to UDFs creation.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sudhakar,

First of all why we create UDFs: --> We create the UDF whenever our requirement is not fulfilled by the given FUNCTIONS, or we have a very less knowledge about those FUNCTIONS.

Just go through the below mentioned blog, in which you will find few good examples of functions.

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

Now Come to your ques <<i>can any body send me few examples related to UDFs creation</i>>.

As i mentioned above UDF creation is base on your requirement which is not fulfilled by given FUNCTIONS.

Example: if you have two fields, say A & B and the data is coming in both the fields as shown below

A -- 10 B --- 05

A -- 20 B --- 02

A -- 10 B --- 08

A -- 50 B --- 09

A -- 10 B --- 05

Now if you want to sum the values of B as per the common values coming in A, e.g.

A --- 10 B --- 18

A --- 20 B --- 02

A --- 50 B --- 09

So for the above mentioned example you can wirte an UDF to fulfill your requirement.

For writing and UDF you must have basic knowledge of JAVA.

For creating an UDF, press the user defined function, the declare your variables and then write your desired code.

Regards,

Sarvesh

santhosh_kumarv
Active Contributor
0 Kudos

Creating UDF

The Basic Idea of Java is sufficent to create an UDF in XI. Based on the requirement and code funcationality u need need know the jar files.

Creating UDF:

--> In the LHS of the graphical Editor u can find a Create New Function button

--> Click on it and give a name for u UDF

--> Also specify the parameters to the UDF. Note that the input & Output type to the parameter is always String type

or

--> Create an Java class using IDE and archive the file

--> Upload the archived file into XI in IMPORTEDARCHIEVES of Integeration Repository.

These uploaded functions can be used in the Mapping Editor

Also have a look at this blog

<a href="/people/wojciech.gasiorowski/blog/2006/11/01/the-power-of-regular-expressions-in-graphical-mapping-xi Power of Regular Expression in Graphical mapping</a> By Wojciech Gasiorowski

Regards

San