Posted: Thu Mar 18, 2010 7:21 am Post subject: Splitting Repeating Rows into Individual Messages
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;
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