on 12-15-2011 5:04 PM
Hello All,
I would like to create an UDF copying an existing one used in another scenario and here is the code below.
This is used in simple graphical mapping.
' public String getMessageID(String a,Container container){
' //write your code here
// get runtime constant map
java.util.Map param = container.getTransformationParameters();
// get value of Message ID by using variable key
String MSGID = (String) param.get (StreamTransformationConstants.MESSAGE_ID);
return MSGID;
when i saved and activated i get the error as below.
Erro :
Source code has syntax error: /usr/sap/FXM/DVEBMGS33/j2ee/cluster/server0/./temp/classpath_resolver/Map919129ac273b11e1b2cc5611b8cdd010/source/com/sap/xi/tf/_MM_I1003_Shipment_SAP_TO_WMQ_.java:4914: cannot return a value from method whose result type is void return MSGID; ^ 1 error
since i dont know the JAVA, can any one guide on this?
1. shoud we need to declare anything globally?
2,or any JAVA program need to create and import ?
Regards,
Sethu.
u cant test this UDF in message mapping..this will only output the message id when u do end to end testing
choose execution type as: single value and use below code:
String constant;
java.util.Map map;
map = container.getTransformationParameters();
constant = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
return constant;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
a litle complement... you CAN test it in Message Mapping...
but for that, you have to go in tab "Parameters" of tab "Test", and to write something (e.g 1234) in the parameter called "MessageId"
Your UdF tested locally in MM will them pick this info (e.g 1234) and return it to you.
Tips: when we want get info from SOAP header, it's better to use a TRY...CATCH to wrap the java function. by this way when test the mapping target field (display queue), we have not a dump !
Mickael
User | Count |
---|---|
77 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.