on 08-09-2012 9:00 AM
Hi,
Can anyone help me in providing the UDF code to raise exceptions and fail the mapping, placing error message in Error Segment of SXMB_MONI?
I used this one:
throw new RuntimeException("Mapping fail");
But I can see it only in trace:
<Trace level="1" type="T">RuntimeException during appliction Java mapping com/sap/xi/tf/_MM_GetSAPRoles_Request_ Thrown: com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping /ns1:MT_GetSAPRoles_Request; root message: Exception:[com.sap.aii.mapping.api.StreamTransformationException: Mapping fail] in class Amdocs_Authorization_GetSAPRoles.FL_Roles method RaiseException
Thanks in advance.
Hi Dan,
Have you checked this Michal's blog http://scn.sap.com/community/pi-and-soa-middleware/blog/2007/04/26/xipi-throwing-generic-exceptions-...?
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dan,
The first point in the blog deals about how throws an exception in a UDF:
1. At first we will use any mapping and in case we'd like to throw an exception we will fill dynamic configuration value
(we can do it from any type of mapping). In my example I do it from Message Mapping User Defined Function.
With that code and with the standard function IFWithoutElse you can configure your logic neccesary in order to throw the UDF with the exception handling when the logic will be right.
Do you want a different kind of monitoring exception that the Michal's blog?, correct me if i'm wrong
Regards.
I tried his UDF, but received error:
Method not found RaiseException(com.sap.aii.mappingtool.tf7.rt.Container)
This is my code:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/ERROR", "ERROR");
conf.put(keyHeader1, a);
return "";
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
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.