|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to insert an MQRFH2 using create lastchild etc... |
« View previous topic :: View next topic » |
Author |
Message
|
jonesn |
Posted: Mon Jan 23, 2006 8:36 am Post subject: How to insert an MQRFH2 using create lastchild etc... |
|
|
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 |
|
 |
mgk |
Posted: Mon Jan 23, 2006 12:26 pm Post subject: |
|
|
 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 |
|
 |
jonesn |
Posted: Tue Jan 24, 2006 9:30 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|