Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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!

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question