Skip to Content
author's profile photo Former Member
Former Member

Mapping Java Function to get MessageId returns null

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;

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Feb 21, 2005 at 08:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2005 at 02:24 PM

    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;

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 21, 2005 at 02:52 PM

    Could it be something silly like not having activated your change list before (re)testing the mapping in the runtime?

    - Thorsten

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2005 at 03:24 PM

    Yes I have re-actived. I have opened an OSS note. Should you be able to see the IX Version within the Mapping Test Tool?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.