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 » Conditional writing to a queue

Post new topic  Reply to topic
 Conditional writing to a queue « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Sat Mar 15, 2003 12:02 pm    Post subject: Conditional writing to a queue Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

HI!

I have a message flow that needs to transform some data, then always write it to queue A, create a new message for queue B (based on parts of the original message) but only write it to queue B if certain conditions are true. I have the output of my transformation node wired to queue A and to a compute node to format the new message for queue B. How would I code the compute node to not write to queue B if the conditions are met, but not throw an error? Also , my code is always writing the same message that goes to queue A and not my new created message.

Thanks for any help anyone can provide!!

Here is the code so far in my compute node to format the new message to go to queue B:

SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
If ((InputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[13] = 'Y') and
(InputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[12] > 0) and
(InputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[12] IS NOT NULL))
then
SET OutputRoot.XML.CreateJob = NULL;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.Sender;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.Sender.Component;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.Sender.Confirmation;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.Sender.AuthorizationId;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.CreationDateTime;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.BODId;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.DataArea;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.DataArea.REQ_TYPE;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.DataArea.REQ_CODE;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.DataArea.PREMISE_NO;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.DataArea.RECORD_DATA;
CREATE FIELD OutputRoot.XML.ATLAS_XY_QUERY.DataArea.RECORD_DATA.EXTERNAL_ONE;


SET OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.Sender.Component = 'MDS XY Query';
SET OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.Sender.AuthorizationId =
'ODL Create Job';
SET OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.CreationDateTime = CURRENT_TIMESTAMP;
SET OutputRoot.XML.ATLAS_XY_QUERY.ApplicationArea.BODId = UUIDASBLOB;
SET OutputRoot.XML.ATLAS_XY_QUERY.DataArea.REQ_TYPE = 'PREMISE';
SET OutputRoot.XML.ATLAS_XY_QUERY.DataArea.REQ_CODE = 'COORDINATES';
SET OutputRoot.XML.ATLAS_XY_QUERY.DataArea.PREMISE_NO =
InputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.UDF[13];
SET OutputRoot.XML.ATLAS_XY_QUERY.DataArea.RECORD_DATA.EXTERNAL_ONE =
InputRoot.XML.CreateJob.ApplicationArea.BODId;
End if;
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sat Mar 15, 2003 7:47 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

To exit a compute node without propogating anything to the output (and cause the flow to stop processing further, unless other paths are being processed), add "return false;" to your compute node in the appropriate place.
Back to top
View user's profile Send private message
lillo
PostPosted: Sun Mar 16, 2003 11:46 pm    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

LisaB,

It is quite simple. Wire your transformation node, located before the queue A node to a filter node and to queue A. In this filter node you can ask for the conditions to met. Now wire the true terminal to a compute node where you will build the message for queue B and wire the out terminal to queue B node.

Cheers
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
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 » Conditional writing to a queue
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.