Contents
This sample consists of a Studio project containing a single module file intended to illustrate a few basic features of EventFlow Debugger breakpoints.
The application is a simple design 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
routes that tuple into the OutBranchTop output stream. Any other value for branch
sends tuples to the OutBranchBottom stream.
Before you run the sample, you must 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.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, click
> . -
Enter
break
to narrow the list of options -
Select Setting breakpoints from the Client Libraries category.
-
Click
.
StreamBase Studio creates a project for the sample.
-
In the Project Explorer view, open the sample you just loaded.
If you see red marks on a project folder, wait a moment for the project to load its features.
If the red marks do not resolve themselves after a minute, select the project, right-click, and select
> from the context menu. -
Open the
src/main/eventflow/
folder.packageName
-
Double-click to open
DebuggerBreakpoints.sbapp
. -
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 module in debugging mode. -
In the Input Streams 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 Input Streams 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 Terminate EventFlow Fragment 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 permission problems. The default workspace location for this sample is:
studio-workspace
/sample_breakpoints
See Default Installation
Directories for the default location of studio-workspace
on your system.