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 » How to insert an MQRFH2 using create lastchild etc...

Post new topic  Reply to topic
 How to insert an MQRFH2 using create lastchild etc... « View previous topic :: View next topic » 
Author Message
jonesn
PostPosted: Mon Jan 23, 2006 8:36 am    Post subject: How to insert an MQRFH2 using create lastchild etc... Reply with quote

Apprentice

Joined: 09 Jan 2002
Posts: 47

Chaps,

I want to insert an RFH2 into a message and would like to use create lastchild to do it.

CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();

-- Remove MQRFH2 is there is one
set OutputRoot.MQRFH2 = null;

-- Set correct state.
set OutputRoot.MQRFH2.usr.state = 'state1';

-- Now add the body.
-- create lastchild of OutputRoot from InputBody; *
set OutputRoot.*[CARDINALITY(OutputRoot.*[])+1] = InputBody; -- **

RETURN TRUE;
END;

The line marked with ** does what I want but I would prefer to use the create lastchild line marked with *. A trace node following this compute node shows that the create works but it does not make it to the queue. Any suggestions?

Thanks
_________________
---

Nick Jones
IBM Certified Solutions Expert (WebSphere MQ Integrator)
Back to top
View user's profile Send private message
mgk
PostPosted: Mon Jan 23, 2006 12:26 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi Nick,

The CREATE with the FROM clause is for copying the details from a single syntax element, not copying a whole tree.

Seeing as you seem to want the whole of the input message, with the addition of a new RFH2 header, why don't you try something like this: (code not tested):

Code:
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
 
-- Copy all of the input msg, including the body
CALL CopyEntireMessage();

-- Remove an existing MQRFH2, if there is one
SET OutputRoot.MQRFH2 = NULL;

-- Create an MQRFH2 parser after the MQMD
CREATE NEXT SIBLING of OutputRoot.MQMD DOMAIN 'MQRFH2' NAME 'MQRFH2'

-- Set correct state.
set OutputRoot.MQRFH2.usr.state = 'state1';


RETURN TRUE;
END;




Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
jonesn
PostPosted: Tue Jan 24, 2006 9:30 am    Post subject: Reply with quote

Apprentice

Joined: 09 Jan 2002
Posts: 47

MGK,

Thanks for that, it is now working.
_________________
---

Nick Jones
IBM Certified Solutions Expert (WebSphere MQ Integrator)
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 » How to insert an MQRFH2 using create lastchild etc...
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.