Author |
Message
|
vanessa |
Posted: Tue Jun 18, 2002 11:59 am Post subject: Repeating Xml to MRM |
|
|
Novice
Joined: 24 Jan 2002 Posts: 22
|
Probably I am asking a simple question here ...
I am working on repeating fields,.. transforming from XML to MRM ......
I set the prperties for field1 and field2 as repeat and assigned RepeatCount type as - ValueOf & Repeat Count Value of as- valTimes( which is 3 here).
I dont get any error but I dont see any data in the output queue.
Is there anything wrong in my eSQL ...??
-------------------------
below is my XML and eSQL ..
-------------------------
<FeData><Counter valOf='3' /><InBody tag1 ='111' tag2 ='abc' /><InBody tag1='999' tag2 ='def' /><InBody tag1 ='456' tag2 ='xyz' /></FeData>
DECLARE x INTEGER;
SET x = InputBody.FeData.Counter.valOf;
DECLARE K INTEGER;
SET K = 1;
SET OutputRoot.MRM.valTimes = x ;
WHILE K <= x do
SET OutputRoot.MRM."field1"[K] = InputBody.FeData.InBody.tag1;
SET OutputRoot.MRM."field2"[K] = InputBody.FeData.InBody.tag2;
SET K = K + 1;
END WHILE;
pls help me ...
thnx in adv... |
|
Back to top |
|
 |
CodeCraft |
Posted: Tue Jun 18, 2002 1:46 pm Post subject: |
|
|
Disciple
Joined: 05 Sep 2001 Posts: 195
|
What does your user trace and event log say? You have not set the properties for the MRM message:
MessageSet
MessageType
MessageFormat
You do not state whether or not you have the code to copy the headers, so, you may not have an MQMD attached either. |
|
Back to top |
|
 |
kirani |
Posted: Tue Jun 18, 2002 2:07 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Make sure you have
1. set Copy message headers only in your comptue node.
2. assign proper values in Properties folder,
Code: |
SET OutputRoot.Properties.MessageSet = 'D....';
SET OutputRoot.Properties.MessageDomain = 'MRM';
SET OutputRoot.Properties.MessageType = 'm_...';
SET OutputRoot.Properties.MessageFormat = 'CWF';
|
3. Change your while loop ..
Code: |
WHILE K <= x do
SET OutputRoot.MRM."field1"[K] = InputBody.FeData.InBody[K].(XML.Attribute)tag1;
SET OutputRoot.MRM."field2"[K] = InputBody.FeData.InBody[K].(XML.Attribute)tag2;
SET K = K + 1;
END WHILE;
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
CodeCraft |
Posted: Tue Jun 18, 2002 11:30 pm Post subject: |
|
|
Disciple
Joined: 05 Sep 2001 Posts: 195
|
Two points:
1. There is no such property as "MessageDomain". It is implicit by the parser (tree) root and not an actual valid member of the "Properties" subtree/folder. The documentation which references it is incorrect.
2. It's always good to see (XML.attr) being used to qualify things for readability, but in the case of *reading*, it should only required if for the XML attribute in question there is also has an element of the same name with the same parent, eg:
<a b"=1"><b>2</b></a>
In this case Root.a.b = "2" and Root.a.(XML.attr)b = "1".
Whereas in this case:
<a b="1"><c>2</c></a>
Root.a.b ="1"
(if memory serves me well). |
|
Back to top |
|
 |
Tibor |
Posted: Wed Jun 19, 2002 3:59 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
CodeCraft wrote: |
1. There is no such property as "MessageDomain". It is implicit by the parser (tree) root and not an actual valid member of the "Properties" subtree/folder. The documentation which references it is incorrect. |
It's not true, I used this property in some script. This is a good stuff when I want to set a dynamic domain info before a ResetContentDescriptor node. |
|
Back to top |
|
 |
CodeCraft |
Posted: Wed Jun 19, 2002 4:12 am Post subject: |
|
|
Disciple
Joined: 05 Sep 2001 Posts: 195
|
It's possible use as a dynamic input to RCD is not the same as it's validity when setting the message properties.
I suspect if you trace "Properties", even if you have created MessageDomain in the folder, the Properties parser will not consider it part of the folder and will not therefore trace it. The MessageDomain property is not used when serialising a message.
It may well be that it is used as a dynamic input to RCD, since I know that the other 3 properties are, and I'm currently arguing this with some colleagues in IBM Hursley who believe otherwise!
Can you send me an example of this working? I can obviously do this myself but if you have it handy it will save time! |
|
Back to top |
|
 |
Tibor |
Posted: Wed Jun 19, 2002 5:04 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
CodeCraft wrote: |
Can you send me an example of this working? I can obviously do this myself but if you have it handy it will save time! |
maybe something similar:
Code: |
mqinput: BLOB
compute:
<copy msg headers>
set OutputRoot.BLOB.BLOB = bitstream(InputBody);
set OutputRoot.Properties.MessageDomain = 'BLOB';
mqoutput
|
|
|
Back to top |
|
 |
