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 » Can multiple message trees be outputed?

Post new topic  Reply to topic
 Can multiple message trees be outputed? « View previous topic :: View next topic » 
Author Message
bmccarty
PostPosted: Wed May 01, 2002 2:53 pm    Post subject: Reply with quote

Apprentice

Joined: 18 Dec 2001
Posts: 43

Hi,

For every message flow there can be only one input message tree, but can that message be split into multiple messages for output? Specifically I am looking to extract so rows from a database with a compute node and then based on the results, create multpile output messages from the results. Outside of WMQI this is a simple question, but the customer like to house the functionality inside of WMQI because of what they have done thus far without using outside code.

Using WMQI 2.1 CSD02

Thanks for the help!

B
Back to top
View user's profile Send private message AIM Address MSN Messenger
kirani
PostPosted: Wed May 01, 2002 4:09 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Yes, this is very much possible in WMQI. You can make use of PROPAGATE function in ESQL.


_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
bmccarty
PostPosted: Thu May 02, 2002 2:54 pm    Post subject: Reply with quote

Apprentice

Joined: 18 Dec 2001
Posts: 43

I think that I got it. Here is the ESQL that I used as a sample. It uses the SAMPLE database shipped with DB2 if you want to try it out.

SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
DECLARE i INTEGER;
SET i = 1;
SET InputDestinationList.XML.TempData."DeptName"[] = (SELECT ITEM T.DEPTNAME FROM Database.DB2ADMIN.DEPARTMENT AS T);
WHILE i <= CARDINALITY(InputDestinationList.XML.TempData."DeptName"[]) DO
SET OutputRoot = InputRoot;
SET OutputRoot.XML = NULL;
SET OutputRoot.XML.Department."DeptName" = InputDestinationList.XML.TempData."DeptName"[i];
PROPAGATE;
SET i = i+1;
END WHILE;
RETURN FALSE;

These seems to work fine, but if you have any suggestions for enhancement, please pass them along.

Thanks for the help.

B
Back to top
View user's profile Send private message AIM Address MSN Messenger
kirani
PostPosted: Thu May 02, 2002 3:30 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I would like to suggest a very small change here. This may not affect you right now, but when you are dealing with large messages it will affect your performance.

Don't use CARDINALITY in a loop. Instead use it like this ...
...
DECLARE CNT INTEGER;
SET CNT = CARDINALITY(InputDestinationList.XML.TempData."DeptName"[]);
WHILE (i <= CNT) DO
....

END WHILE;
RETURN FALSE;



_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
bmccarty
PostPosted: Fri May 03, 2002 7:25 am    Post subject: Reply with quote

Apprentice

Joined: 18 Dec 2001
Posts: 43

Thanks for the help!
Back to top
View user's profile Send private message AIM Address MSN Messenger
CodeCraft
PostPosted: Sun May 05, 2002 9:18 am    Post subject: Reply with quote

Disciple

Joined: 05 Sep 2001
Posts: 195

And, the reason it affects performance is, everytime you use it, the function goes off and does a count of whatever it is you asked for. Since the tree may be different in every iteration, it's poor for performance, but can also give unpredictable (if you're not thinking) results.
Back to top
View user's profile Send private message
CodeCraft
PostPosted: Mon May 06, 2002 1:28 am    Post subject: Reply with quote

Disciple

Joined: 05 Sep 2001
Posts: 195

P.S. This can also be done in 2.0x, but is more tricky!
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 » Can multiple message trees be outputed?
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.