Skip to Content
author's profile photo Former Member
Former Member

How can i write global user defined functions

I have a simple user defined function, but i want to use it in many different mappings.

Is there another way than copying the function to all mappings ?

Is it possible to write "global" functions ?

Thx a lot

JS

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Apr 09, 2008 at 11:51 AM

    Not possible till Pi 7.0. It would be possible in PI 7.1

    Regards,

    Prateek

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 09, 2008 at 12:02 PM

    it is not possible.

    but you can call different UDF from 1 UDF in same message mapping by GlobalContainer.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 09, 2008 at 12:06 PM

    In 7.0, you can at least create a class with such methods and import&refer to this class within your UDFs.

    At least you avoid having to duplicate the code and maintain it only once.

    You need to import the class under imported archives (it doesn't need to implement StreamTransformation interface, since it won't work as a java mapping on its own).

    Also, for each different Software Component that needs to access this class, you need to refer the SWC where it's imported as a Basis SWC for the SWC where you want to use it.

    Regards,

    Henrique.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 09, 2008 at 12:15 PM

    hi,

    you can define you UDF, then copy the code into notepad and save it as <name>.mte

    later in you new mapping press CTRL + SHIFT + Right Buttom > tools>Export tools-->Import and select the .mte. select your UDF.

    by this way you use the same UDF in many mappings.

    Hope it helps

    Rodrigo

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.