FLOW DEBUGGING

METHODOLOGY
Key People:
Architect:
Date: 21
st
December 2005
Author Details:
Prepared by:
Email:
Phone no:
Document Details:
Version: Message Broker6.0
Date: Wednesday,December 21st,2005
M MM M Ì R A C L E Ì R A C L E Ì R A C L E Ì R A C L E S SS S O F T W A R E O F T W A R E O F T W A R E O F T W A R E S SS S Y S T E M S Y S T E M S Y S T E M S Y S T E M S , Ì , Ì , Ì , Ì N C N C N C N C . .. .
Miracle Software Systems Ìnc.
TabIe of Contents
1. Introduction: ---------------------------------------------------------------------- 3
2. Purpose: ---------------------------------------------- Error! Bookmark not defined.
2.1. Purpose of this documentation: ------------------- Error! Bookmark not defined.
2.2. Flow Debugger and Debug Perspective:------------------------------------------ 3
2.3. Message Flow: --------------------------------------------------------------------- 4
2.4. Esql code:-------------------------------------------------------------------------- 4
3. Screens:---------------------------------------------------------------------------- 5
Miracle Software Systems Ìnc.
1. Introduction:
IBM solutions for Integration requirements
WebSphere MQ has more customers than all its competitors combined (over
three-quarters market share), runs on more platforms than Java, and has more
connectors and language interfaces than any other software platform. It fully
supports the latest version of JMS (JMS 1.1) but also supports other interfaces
such as C, C++, COBOL, PERL, Visual Basic, .Net and many more. Furthermore,
MQ has proven itself to be extremely robust in many thousands of customer
installations, supplying assured, once-only delivery.
WebSphere Business Integration Message Broker is the latest version of
IBM marketing leading message broker family, previously called MQSI and
WebSphere MQ Integrator. Message Broker adds high performance pub/sub
message distribution, message routing and transformation, database integration,
multiple protocol support, Web Services Brokering and many other capabilities to
WebSphere MQ. WBI Event Broker is also offered as a subset of Message Broker
for those customer locations that only need pub/sub message distribution and
multiple protocol support. IBM´s message brokers have been proven in many
successful customer installations with an install base now exceeding 2000
customers.
2. Purpose:
2.1 Purpose of this documentation
The purpose of this document is to define and describe the process of
debugging through a simple message flow. The exercise uses a project named
Debug_Project containing Debug_Flow.msgflow and Debug_Flow.esql
2.2 Flow Debugger and Debug Perspective
Flow Debugger: The flow debugger is the tool that we use in the workbench to
visually debug message flows.
Debug perspective: This is where we test and debug a graphical representation
of our message flows using the message flow debugger.
Debug perspective views:
The Debug perspective contains the following views:
1.Debug view:
Displays the deployed message flow types for a selected host and help to
manage flow debugging. Toolbar buttons are provided for controlling the
execution of the flow. We can start, stop, and resume a flow, step into, and
out of a subflow, and step into the source code.
2.Breakpoints view:
Lists the breakpoints that have been set on connections in our message
flow.In this view we can add, disable, enable or remove breakpoints. We can
also restrict a breakpoint to one or more specific instances of a message flow
using the Properties view.
3.Variables view:
When a message flow is interrupted by a breakpoint, we can view the
message content to check whether the message flow is executing as
expected, and to make any changes required.
Miracle Software Systems Ìnc.
4.Message Flow editor view:
Here we can add breakpoints to the connections of a message flow that is
open in the Message Flow editor.
2.3 Message Flow
2.4 Esql code
This is Ior Compute node (DebugTransIorm)
CREATE COMPUTE MODULE Debug_Flow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
SET OutputRoot.XML.emp.sal = 10000;
SET Environment.dept = InputRoot.XML.emp.dept;
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER;
DECLARE J INTEGER;
SET I = 1;
SET J = 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;
END MODULE;
This is for Filter node(IF dept=development)
CREATE FILTER MODULE Debug_Flow_Filter
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
IF Environment.dept = 'development' THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;
END MODULE;
Miracle Software Systems Ìnc.
3.screens:
Documentation:
In the application development perspective Open the Debug_Flow message flow.
Setting Break Points For message flow
To add the break points for the message flow right click on the connection between
the Out terminal of the Debug_In node and the In terminal of the Debug_Transform
node. From the drop down select Add Breakpoint.
The break point should then be shown on this connection
In the same way add the break points on the connections to each of the nodes.
Finally the message flow should be like this.
Setting Break Points For ESQL
To add a break point in the ESQL right click on the grey margin left of the "CALL
CopyMessageHeaders();¨ line. From the drop down menu that appears select Add
Breakpoint(Some times this is appeared as Add/Remove Breakpoint) Or we can add
break points by double clicking the left mouse button at grey margin of the line.
Miracle Software Systems Ìnc.
The ESQL break point should then appear for this line.
In the same way add the break points to the remaining lines of code. Finally the Esql code
should be like this.
Miracle Software Systems Ìnc.
Now add this project to the broker archive file and deploy.
Miracle Software Systems Ìnc.
Connecting to the Flow debugger
Connecting to the Flow Debugger requires the debug perspective. Click on `open a
perspective´ tab.Select Other.
From the Select Perspective dialog choose Debug and click OK.
Now debug perspective is opened.In the Debug perspective from the Run menu
select Debug.
Miracle Software Systems Ìnc.
Select Message Broker Debug then click on the New button.
Miracle Software Systems Ìnc.
Fill in the details for this configuration.Enter Flow_Debugger for the name.
Select Browse to add the message flow to the debugger.In that select our
project(Debug_Project).Click Ok.
Miracle Software Systems Ìnc.
Select Browse this time to use the content assist for the Flow Engine to be
debugged. Select the broker and click ok.
Click Apply to save this configuration and then debug to start the debug session.
Now it´s ready to debug the flow.
Miracle Software Systems Ìnc.
Put the XML message in the In Queue.
Input Message
<emp><empname>srinu</empname><empid>000123</empid><dept>developme
nt</dept></emp>
Click Ok.
Return to the Message Broker Toolkit. The Debug view shows the message flow
Debug_Flow as paused. The Variables view now shows Messages, Local Environment,
Environment and the Exception List. The Message flow is displayed in the lower half
of the screen with the break point that has paused the flow highlighted.
Miracle Software Systems Ìnc.
Expand the Message it shows the content of our input message.
Click Step Over.
The lower half of the screen now changes to the ESQL view showing the flow paused
on the "CALL CopyMessageHeaders();¨ line.
Miracle Software Systems Ìnc.
Click Step Over.
Observe the changes of OutputRoot in the variables view.The input message
content,Properties of the message(if any)and headers(MQMD) are added to the
OutputRoot.
Click Step Over again.
Now the extra element(sal) is added to the OutputRoot.
Miracle Software Systems Ìnc.
Click Step Over again.Now in the DebugMessage,Environment tab development is set
to the dept and in Message,XML tab sal is added.At the same time observe the
changes in the esql at the bottom of the window.
Click Step Over again. Observe that this takes the view back to the message flow
and breaks just beyond the"IF dept = development¨ Filter node
Click Step Over again.Here it checks in the esql for to which output node it have to
route the message.
Here it is development so it RETURNS TRUE. That means it routes the message to the
Debug_Out1 node.
Click Step Over again.
Miracle Software Systems Ìnc.
Complete the flow by pressing the "Click Step Over " or "Resume¨ or "Run to
Completion¨ buttons.
Open the RFHUTIL for read the text message from the output queue(Out1).
In the Main tab select the WBRK6_DEFAULT_QUEUE_MANAGER in the Queue
Manager Name and select Out1 in the Queue Name.Click on Read Q button.
Go to Data tab to see the output message
Miracle Software Systems Ìnc.
To Trace an exception
If there is any errors in the input message like instead of emp we gave Emp then it
shown an exception like this.
<emp><empname>srinu</empname><empid>000123</empid><dept>developme
nt</dept></Emp>
Click on step over.This time the message flow view shows that an exception has
been caught by the MQ Input node(Debug_In). The exception is identified by an
exclamation mark below.
This exception is due to an error in the input XML message. Expand the Exception
List for details of this exception. Keep expanding the lowest element of the
ExceptionList to eventually reveal the text sent in the user exception.
Miracle Software Systems Ìnc.
In this way we can trace error in the Exception List.

$% )% # & ! # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ( '''''''''''''''''''''''''''''''''''''''''''''' $ $ % % !" !+ !. . (% +! & % & & & ''''''''''''''''''' * !! ( ) # '''''''''''''''''''''''''''''''''''''''''' ( ( ) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' * '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' * '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' .

% ) & % ) = ) % ) & = * = " : & ! 6 % )1 & + : & & * ) & % % ) & % % ) & % ) * ) * )) * ) * ) % ) = & ) . # / " # . * 0 * %) & & 2 * & % & & 2 * 1 * & 1 < ) % %% & . & * ) : & % & * ! % (& % & * % 921 & . & ! " # % & & # % % ) = : & ?( ) % ) ! 4 ) & ) % ) % % ) & & * & * % % ) % ) -& : * ) & % ) & ) % * & % % ) * ) & ) % & & ?( ) > - )%) * & % & #& 0 .$% # & ! # # # 1 . %& & & & * 3 344 35 56 * % & # 91 & 9 # & / & % % % 0 2 .0 2 " "/ & 76 & %8 : & & ' * . & 1 %& % 0+ '-& & & 9 0+ 1 2 & 2 % & & & )% )%$ = & & & ? 3 & > 0 .. # % .

.$% ! " $ %% '( ' ''% ) & ) *++++& '( ' '& '123 & '12 3& 4.. $ & & & & & ') 9. ) ( ) * ) % ( ) % ) 3 )%* / ! & ! ! " # . . @ )%( . & # ) & & 7 % % 8 $ $ ). $ ! ! " . 9 . $ %% & ! " & # " " %% & & 0 '12 3 ) 6 *& . $ & & / ) *& / ) 5 / ) 4.. .

2 & .(% ! # # * #./BC . 2 # % " . 2 # +1 296 ( % & % ) . * 5 3 % ) & ?1 ) 1 % & ?= ) % & ?( ) % ) ! " # 1 + = 5& ( % = & ) 1 ( ) % ) & % + = 3 #.7 & & * /5 ) % % A3 66 @ .

= 296 & % 1 & ) % ( - .

8 ) > * % .

3 * < 2 ( ) 3 & 0 .. & 5 -& & * 3 D ( 2 * & 5E 8 ) & & * 1 & * % 7& & .5 ## ! #.

2 & 8 ) & .

( % % & ( )? & % 2 > . ) & ? > /3 5 % ) & 1 & .

2 & ) 2 & % ( ) 3 * % & & & 8 ) < & % ) .

HG. G HG G. HG H * 7 & & ?( ) * % ) = & : = 6 = = * ) & * ) ) ) ) % ) & % ) 6 % ) * ) % .& F 6 # . HG H "!+G. 3 5 1 9& & H H &G.

: ) % & & 3 2 5* = ) % % A3 66 3 ) @ ./BC 296 * ) ) % ) & .

% / * * )= .3 5 5& 2 * & 7 5* % 5& % & 7 . / 5& & 7 . 9 & / 3 2 8 ) 5* : .

% ) & & * @ 3 & ?5& " 2 5* * 7 =J782 =7J = & .3 2 5* - 8 ) F 6 % & ) ) * * * 3 2 5* >& 5 * A1( I * * ) C( % ) 3 & 2 5* @ .

3 3 5 1 % ) C & 7(@J=16 % 8 A3 : 7E ? 5& " 2 5* A A7 & C A7& % ( J6=?9J J ? 9& & 8 3 & & -& & .5& "/ 8 K 7 9& & 7 9 & K & & .

H "!+G. % )* ) & ?1 / = = 6 : : % 6 % & * : & E * : : & F 6 ) & : : % : . 91 ) & HG HG. 3 & : # : 6! H H * = # & % HG . ) : ) HG : % * H * &G.! 1% ) G G.

1 ) ) : 6 .

Sign up to vote on this title
UsefulNot useful