cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to pass information between two message mappings

Former Member
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

Former Member
0 Kudos

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