Debugger Breakpoints Sample

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 Toggle breakpoint from the context menu or by typing Ctrl+Shift+B. When you add a breakpoint, a round dot appears on the arc to indicate it.

For more information on debugging in StreamBase Studio, see Using the EventFlow Debugger.

This topic describes DebuggerBreakpoints.sbapp, the debugging sample application.

Running DebuggerBreakpoints.sbapp in StreamBase Studio

  1. To import the sample, click FileLoad StreamBase Sample and type debugger in the search box.

  2. Select DebuggerBreakpoints.sbapp and click OK. StreamBase Studio loads the sample into your workspace.

  3. 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.

  4. Place a breakpoint on the top arc between the Sequence and NoOp operators, as described above.

  5. Place another breakpoint on the bottom arc between the Sequence2 and NoOp2 operators.

  6. Make the bottom breakpoint conditional by following these steps:

    1. Right-click the bottom breakpoint and select Breakpoint Properties from the context menu.

    2. Select Hit count and type 3 in the field next to it.

    3. Click OK.

  7. Click the Debug button. This opens the SB Test/Debug perspective and starts the application in debugging mode.

  8. In the Application Input view, enter top in the branch field, any string value in the payload field, and click Send Data.

    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.

  9. To continue execution, click the Resume button or press F8. The tuple flows to the Output stream OutBranchTop and highlighting is removed from the diagram.

  10. 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 Send Data.

    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.

  11. When done, press F9 or click the Stop Running Application button.

Back to Top ^

Sample Location

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.

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 default location of studio-workspace on your system.