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 » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Splitting Repeating Rows into Individual Messages

Post new topic  Reply to topic
 Splitting Repeating Rows into Individual Messages « View previous topic :: View next topic » 
Author Message
albitkw
PostPosted: Thu Mar 18, 2010 7:21 am    Post subject: Splitting Repeating Rows into Individual Messages Reply with quote

Novice

Joined: 02 May 2005
Posts: 15
Location: Pittsburgh, PA

I have to create individual messages mapped from a source MRM message that can have one or more repeating rows. Each source row should produce an individual message that enters a mapping node in order to produce message flow output messages. I think this means the source message should enter a compute node that generates individual messages.

Basic source structure is:

<outtertag>
<row>
:
</row>

<row>
:
</row>
etc.
</outtertag>

I thought the following code would do, but it only produces messages with headers. Nothing from the MRM is copied to the individual messages.

I'm sure this looks simple to some of you. Any help would be greatly appreciated

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER;
DECLARE J INTEGER;
DECLARE K INTEGER;
DECLARE NumRows INTEGER;


SET J = CARDINALITY(InputRoot.*[]);
SET NumRows = CARDINALITY(InputRoot.MRM.outertag.row[]);
SET K = 1;
WHILE K <= NumRows DO -- Create Message for Each Row
SET I = 1;
WHILE I < J DO -- Copy all headers except MRM
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;

SET OutputRoot.MRM.outertag.row[K]
= InputRoot.MRM.outtertag.row[K];
IF K < NumRows - 1 THEN
PROPAGATE;
END IF;
SET K = K + 1;
END WHILE;
END;
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Mar 18, 2010 7:49 am    Post subject: Re: Splitting Repeating Rows into Individual Messages Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

albitkw wrote:
Any help would be greatly appreciated


Don't use CARDINALITY, it's much more efficient to use MOVE

Don't put your own code in the supplied copy functions

If you post code to the forum, put it in [code] tags to aid readability

Take a user trace to see what's actually happening inside your code. Then you'll see why you're getting nothing in the output.

WMB fault finding 101. The User Trace Is Your Friend
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Splitting Repeating Rows into Individual Messages
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.