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;
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
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