Author |
Message
|
pawel_janowski |
Posted: Fri Jun 22, 2007 2:47 am Post subject: MRM domain problem |
|
|
Apprentice
Joined: 13 Dec 2006 Posts: 38
|
Hi!
In my flow I read a MRM message of one type and I want to produce another of the other type uisng input message to build its content. I just set (in message properties) MsgType and create elements of message like this:
SET OutputRoot.MRM.elem_t1.yyy = InputRoot.MRM.elem_t2.xxx;
It seems to work, but for xsd:datetime datatype it changes the format of the field.
It seems that the output type is self-defined. How to enforce correct datatype on output?
Regards,
Pawel _________________ Pawel Janowski |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 22, 2007 3:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
There is a date time type on the message set. Use it to define the format of the date / time _________________ MQ & Broker admin |
|
Back to top |
|
 |
pawel_janowski |
Posted: Fri Jun 22, 2007 3:28 am Post subject: |
|
|
Apprentice
Joined: 13 Dec 2006 Posts: 38
|
fjb_saper wrote: |
There is a date time type on the message set. Use it to define the format of the date / time |
Thanks.
I know - I set the format according to my needs, but it is ignored. I suppose that the broker does not recognize a object of type containing that datetime field and uses (probably) character datatype to all its fields, and that's why it formats datetime incorrectly. The question is how to enforce the usage of correct output datatype.
Regards,
Pawel _________________ Pawel Janowski |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jun 22, 2007 3:30 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are you using MRM-XML? That's the only domain where what you're saying makes much sense, but you didn't specify.
If you're seeing self-defining elements appear in an MRM-XML tree, it's because the fields that are there do not, in some way, match the elements that are defined in the model. This is usually namespace related. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jun 22, 2007 3:57 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I set the format according to my needs, but it is ignored |
Solve the problem which is causing your dateTime field to be self-defining. As Jeff says, your message tree does not match your message model.
Quote: |
I just set (in message properties) MsgType and create elements of message like this: |
You will need to set MessageSet, Message Type and Message Format in order to do what you are trying to do ( in other words, you need a message definition for your output message ). |
|
Back to top |
|
 |
pawel_janowski |
Posted: Sun Jun 24, 2007 11:48 pm Post subject: |
|
|
Apprentice
Joined: 13 Dec 2006 Posts: 38
|
Well, the problem is a little bit deeper I suppose. First of all, of course I use MRM-XML domain. I set MessageSet, Message Type and Message Format i RFH2 header of the output message.
Making exercises I did like follows:
I set the option to write xsi:type on output for any type (simple or complex) and I found out that the complex type (called in my example header) is set up correctly - it has correct namespace and type definition but elements of that complex type (which are complex itselves) are not (they look like based on simple xml datatypes, but supplied with sence - I mean dateTime field is recognized correctly). But SURPRISINGLY one (and the only one) of the elements has correct definition (correct namespace and datatype)???
As I wrote before - I try to change input message to output message of the other MessageType (from that same domain) and those messages share header (mentioned above). So I made an experiment and used the header from the input message to build the header of the output one (just SET InputRoot.MRM.header = OutputRoot.MRM.header) and in such a case everything works fine. So the question is why I can't build the header from scratch (or how to create a "header factory" procedure).
And one more thing - in my input message I do not set the element which in magic way resolves to correct definition on output - maybe it has a meaning (but at the beginning I don't use the input message header to create the header on the output).
Any ideas? Thanks in advance.
By the way - is it possible to pass the whole InputRoot and/or OutputRoot as a paramter to the procedure defined outside of the scope of module refering to the message? _________________ Pawel Janowski |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Jun 25, 2007 12:13 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
Quote: |
Quote: |
By the way - is it possible to pass the whole InputRoot and/or OutputRoot as a paramter to the procedure defined outside of the scope of module refering to the message? |
|
Create a reference of the root element and pass it across _________________ Cheers |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jun 25, 2007 2:29 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@ pawel_janowski
You may get a clearer view when using a trace node to dump the message as this should show you as well the name spaces.
I have found that using a reference and querying for the name space (FIELDNAMESPACE(ref)) gives sometimes unexpected and interesting results...
The input message is not always what it seems. Beware of look alikes....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|