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 » navigate tree and copy to Output

Post new topic  Reply to topic
 navigate tree and copy to Output « View previous topic :: View next topic » 
Author Message
knox123
PostPosted: Thu May 10, 2018 5:47 am    Post subject: navigate tree and copy to Output Reply with quote

Newbie

Joined: 10 May 2018
Posts: 2

Hi, I'm trying to copy a message tree by changing the namespace, to do this I use a recursive function that works, until I try to go to the next sibling of the father , when the OutputReference loose the syncrony and start creating child in bad places.

This is the code im using for:
Code:

CREATE PROCEDURE navigate (IN root REFERENCE, INOUT Output REFERENCE)
BEGIN
   
   DECLARE cursor REFERENCE TO root;
   DECLARE cursorOut REFERENCE TO Output;

   MOVE cursor FIRSTCHILD;
   IF LASTMOVE(cursor) THEN
      CREATE FIRSTCHILD OF cursorOut NAMESPACE nsT NAME FIELDNAME(cursor) VALUE FIELDVALUE(cursor);
   MOVE cursorOut FIRSTCHILD;
   ELSE
      MOVE cursor NEXTSIBLING;
      
      IF LASTMOVE(cursor) THEN
         CREATE NEXTSIBLING OF cursorOut NAMESPACE nsT NAME FIELDNAME(cursor) VALUE FIELDVALUE(cursor);
      END IF;
      MOVE cursorOut NEXTSIBLING;   
   END IF;

   WHILE LASTMOVE(cursor) DO
   
      CALL navigate(cursor, cursorOut);
      MOVE cursor NEXTSIBLING;
      MOVE cursorOut PARENT;
   END WHILE;
END;


Thanks!
Back to top
View user's profile Send private message
timber
PostPosted: Thu May 10, 2018 8:35 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Search this forum - there is some example code in another post for exactly this task.
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 » navigate tree and copy to Output
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.