Author |
Message
|
Gideon |
Posted: Tue Nov 01, 2011 12:52 pm Post subject: Debugging and Trace node |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
FIRST ISSUE
I have a simple flow that does the following
Code: |
(out)
MQINPUT ---- Compute ---------- Trace Node ----- MQOUTPUT (Q nmaed OUT)
Node to /tmp/tmp/a.1
| (failure)
|--------------- Trace Node ----- MQOUTPUT (Q named ERR)
to /tmp/tmp/a.2 |
The Compute node contains the following code (this does not have a copy message header or copy message function, just a return TRUE)
Code: |
CREATE COMPUTE MODULE FLOWDZE1_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
RETURN TRUE;
END; |
When I sent 2 messages to this flow, the messages were written to the successful trace node
-
Code: |
rwxrwxrwx 1 root root 82850 Nov 1 15:45 a.1
-rwxrwxrwx 1 root root 0 Nov 1 15:36 a.2 |
And both messages were written to my output queue.
The message written to the trace file was my input message sent to the flow
Code: |
--- Trace Node -=-, ( ['xmlnsc' : 0x2aaae44ab660]
(0x01000400:NamespaceDecl): = (
(0x03000100:Attribute):Version = '1.0' (CHARACTER)
(0x03000100:Attribute):Encoding = 'UTF-8' (CHARACTER)
)
(0x01000000:Folder
.............. |
I thought I should not see this since I did not perform a copy message function in my compute node
Why did this happen
SECOND ISSUE
Since the message was coming through the Compute node even though I did not do a copy, I attempted to write to that message in order to pass a value to the TRACE node, so I put something like this in the Compute node:
Code: |
DECLARE xxx NAMESPACE 'http://xxx.com/xxx/xxx';
DECLARE ci NAMESPACE 'http://xxx.com/xxx/cxxx';
DECLARE fi NAMESPACE 'http://xxx.com/xxx/fxxx';
DECLARE i INT 1;
DECLARE j INT 1;
DECLARE x INT 1;
DECLARE y INT 1;
CALL CopyMessageHeaders();
-- Set up the XML declaration
CREATE FIRSTCHILD OF OutputRoot.XMLNSC TYPE XMLNSC.XmlDeclaration;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version = InputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = InputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding;
-- Copy the attributes of the root element so the namespaces will be set properly
SET OutputRoot.XMLNSC.xxx:port.(XMLNSC.Attribute)xmlns:xxx = 'http://xxx.com/xxx/xxx';
SET OutputRoot.XMLNSC.xxx:port.(XMLNSC.Attribute)xmlns:ci = 'http://xxx.com/xxx/cxxxInfo';
SET OutputRoot.XMLNSC.xxx:port.(XMLNSC.Attribute)xmlns:fi = 'http://xxx.com/xxx/fxxxInfo';
SET OutputRoot.XMLNSC.xxx:port.(XMLNSC.Attribute)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance';
-- Copy the body of the document
SET OutputRoot.XMLNSC.xxx:port.ci:owner.ci:name = 'Test'; |
However, the previous message was still copied to the trace node, and the 'test; value was not.
Why is this happening
What is the easiest way to send a short string to a trace node without copying the previous message. In other words, how do I copy the word 'test' to the trace node
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 01, 2011 1:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to check the attributes of the compute node. It will tell you what type of data it is passing to the output: message, localenvironment etc...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Gideon |
Posted: Wed Nov 02, 2011 9:42 am Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
using the following link as a guide:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac16870_.htm
I set the Compute Mode in the Compute node to
Code: |
Compute mode: Localenvironment |
Then I put the following in the ESQL:
Code: |
BEGIN
SET OutputLocalEnvironment.Variables.OutputLocation = 'MQ';
RETURN TRUE;
END; |
Then I set the Trace node pattern to :
Code: |
Pattern: --- Trace Node -=-, ${Root}. |
Then I send a message to the flow, I get the following in the trace file:
Code: |
--- Trace Node -=-, ( ['MQROOT' : 0x14b035e0]
(0x01000000:Name ):Properties = ( ['MQPROPERTYPARSER' : 0x14efa570]
(0x03000000:NameValue):MessageSet = 'ZPORT2' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 273 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 1208 (INTEGER)
(0x03000000:NameValue):Transactional = FALSE (BOOLEAN)
(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)
(0x03000000:NameValue):CreationTime = GMTTIMESTAMP '2011-11-02 17:30:14.260' (GMTTIMESTAMP)
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 4 (INTEGER)
............... |
Basically it outputs the headers and the Body iof the incoming message, but I never get the variable I set in the Compute node.
Dooly enough I get the same output if I set the compute node to:
Code: |
Compute mode: Localenvironment |
or to
What should I do, and is there a better link I can learn from?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 02, 2011 10:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
$Root in your trace will only give you what you are asking for...
The value you set in OutputLocalEnvironment is not part of $Root.
Did you try and have it also output $LocalEnvironment?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Gideon |
Posted: Wed Nov 02, 2011 10:42 am Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 02, 2011 11:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Did you run a user trace?
What does the user trace say?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Gideon |
Posted: Wed Nov 02, 2011 1:44 pm Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
Thanks, that was useful.
I never did a User Trace before, very useful procedure.
Basically I saw lots of commands that were previously in my flow ESQL, but have since been deleted, like:
Originally I had a flow, which I deleted the contents of the ESQL, and replaced it with a simple Localenvironment setting.
I double checked, and there is no ESQL existing with the command I saw in the user trace. Bascailly I am seeing the outputted message that is sent from my previous ESQL, not the new ESQL I put into the flow
Why would this happen, and what can I do to repair this?
Is there a way other than to write a new flow or to replace the Compute node with another
Why does this happen
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 02, 2011 1:53 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Did you redeploy your flow after editing your ESQL?
Did you rebuild your BAR file before redeploying your flow after editing your ESQL? |
|
Back to top |
|
 |
Gideon |
Posted: Wed Nov 02, 2011 2:19 pm Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
yes I redeployed, and yes I rebuilt the BAR file.
That is evidenced by the Trace Node being operational and outputting a file (not the user trace, just the trace node file)
So my flow is executing my current and only trace node, but a previous ESQL that is no longer contained in the flow |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 02, 2011 8:11 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Before rebuilding your bar flow, check that your toolkit settings are on automatic recompile, if not you have to recompile your flow before building the bar file. If you do not recompile before building the bar file, (either automatic or manual), all you are doing is building a bar file with an obsolete version of the flow...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Gideon |
Posted: Thu Nov 03, 2011 6:51 am Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
Yep, the Projects->Build Automatically was not set
I set it and saved the file. Everything is working now.
I can get the following output from my Trace Node
Code: |
--- Local Env:( ['MQROOT' : 0x14d4c7c0]
(0x01000000:Name):Variables = (
(0x03000000:NameValue):OutputLocation = 'MQ' (CHARACTER)
) |
All is well. thanks for your help |
|
Back to top |
|
 |
|