I have inserted java code "below" in a User-Defined java function, that execute and I am expecting the current containers MessageId to be returned. I am getting a null. Does anyone know why?
String constant;
java.util.Map map;
map = container.getTransformationParameters();
constant = (String) map.get(
StreamTransformationConstants.MESSAGE_ID);
return constant;
This will work at runtime. However, I expect it is during testing in the Integration Builder that you found this does not work - which is true. IB does not assign a message ID for a mapping test. Nor does it assign sender service/party, etc. etc.
Regards,
Thorsten
Thanks for the response Thorsten
I kind of figured this and also tried it out in the runtime (not just mapping test tool) and lot the same results (a null). I also have tried lots of the other "Mapping Runtime Constants" like VERSION_MAJOR
, INTERFACE_NAMESPACE, etc.. and lot the same results. I must have something very basic wrong. Here is my code again. Do you see anything wrong?
MappingTrace trace;
String constant;
java.util.Map map;
trace = container.getTrace();
// get constant map
map = container.getTransformationParameters();
constant = (String) map.get(StreamTransformationConstants.VERSION_MAJOR);
trace.addInfo("VERSION_MAJOR:" + constant);
return constant;
Could it be something silly like not having activated your change list before (re)testing the mapping in the runtime?
- Thorsten
Add a comment