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 » route using filter node

Post new topic  Reply to topic
 route using filter node « View previous topic :: View next topic » 
Author Message
kt76
PostPosted: Mon Jan 19, 2004 10:57 pm    Post subject: route using filter node Reply with quote

Acolyte

Joined: 18 Jan 2004
Posts: 52

Hi,

Our requirement is that depending on a field value we route to diff flows.
Our xml looks something like this:
<root>
<aaa xxx="3" type="string"></aaa>
</root>

<aaa> is a user defined type. Though it takes string values, the message set created through the dtd makes it of anonymous type in message broker.

If <aaa xxx="3" type="string"></aaa> then goto flow1 (out terminal True)
and if <aaa xxx="3" type="string">some value</aaa> goto flow2( out terminal false)

We are trying using Filter nodes.
The ESQL code snippent we wrote is:

IF Body.aaa IS NULL THEN
RETURN TRUE;
ELSE
RETURN FALSE;

It either always goes to the True out terminal.
Could you help us with our case.
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Tue Jan 20, 2004 1:07 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

Are you sure you are qualifying the field correctly? For the example you give should it be Body.root.aaa?

Send te message to a trace node, tracing {$Root} to check that the structure matches what you think it is.

Cheers,
Vicky
Back to top
View user's profile Send private message
kt76
PostPosted: Tue Jan 20, 2004 4:10 am    Post subject: getting value of a tag of complex type Reply with quote

Acolyte

Joined: 18 Jan 2004
Posts: 52

Our xml looks like:
<aaa att1="3" att2="string">
</aaa>

The dtd generated for this, creates a MesgDefFile with a mesg containing elements of complex type ="Anonymous".

like
aaa = Anonymous(complex type)
|--- att1 =local attribute
|--- att2 =local attribute

How do we extract the value of <aaa> using the compute node.

All are computation is failing b'coz we are unable to extract the value,
Back to top
View user's profile Send private message
wooda
PostPosted: Tue Jan 20, 2004 4:27 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Are you using MRM or XML domain? You mention message sets so I assume it's the MRM domain.

If it's the MRM domain then Body.aaa is correct.
Also what is interpreted as null depends on the settings in the XML wire format level of the message set.
A missing element will always be considered NULL and with default settings in the message set empty tags will also be considered NULL.

IF it's XML domain then Body.root.aaa should be used. (as vcmgloin said.)
In the XML domain the only way "IF Body.aaa IS NULL ..." will resolve to TRUE is if the field is missing. XML domain has no concept of explicit NULLs. So <aaa></aaa> will never resolve to NULL if it's been parsed correctly and is present in the message.

However the fact that <aaa>data</aaa> also resolves to NULL tells us that the field is not being found by the ESQL. ie. It's missing. Why is it missing? Possibly because you havn't referenced it correctly and possibly because it isn't parsed (make sure the message is input in the correct domain etc.)


By the way if you want to test for <aaa></aaa> in the XML domain you will have to match the value of the field to an empty string.

And if you want to make sure in either XML or MRM domain that a field is NULL and not missing completly then use something like;

IF (CARDINALITY(Body.aaa[]) >= 1 AND InputRoot.XML.message.field1 IS NULL) THEN ....

ie. The field is present but NULL.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 20, 2004 6:37 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Also, if you find yourself nesting more than about two Filter Nodes, like
Filter--true-->Filter
--false-->Filter

Then you're better off switching to a RouteToLabel/Label structure - both from a performance and a maintainability standpoint.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wooda
PostPosted: Tue Jan 20, 2004 6:48 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Hope the mistake in my example ESQL didn't coinfuse too much.

Should have read;

IF (CARDINALITY(Body.aaa[]) >= 1 AND Body.aaa IS NULL) THEN ....

ie. We are testing that the field aaa is both present and NULL.
Back to top
View user's profile Send private message
kt76
PostPosted: Tue Jan 20, 2004 7:20 am    Post subject: Reply with quote

Acolyte

Joined: 18 Jan 2004
Posts: 52

The ESQL you gave still does the same. It always goes to Return True...
Back to top
View user's profile Send private message
Missam
PostPosted: Tue Jan 20, 2004 11:27 am    Post subject: Reply with quote

Chevalier

Joined: 16 Oct 2003
Posts: 424

Just Use
IF CARDINALITY(Body.aaa[]) >= 1
Then it'll work fine
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 » route using filter node
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.