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 » Propagate Question

Post new topic  Reply to topic
 Propagate Question « View previous topic :: View next topic » 
Author Message
Chuck831
PostPosted: Fri Mar 25, 2005 11:46 am    Post subject: Propagate Question Reply with quote

Apprentice

Joined: 23 Dec 2002
Posts: 28

Hi,

Could someone point me in the right direction. My message flow is as follows:

Filter --->Compute(1) ---> FlowOrder ---> Compute(2) ---> Output
| ---> Compute(3) ---> Output

Even though I have a RETURN FALSE in the Compute(1) node it still propagates when the ESQL terminates. If I have 2 job numbers in the environment I would expect to see 2 messages on each of the output queues. However, this ESQL is producing 3 messages on each of the output queues. (The FlowOrder is used to create 2 different message types on 2 different queues).

Here is the code for Compute(1):

Code:

CREATE COMPUTE MODULE CEM2_PropagateMessages
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
   
      Declare RecCnt Integer;
      
      Set RecCnt = 0;
      
      While RecCnt <= Cardinality(Environment.Variables.Result[]) Do
           
            Set RecCnt = RecCnt + 1;
            Set OutputRoot = InputRoot;      
         Set OutputRoot.XML.ChangeJob.DataArea.JobNumber  = Environment.Variables.Result[RecCnt].JOB_NO;

         PROPAGATE;

      End While;
   
       RETURN FALSE;
      
   END;

END MODULE;


Thanks.
Back to top
View user's profile Send private message
Chuck831
PostPosted: Fri Mar 25, 2005 1:13 pm    Post subject: Reply with quote

Apprentice

Joined: 23 Dec 2002
Posts: 28

I just worked this one out.

It was in the way that I was incrementing RecCnt. If you move
Code:
SET RecCnt = RecCnt + 1;
to after the PROPAGATE statement everything works correctly.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Mar 25, 2005 1:27 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It did look like an off-by-one error.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Ramphart
PostPosted: Mon Mar 28, 2005 11:15 pm    Post subject: Reply with quote

Disciple

Joined: 21 Jul 2004
Posts: 150
Location: South Africa, JHB

In general when you work with cardinality your RecCnt should really start from 1 and not 0 outside your loop. You dont want to enter the loop if cardinality = 0. Thats about it.
_________________
Applications Architect
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 » Propagate Question
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.