ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Filter node and XML messages.

Post new topic  Reply to topic
 Filter node and XML messages. « View previous topic :: View next topic » 
Author Message
venky
PostPosted: Sat Aug 30, 2003 2:07 pm    Post subject: Filter node and XML messages. Reply with quote

Master

Joined: 08 Jul 2003
Posts: 205

How do I access the XML messages in the Filter node ?

For Example, this is my message,

<?xml version="1.0" encoding="UTF-8"?>
<Invoice>
<Purchases>
<Item>
<Quantity>10</Quantity>
</Item>
<Item>
<Quantity>200</Quantity>
</Item>
</Purchases>
</Invoice>

how to I get the value 10 and store it in a INTEGER data type.

Please help me with the proper ESQL to be written in the filter node.

thanks
Venky.
Back to top
View user's profile Send private message
EddieA
PostPosted: Sat Aug 30, 2003 2:55 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

A filter node is just that. The ability to filter (and change the path of the message) based on the message content. There is no way to change the actual content of the message.

If you want to change the message, then use a Compute node.

What do you want to do when you have stored the value in an INTEGER.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
inder
PostPosted: Sat Aug 30, 2003 3:08 pm    Post subject: Reply with quote

Apprentice

Joined: 24 Mar 2003
Posts: 49
Location: USA

You cannot change the contents of a message using the filter node. U can make decisions to route the messages depending on the conditions.

If you want to take the contents of your XML message in to a integer to make some decisions, you can do as below

Declare aa int;
set aa = Root.XML.(XML.tag)Invoice.Purchases.Item[1].Quantity;

As there are no output message to be referenced in the filter node we just reference the input message as Root instead of InputRoot

remember the above code works only if the element(Quantity) is integer . If not it throws an error saying try to cast character as integer. Here I just put 1 for referencing the first element. You can use an index to get to any element.

Hope this helps

Inder
Back to top
View user's profile Send private message
venky
PostPosted: Tue Sep 02, 2003 8:10 am    Post subject: Filter node (Inder and Eddie) Reply with quote

Master

Joined: 08 Jul 2003
Posts: 205

Hi Inder and Eddie.

thanks for your suggestion.

Declare aa int;
set aa = Root.XML.(XML.tag)Invoice.Purchases."Item"[1].Quantity;
return aa<20;


aa = 10 (according to my program)

but doesn't go thru.
do you see any mistakes up there.

Venky.
Back to top
View user's profile Send private message
Craig B
PostPosted: Tue Sep 02, 2003 8:18 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

Hi,

When you say 'according to my program aa=10', then does this mean you have verified this with a user trace of the message flow? When you say that the message does not go through, does this mean it does not go through the terminal you expect, or does not go through the True terminal? Do you know what terminal the message does get propagated through? One possibility is that the message is not being represented in the XML domain (Ie you have not put XML in the Input node, or an MQRFH2 header overrides this in some way). This would result in the aa being NULL and therefore NULL < 20 would return unknown and your message would be propagated to the unknown terminal of the filter node.

At this point I would consider taking a user level trace of the flow to see what is being evaluated. Or put a trace node before the filter node and trace ${Root} is ensure the message is as your expect, or wire all the terminals on the filter node to separate outputs, so you can see which terminals your message is propagated through.

Hope this helps.
_________________
Regards
Craig
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Filter node and XML messages.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.