Skip to Content
avatar image
Former Member

Best way to pass information between two message mappings

Hi,

I'm using two chained message mapppings (one after another in the operation mapping / interface mapping).

How could I pass information from the first message mapping (graphical or Java, I don't mind) to the next one without modifying the payload?

I'm thinking if it could be possible to set some custom header parameters in the header of the message, but I think that only works in adapter module development.

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 29, 2009 at 06:42 PM

    Hi Jorge,

    Try this...

    UDF in first Message Mapping - setDynamicVariable(String name, String value)

    DynamicConfiguration dc = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    
    if (dc == null)
       return "Works with Interface Mapping test only.  Not Message Mapping test.";
    	
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://my.test.com/custom", name);
    dc.put(key, value);
    
    return value;
    

    UDF in second Message Mapping: getDynamicVariable(String name)

    DynamicConfiguration dc = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    
    if (dc == null)
       return "Works with Interface Mapping only.  Not Message Mapping.";
    	
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://my.test.com/custom", name);
    return dc.get(key);
    

    Thanks,

    -Russ

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Russel,

      I think that's the way to go. I thought that the dynamic configuration section of the XI message was reserved for setting adapter specific attributes, and so I discarded it.

      I'll try and let you know.

  • avatar image
    Former Member
    Jun 29, 2009 at 06:11 PM

    Lopez,

    I think your question is incomplete. If I understand correctly you have two message mappings for example and for mapping1 output should be the input of mapping2. If yes then simply take the target of mapping1 and give it as source1 of mapping2. Please see this help for more information:

    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping

    He is doing xsl mapping in his example. In your case change your mapping accordingly.

    Regards,

    ---Satish

    Add comment
    10|10000 characters needed characters exceeded