on 04-30-2008 3:14 PM
Hi to all, I have a simple question but I didn't find an answer in other sdn thread.
Is it possible to set the ReferenceMessageID in a UDF? if not, How can I do it?
Your help would be appreciated
Regards
Emiliano
Hi,
You can get the RefMsgId value from the DynamicConfiguration object, but I'm not sure you can set it (even if it is possible, you must check it won't create any inconsistencies in XI messages store or related) ...
Why do you need to set this explicitly, cuz XI is in charge of this field, at least in usual situation ?
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok I'll try to explain the scenario.
I have two async messages. One from a System A to System B, and the second
goes from System B to System A.
The both scenarios are async. I would if it is possible to reference one message to
the other in order to easly see them on the runtime workb or other monitor.
Maybe it is possible to set those header message parameters from custom Adapter module?
Thanks
Emiliano
I can read the msg ID of the first msg(SysA-->SysB) and write it in the payload. A program running in
the system B will read the msgId from payload and will pass it to the paylod of the second msg(SysB-->SysA).
I wonder how I can write this msgId of the first message into the refmsgid parameter of the second one....
course if it possible....I am quite sure that it is possible by inbound adapter module processor(SysB --> SysA)...anyway I would not to use a custom module processor.
Thanks
Emiliano
A simple plan could be creating a table to store this msgid (that will become the ref msg id for the other intf), your first msg mapping would store its msg id in this table and then it could be read using db lookup in your mapping for the other flow. This table could have a key field for correlation (like doc nr) and a field for msgid of intf A2B
More complex and "professional" solution could be created for sure
Chris
You could also work with BPM, using correlation feature, it might do the trick without storing values in custom table (though the ref msg id still needs to be retrieved before coming back to the BPM) ...
In the "response" msg, can you adapt the piece of code responsible for its creation in order to pass the msg id received in the input document ? It would be things much easier
Chris
Yes, I can use the code to manage the ref msg, but I don't know how
to set that value on the parameter "RefMsgId" in the Header of the "response" message.
I can write the RefMsgId in the payload of the "response" msg, and then
using the Api of the module adapter(
Message msg = (Message)inputModuleData.getPrincipalData()
) I can set that parameter(
Message.setRefToMessageId()
).
Is it possible to do it using a UDF?
Emiliano
Maybe, but not sure, you can set it thru the DynamicConfiguration object in your UDF, like :
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
http://sap.com/xi/XI/System,
RefToMessageId);
conf.put(key, newRefToMessageId);
I'm not sure about RefToMessageId's original namespace
Chris
The problem is that even though you may be able to set it at mapping, mapping runtime occurs at interface determination step, which is after the receiver determination, where XI evaluates the proper receiver of the message. So, the field must be filled before receiver determination step, hence you need adapter module.
In this blog, I comment on sync/async scenarios without BPM: /people/henrique.pinto/blog/2007/08/02/syncasync-scenarios-without-bpm
The setRefToMessageId() method may even work, but I was successfull setting the CorrelationId. For this, you should use setCorrelationId() method in the adapter module. More info here: http://help.sap.com/saphelp_nw70/helpdata/EN/17/50d440e14f8431e10000000a1550b0/frameset.htm
Regards,
Henrique.
Also, to set non-adapter specific message atributes (xi message header, not dynamic configuration) use something like this in UDF (I'm not sure it'll work though, you'll have to try it):
> String id = null;
> ...
> (retrieve msg id value from payload)
> ...
> container.getTransformationParameters().put(StreamTransformationConstants.REF_TO_MESSAGE_ID, id);
Regards,
Henrique.
User | Count |
---|---|
79 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.