CodeCraft |
Posted: Wed Jun 19, 2002 5:30 am Post subject: |
|
|
Disciple
Joined: 05 Sep 2001 Posts: 195
|
This doesn't demonstrate the RCD, and, the setting of the MessageDomain in this case is superflous, and not used by WMQI.
For arguments sake, try it in a flow, comment out the line, and see if it makes any difference. |
|
Back to top |
|
 |
tchagan |
Posted: Wed Jun 19, 2002 5:58 am Post subject: Back to the original question... |
|
|
 Apprentice
Joined: 10 Feb 2002 Posts: 31
|
Why have a <Counter valOf='3'> in your XML message if you are only using wmqi, you can use the cardinality function to count how many InBody elements you have in your input message i.e.
SET x = CARDINALITY(InputBody.FeData.InBody[]);
rgds
Terry |
|
Back to top |
|
 |
vanessa |
Posted: Wed Jun 19, 2002 9:28 pm Post subject: |
|
|
Novice
Joined: 24 Jan 2002 Posts: 22
|
hi guys
I sincerely thank you for the help. I tested this solution, but I dont see data in the output queue. Somehow I can see only the data length in the WIN-NT message explorer.
Another point here,When I checked using debugger it is showing the XML data parsed properly into MRM fields correctly in the compute node. but by the time it arrives at MQOutput node, I dont see data.
Suggest me what to do to see the data in the queue.
thanks in adv |
|
Back to top |
|
 |
kirani |
Posted: Wed Jun 19, 2002 9:36 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Could you put a trace node between Compute node and MQOutput node and print ${Root} in it to see the tree is building properly or not. What is the value set in MQMD.Format field? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
wmqi_2 |
Posted: Thu Jun 20, 2002 9:41 am Post subject: |
|
|
Novice
Joined: 04 May 2002 Posts: 12
|
Hi Kirani
I have reequirement which is similiar to this case,
I tested ur idea with this xml data
<FeData><Counter valOf="3" /><InBody tag1 ="111" tag2 ="abc" /><InBody tag1="999" tag2 ="def" /><InBody tag1 ="456" tag2 ="xyz" /></FeData>
I do see message in the queue.
You know the message is supposed to look like :
3111abc999def456xyz
But it gives :
4spaces111999456abcdefxyz ( 111999456abcdefxyz).
How to correct this ?
thanks and let me know |
|
Back to top |
|
 |
kirani |
Posted: Thu Jun 20, 2002 8:42 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
wmqi_2,
This was expected output from above ESQL. If you want following output,
3111abc999def456xyz
then you should first create a type element and then set repeat count for Type element under connection tab and specify correct value in CWF tab. Modify above ESQL to have repeating type element, for example,
Code: |
WHILE K <= x do
SET OutputRoot.MRM."repeat_elemtn"[K]."field1" = InputBody.FeData.InBody[K].(XML.Attribute)tag1;
SET OutputRoot.MRM."repeat_elemtn"[K]."field2" = InputBody.FeData.InBody[K].(XML.Attribute)tag2;
SET K = K + 1;
END WHILE;
|
Hope this helps. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
wmqi_2 |
Posted: Sun Jun 23, 2002 10:34 pm Post subject: |
|
|
Novice
Joined: 04 May 2002 Posts: 12
|
Kirani
I am sorry for asking again. I am getting the error - unexpected NULL value was encountered.. Please tell me where did I go wrong...
I have 3 elements in my message-
valCount - Integer
field1 and field2 - String (I did set all the properties whch are required for repeating fields). Both of length 3.
I used a trace node after the Computer node.
Using the input XML -
<FeData><Counter valOf="3" /><InBody tag1 ="111" tag2 ="abc" /><InBody tag1="999" tag2 ="def" /><InBody tag1 ="456" tag2 ="xyz" /></FeData>
eSQL is -
Code: |
DECLARE x Integer;
SET x = InputBody.FeData.Counter.(XML.Attribute)valOf;
DECLARE K INTEGER;
SET K = 1;
SET OutputRoot.MRM.valCount = x;
WHILE K <= x do
SET OutputRoot.MRM."field1 "[K]."field1" = InputBody.FeData.InBody[K].(XML.Attribute)tag1 ;
SET OutputRoot.MRM."field2 "[K]."field2 " = InputBody.FeData.InBody[K].(XML.Attribute)tag2 ;
SET K = K + 1;
END WHILE; |
Now, My trace node says :
(0x1000008)MRM = (
(0x3000000)valCount = 3
(0x1000000)ff1 = (
(0x3000000)ff1 = '111'
)
(0x1000000)ff1 = (
(0x3000000)ff1 = '999'
)
(0x1000000)ff1 = (
(0x3000000)ff1 = '456'
)
(0x1000000)ff2 = (
(0x3000000)ff2 = 'abc'
)
(0x1000000)ff2 = (
(0x3000000)ff2 = 'def'
)
(0x1000000)ff2 = (
(0x3000000)ff2 = 'xyz'
)
) |
|
Back to top |
|
 |
wmqi_2 |
Posted: Mon Jun 24, 2002 7:12 pm Post subject: |
|
|
Novice
Joined: 04 May 2002 Posts: 12
|
help ! help ! help ! help ! help ! help ! help ! help ! help ! help ! |
|
Back to top |
|
 |
|