on 06-07-2007 2:28 AM
As far as i know, the UDF cannot be referenced cross the different mapping
so, how to manage the UDF (such as the very common function)
and if i want to change the UDF, i just want to change in the referenced place
i don't want to change the other same UDF
Another option~
1. Create a Class that will contain the corresponding UDF logic.
2. Create a base Software Componenet and import this Class under the Imported Archives of this Base SWCV.
3. Now , all the other SWCV's should have a Usage Dependency Defined on the Base SWCV.
4. Whenever you want to call this UDF, create a UDF in the graphical mapping that will instantiate the Class in the Base SWCV and then invoke the method.
5. Any change to the logic needs to be done on the Class in the BASE SWCV.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Leo,
I would suggest to have all the user defined functions in one mapping and create it as a mapping template. Then use this mapping template as your mapping. Here even you can change the message type but still your UDFs will be there. Also you change the UDF according to the requirement for that mapping.
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Leo,
First of all Global Variables which we are defining can't be referenced across mapping, I won't think so that UDF can be referenced. Since you said that UDF is common, I won't think so its related to any of the particular nodes, I mean the input parameter of UDF is independent across mappings. So what I would suggest you is write java class and place the class file in the XI mapping folder , I don't know the exact location, if you want i'll try to find it out and let you know. So the common file is there so u can use that functionality across all mappings.
I doesn't know it helps you are not, its just an idea/approach from my point of view.
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
The above approach of creating jar file will not work for UDF.....you create jar file and import them for JAVA mapping programs and not for UDF........
Hi Leo,
To manage common functions, i suggest you to create a common file having all your common functions in any folder........then in every mapping which you create you can copy-paste the UDF in your mappings........but then you will also have to maintain an excel-sheet to have this information that which UDFs you are using in which mappings................then on changing the UDFs, you will have to copy-paste the latest UDFs in all the mappings...........
Thanks,
Rajeev Gupta
Raj,
In a similar situation I created a class with several functions that contain the logic for the user-defined functions and imported a jar file containing the class under Imported Archives.
All the user-defined functions only call the functions in this class.
You can even create a separate SWCV which holds the class and make your other SWCVs dependent on it so that you only have to import the jar files containing you UDF class(es) in one place.
Kind regards,
Koen
Hi Leo,
I suggest you to follow the approach bhavesh already told you, it's the same I follow and gives you a wide flexibility in reusing the functions and mantaining the code.
Just to add to what he already said, I would probably declare al the methods of the class as static so that you do not need to instantiate an object inside the UDF but just reference the static method of the class.
Kind Regards,
Sergio
>
> Just to add to what he already said, I would probably
> declare al the methods of the class as static so that
> you do not need to instantiate an object inside the
> UDF but just reference the static method of the
> class.
Never thought about this. This is what happens when you forget the basics of Java Quite a useful tip Sergio. Thanks!
Regards
Bhavesh
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.