This sample consists of a Studio project containing a single application file (DebuggerBreakpoints.sbapp) intended to illustrate a few basic features of EventFlow breakpoints.
The application is a very simple EvenFlow with two branches. Tuple flow depends on the value of the branch field you provide for input tuples in the Test/Debug perspective. Sending "top" will route that tuple into the OutBranchTop output stream. Any other value for branch sends tuples to the OutBranchBottom stream.
Before you run the sample, you need to create some breakpoints at which to stop during execution. You can add a breakpoint to any arc by selecting it and then either by right-clicking and selecting Ctrl+Shift+B. When you add a breakpoint, a round dot appears on the arc to indicate it.
from the context menu or by typingFor more information on debugging in StreamBase Studio, see Using the EventFlow Debugger.
This topic describes DebuggerBreakpoints.sbapp
, the
debugging sample application.
-
To import the sample, click
→ and typedebugger
in the search box. -
Select
DebuggerBreakpoints.sbapp
and click . StreamBase Studio loads the sample into your workspace. -
In the Package Explorer, double-click to open the
DebuggerBreakpoints.sbapp
application. Make sure the application is the currently active tab in the EventFlow Editor. -
Place a breakpoint on the top arc between the Sequence and NoOp operators, as described above.
-
Place another breakpoint on the bottom arc between the Sequence2 and NoOp2 operators.
-
Make the bottom breakpoint conditional by following these steps:
-
Right-click the bottom breakpoint and select
from the context menu. -
Select
and type3
in the field next to it. -
Click
.
-
-
Click the
button. This opens the SB Test/Debug perspective and starts the application in debugging mode. -
In the Application Input view, enter
top
in the branch field, any string value in the payload field, and click .Execution suspends when the top breakpoint receives the tuple, highlighting the tuple's path in blue. Also, the Variables view opens, displaying the tuple's values and dynamic variable and query table values for you to inspect.
-
To continue execution, click the F8. The tuple flows to the Output stream OutBranchTop and highlighting is removed from the diagram.
button or press -
In the Application Input view again, replace
top
in the branch field with any other string, enter any string value in the payload field, and click .The debugger does not activate until you send data three times to the lower branch. Then the data path to the lower breakpoint highlights and the Variables view again displays data values.
Note
If you resume execution and continue to send tuples to the lower branch, its breakpoint does not activate again, because you configured it to respond to the third tuple only. However, the next time you debug the application, the breakpoint resets and once again halts execution at the third tuple.
-
When done, press F9 or click the Stop Running Application button.
When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.
Important
Load this sample in StreamBase Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.
Using the workspace copy of the sample avoids the permission problems that can occur when trying to work with the initially installed location of the sample. The default workspace location for this sample is:
studio-workspace
/sample_breakpoints
See Default Installation
Directories for the location of studio-workspace
on your system.
In the default TIBCO StreamBase installation, this sample's files are initially installed in:
streambase-install-dir
/sample/breakpoints
See Default Installation
Directories for the location of streambase-install-dir
on your system. This location
may require administrator privileges for write access, depending on your platform.