on 04-28-2016 6:45 AM
Hello
My requirement is to call a existing UDF inside a Java mapping. The UDF has only one input variable that is Container, when I am calling this UDF inside Java map, I am getting error as container can not be resolved to a variable. I tried declaring it as Container container but its throwing initialization error.
Below is the UDF call.
FL_HR_Workday fl_hr_workday = new FL_HR_Workday();
String wsse_Header = fl_hr_workday.getWSSE_SecurityHeader(container);
Is there any way to access existing container object and pass it to udf?
We are using PI7.4 dual stack.
Thanks,
Minal
Is this a User Define Function within a Graphical Mapping? If yes, I am not sure I understand why you would want to access a Graphical Mapping UDF from a Java Mapping. Is that even possible?
Could you let us know more on the requirement or am I completely off track?
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Inaki Vila,
I have checked the API but didnt find anything specific to this requirement.
@Bhavesh,
Requirement is to call UDF which is a part of Function Library in Java mapping.This UDF is a common UDF used across multiple mappings, the information stored in this UDF is required in Java mapping.
So I have written below code to access the UDF in Java mapping.
FL_HR_Workday fl_hr_workday = new FL_HR_Workday();
String wsse_Header = fl_hr_workday.getWSSE_SecurityHeader(container);
If container is initialized as NULL as mentioned by Eng Swee Yeoh then I am able to call the UDF. This is working when container object is not used in the UDF.
Container container = NULL;
FL_HR_Workday fl_hr_workday = new FL_HR_Workday();
String wsse_Header = fl_hr_workday.getWSSE_SecurityHeader(container);
However if I use container for ex. for getting trace inside UDF then the java map is throwing error, since container is initialized as NULL in it.
So I believe only way to make this work is to get container for java map and pass it to UDF (without passing it as NULL).
Please let me know if thats possible.
Minal
I asked earlier if container is used in the UDF logic and you said no. Now you are saying you want to use the container in the existing UDF for trace. However, that means will indicate that you will change the UDF in a Function Library that is may already be used by other mappings etc. Is that what you are planning to do?
Regards
Eng Swee
Hi Minal
AFAIK, there is no access to the Container object from a Java mapping. Container is only available from Graphical Mapping.
Maybe you might want to change the approach of your reusable methods/libraries. Instead of putting the core logic in a Function Library's UDF, develop them as classes externally, then import them as JAR files for reference. With this approach, they can be used by both UDFs or Java mapping
- UDF - can call the methods in the JAR file as long as the relevant import statement is included
- Java mapping - can include the JAR file in the build path
Regards
Eng Swee
Hi Minal
In the UDF logic, is the container used? If not, then just pass in null from your Java mapping.
Regards
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.