How to: |
This tutorial demonstrates basic operation in unit testing mode, illustrating breakpoints, single stepping, setting the input document, and modifying registers.
Note: Though not illustrated in the tutorials, it is possible to abbreviate commands, tokens, and switches up to an unambiguous prefix. For example, the letter b is sufficient for the breakpoint command. A node name can also be abbreviated. It will be resolved among the nodes of the flow.
For this tutorial, the process flow called testflow has already been deployed to channel file1. It stores the name of the root element in the special register reg1 and tests whether reg1 has the value default.
Enter Command:> tool Debugger
The debugger starts and responds with the debug> prompt, with the following default message:
Command line process flow debugger Type help for more information debug>
The following image illustrates the process flow that is being referenced by this tutorial.
debug> set source file1:testflow Current source changed to file1:testflow
debug> list Node Start in source file1:testflow OnCompletion -> SetReg1 OnSuccess -> 'Is Default?' true -> Default OnSuccess -> End false -> NotDefault OnSuccess -> End
The output has one line per node, beginning with the Start node. The outgoing edges are listed underneath, indented one level to the right. The format is edgename -> nodename.
For example, the second line says there is an OnCompletion edge from the Start node to the SetReg1 node. In the subsequent lines, the Is Default? node has two out edges, true and false because they appear at the same indentation level.
You can use the list command to find out the exact names of the nodes.
debug> breakpoint 'Is Default?' breakpoint created b1: breakpoint -source file1:testflow 'Is Default?' -inedge
debug> run Thread t1: W.debugger.1~file1:testflow started Thread t1: W.debugger.1~file1:testflow suspended by breakpoint at inedge of 'Is Default?'
The execution stops at the breakpoint.
debug> show registers Registers in pflow scope and above ibse-port = [CFG] '9000' iway.channel = [SYS] 'debugger' iway.config = [SYS] 'myapp' iway.flowname = [DOC] 'W.debugger.1~file1:testflow' iway.lastnode = [SYS] 'SetReg1' iway.pid = [SYS] '12748' iway.serverfullhost = [SYS] 'portable.ibi.com' iway.serverhost = [SYS] 'portable' iway.serverip = [SYS] '192.168.2.12' iway.startup.time = [SYS] '1401722478791' iway.workdir = [SYS] 'c:/iway/config/myapp' iwayconfig = [SYS] 'myapp' iwaydata = [SYS] 'c:/iway/' iwayhome = [SYS] 'c:/iway/' iwayversion = [SYS] '7.0.2' iwayworkdir = [SYS] 'c:/iway/config/myapp' name = [SYS] 'debugger' protocol = [SYS] 'Lcl' reg1 = [USR] 'default' tid = [DOC] 'b489cc73-ecf5-43b5-8cc5-9faab83cd972'
debug> step Thread t1: W.debugger.1~file1:testflow suspended at inedge of Default
The reg1 register contains the value default, therefore the execution steps to the Default node.
debug> resume Thread t1: W.debugger.1~file1:testflow resumed Thread t1: W.debugger.1~file1:testflow terminated normally with 1 document
The flow reaches the End node and terminates.
debug> show document Document 0 from End <default/>
debug> run Thread t2: W.debugger.2~file1:testflow started Thread t2: W.debugger.2~file1:testflow suspended by breakpoint at inedge of 'Is Default?'
debug> set register reg1 elem
debug> step Thread t2: W.debugger.2~file1:testflow suspended at inedge of NotDefault
This time, the execution reaches the NotDefault node, since the register value is not default.
debug> resume Thread t2: W.debugger.2~file1:testflow resumed Thread t2: W.debugger.2~file1:testflow terminated normally with 1 document
debug> delete b1 deleted b1: breakpoint -source file1:testflow 'Is Default?' - inedge
debug> breakpoint Default Breakpoint created b2: breakpoint -source file1:testflow Default -inedge
debug> breakpoint NotDefault Breakpoint created b3: breakpoint -source file1:testflow NotDefault -inedge
debug> show breakpoints b2: breakpoint -source file1:testflow Default -inedge b3: breakpoint -source file1:testflow NotDefault -inedge
debug> run -xml <test/> Thread t3: W.debugger.3~file1:testflow started Thread t3: W.debugger.3~file1:testflow suspended by breakpoint at inedge of NotDefault
The execution reaches the NotDefault node, since the reg1 register does not have the value default.
debug> show register reg1 reg1 = [USR] 'test'
debug> resume Thread t3: W.debugger.3~file1:testflow resumed Thread t3: W.debugger.3~file1:testflow terminated normally with 1 document
debug> breakpoint 'Is Default?' -outedge breakpoint created b4: breakpoint -source file1:testflow 'Is Default?' -outedge
debug> rerun Thread t4: W.debugger.4~file1:testflow started Thread t4: W.debugger.4~file1:testflow suspended by breakpoint at outedge of 'Is Default?'
The execution stops after the 'Is Default?' node is processed but before the edges are dispatched.
debug> show edges Returned edge: false
debug> set edges true debug> step Thread t4: W.debugger.4~file1:testflow suspended by breakpoint at inedge of Default
The execution reaches the Default node because the edge was changed to true.
debug> end Tool Debugger complete
iWay Software |