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 » simple ESQL

Post new topic  Reply to topic
 simple ESQL « View previous topic :: View next topic » 
Author Message
mq_crazy
PostPosted: Wed Feb 02, 2005 8:38 am    Post subject: simple ESQL Reply with quote

Master

Joined: 30 Jun 2004
Posts: 295

I am new to WBIMB and trying to learn. I just have a simple ESQL that i am trying to compare the firstname of the incoming message and if its true changin the name to a different one. I have MQinput,compute and Mqoutput node. Here is my ESQL, when i put test message it doesn't change the firstname, please tell me where i am wrong...

CREATE COMPUTE MODULE TEST_FLOW_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
CALL TEST();
RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot= InputRoot;
END;

CREATE PROCEDURE TEST() BEGIN
IF InputRoot.XML.Invoice.Firstname='rick' THEN
SET OutputRoot.XML.Invoice.Firstname='mick';

END IF;
END;




and here is the input test message

<Invoice><Firstname>rick</Firstname><Lastname>jen</Lastname><Contact>11111</contact></Invoice>
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Feb 02, 2005 9:49 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
CALL CopyMessageHeaders();
CALL CopyEntireMessage();

You should only use one of these, depending on what you do in the rest of the EQSL.

What is the default Domain set in the Input Node. It should be "XML".

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
mq_crazy
PostPosted: Wed Feb 02, 2005 10:06 am    Post subject: Reply with quote

Master

Joined: 30 Jun 2004
Posts: 295

Thanks a lot for your reply. I changed the input to XML and it works. What abt i want to change one field and copy all the other fields exactly to the output
Back to top
View user's profile Send private message
JT
PostPosted: Wed Feb 02, 2005 11:05 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Quote:
Quote:
CALL CopyMessageHeaders();
CALL CopyEntireMessage();

Then, use the latter procedure.
Back to top
View user's profile Send private message
mq_crazy
PostPosted: Wed Feb 02, 2005 11:14 am    Post subject: Reply with quote

Master

Joined: 30 Jun 2004
Posts: 295

I changed as you said and now the message is not even going through the input node. Here is the new ESQL

CREATE COMPUTE MODULE TEST_FLOW_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
CALL TEST();
RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot= InputRoot;
END;

CREATE PROCEDURE TEST() BEGIN
SET OutputRoot.XML.Invoice.Firstname=UPPER(InputRoot.XML.Invoice.Firstname);
END;

END MODULE;


and the input message:


<Invoice><Firstname>rick</Firstname><Lastname>jen</Lastname><Contact>11111</contact></Invoice>
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Feb 02, 2005 11:20 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Again, use EITHER CopyEntireMessage OR CopyMessageHeaders BUT NOT both.

Also, how do you know that it is not getting past the input node?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mq_crazy
PostPosted: Wed Feb 02, 2005 11:28 am    Post subject: Reply with quote

Master

Joined: 30 Jun 2004
Posts: 295

Thanks for the reply. I used only copyentiremessages function, but still it doesn't go through. I can check by looking at the input queue depth. Here is the new updated ESQL again..

CREATE COMPUTE MODULE TEST_FLOW_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
--CALL CopyMessageHeaders();
CALL CopyEntireMessage();
CALL TEST();
RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot= InputRoot;
END;

CREATE PROCEDURE TEST() BEGIN
SET OutputRoot.XML.Invoice.Firstname=UPPER(InputRoot.XML.Invoice.Firstname);
END;

END MODULE;
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Feb 02, 2005 11:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Okay, so you can tell that the message is not leaving the input queue.

Look at your system log, it should show you a message that tells you why it is not leaving the input queue.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mq_crazy
PostPosted: Wed Feb 02, 2005 12:04 pm    Post subject: Reply with quote

Master

Joined: 30 Jun 2004
Posts: 295

I got it. It was my mistake, i checked the log and there it said it was problem with one of the tags in the XML message that i typed wrong. Anyway thanks everyone for all the replies....
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 » simple ESQL
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.