EventFlow Editor

This topic describes how to use the EventFlow Editor, which you can use to design an EventFlow application. By default, the EventFlow Editor is located in the center of StreamBase Studio's SB Authoring perspective, and in the upper right corner of the SB Test/Debug perspective.

Default settings for the EventFlow Editor are shown in the Authoring page of the Preferences window. To view or change preferences there, select WindowPreferences from the main menu. Options are described in StreamBase Studio Preferences.

To open an application into the EventFlow Editor, double-click an application file with sbapp extension in a project folder in the Package Explorer. To create a new EventFlow application file, use FileNewEventFlow Application.

The EventFlow Editor has five tabs, described in the following sections of this topic:

Editor Tab

The Editor tab contains the main editing canvas for EventFlow applications, on which you can graphically assemble the components of your application. The figure below shows an EventFlow Editor session with the input stream selected.

On the canvas, you can:

  • Click a component to display and configure its properties. (The currently selected component appears with blue dots around it.)

  • Draw arcs connecting components to one another and to associate operators with data constructs. See Using Arcs for more information.

  • Move components to create an easier to follow arrangement.

The EventFlow Editor has several specialized features that you can use to help you edit applications. Use the links in the following list of features to see the subsection that describes each feature:

Back to Top ^

Properties View For Each Component

Each component in the Editor tab has an associated Properties view, where you can view and define the properties of the selected component. See Properties View for more on using the Properties view.

EventFlow Editor Commands

This section describes specialized commands that you can use while working in the EventFlow Editor canvas. The availability of each command depends on your selection, focus, or mouse position within the canvas. Many of these commands are available in multiple places: a StreamBase Studio menu, in the right-click context menu, or a toolbar button. The following table is in alphabetical order by command name.

Command Description Context menu StreamBase Studio menu Toolbar button[a]
Add Note Creates a note associated with one or more selected components. See Notes. Yes Diagram No
Add Input Stream To Port n Available only if your mouse is over the input port of a component. Creates an input stream attached to the specified port. This is a quicker alternative to dragging an input stream from the Palette. Yes No No
Add Output Stream To Port n Same as above, but for output streams. Yes No No
Center Selection Available when one or more components in the Editor are selected. Centers the view in the Editor with the selected component in the center of the new view. Yes, with components selected Diagram No
Compare Schemas Only appears in the context menu when you have selected two arcs or two streams in the canvas. Opens the Compare Schemas dialog as described in Compare Schemas Yes, with two arcs or two streams selected No No
Create Group Creates a group containing the select components. See Groups. Yes, with two or more components selected No No
Disable Arc Disables the selected arc and all downstream components. Tuples arriving at the beginning of a disabled arc are not passed to its end. See Commenting Out. Yes No No
Disable Component Disables the selected component, including all input and output ports, and all downstream components. See Commenting Out. Yes No No
Enable Arc Only appears in the context menu when the current selection is a disabled arc. Re-enables the disabled arc. See Commenting Out. Yes No No
Enable Component Only appears in the context menu when the current selection is a disabled component. Re-enables the disabled component. See Commenting Out. Yes No No
Export view as PNG Allows you to save the currently visible portion of the current EventFlow Editor, at its current zoom level, to an image file in portable network graphics format. Opens the Export Visible Diagram as PNG dialog, in which you specify a name for the image file. You can navigate anywhere in your file system to save the image file. Yes No No
Export Application Bundle Creates an application bundle file, as described in Application Bundling Yes, on the StreamBase menu FileExportStreamBase No
Extract As Module Replaces the selected components in the EventFlow with a Module Reference, and creates a new application in the current project folder. The Module Reference points to the new application, which contains the selected components. See Extracting an Application Module. Yes, with two or more components selected Diagram No
Insert Operator Only appears in the context menu when you have selected an arc. Allows you to replace the selected arc in one step with a Filter, Map, Split, or Union operator, with arcs drawn from the newly added operator to the upstream and downstream components. Yes, when one arc is selected No No
Layout Application Rearranges the EventFlow's components and connections. No Diagram
Open Declaration When a Module reference is selected, opens the EventFlow file that defines that module. When the icon for a custom Java operator or adapter is selected, opens the Java source file for that Java operator or adapter, if the source is available in the current Studio workspace. (Source for StreamBase-provided operators and adapters is not in your workspace, and cannot be opened.) Yes Diagram No
Open in Properties View If a single component is selected, opens its Properties view. Yes No No
Quick Outline Displays the whole application's components and details in a Quick Outline window. See Quick Outline. Yes Diagram No
Refresh Project Typecheck Environment If you have Java code in the current project (for example, as part of a custom operator or adapter), run this command when you have changed any Java code, to force the EventFlow to reread the changed Java code. Yes No No
Reroute Connections Rearranges the EventFlow's connections around components. No Diagram
Save Schema If a stream is selected, opens the Save Schema dialog. See Using Saved Schemas. Yes No No
Typecheck Typechecks the selected components in the EventFlow Editor, or the entire EventFlow, if no components are selected. No Diagram
Undo Edit Reverse changes to the last edited component. Yes Edit No
View Source Displays the a pop-up window showing the XML source of the current EventFlow. If a single component is currently selected, the window contains the XML source code for that component only. If you select zero or multiple components, the entire application is shown. To hide GUI-related code (which has no functional effect) in the View Source window, check the Filter non-semantic elements checkbox. Yes Diagram No
Zoom In

Increments the zoom factor of the entire EventFlow, making details larger. If the application becomes larger than the Editor window, scroll bars are displayed.

If your Windows or Linux computer has a mouse with a scroll wheel (or a touchpad that emulates a scroll wheel), and the wheel is enabled, then Ctrl + Mouse Wheel also zooms in. For this feature to work, you must click anywhere in the EventFlow editor canvas to select it.

Yes Diagram
Zoom Out

Decrements the zoom factor of the entire EventFlow, making details smaller.

Ctrl + Mouse Wheel also zooms out. See the note directly above.

Yes Diagram
Zoom to Fit Zooms the entire EventFlow in or out to fit within the EventFlow Editor. No Diagram

[a] The StreamBase toolbar is described in Toolbar Reference.

Back to Top ^

Commenting Out

You can comment out or disable a branch of an EventFlow application. You might do so when trying to isolate a problem, or you might disable portions of an application during development that are only needed at deployment time.

Disable an arc by selecting Disable Arc from the context menu. Re-enable with Enable Arc on the context menu of a disabled arc. You can also select an arc and press Ctrl+/. This keyboard shortcut is a toggle, so you can use it to quickly disable and re-enable arcs and components.

Disabling an arc prevents tuples from reaching the end of the arc, and automatically disables all downstream components. Disabled arcs can still have breakpoints. Disabled components are shown greyed out on the EventFlow canvas, as in the following example:

You can disable components with Disable Component from the context menu. This disables all of the selected component's input and output ports, and all components downstream.

If a component has more than one input port and you disable one port, the component is partially disabled and still processes tuples through its enabled ports. Partially disabled components appear in the canvas marked with a light yellow background, as in the following example:

When converting an EventFlow module to StreamSQL, any portions of the module that are commented out do not appear in the generated StreamSQL file. If you intend to convert an entire EventFlow file to StreamSQL, enable all disabled components before the conversion.

Back to Top ^

Quick Outline

Quick Outline is a pop-up summary of the components in the current EventFlow, and is a faster alternative to the Outline view. Use the Quick Outline feature to:

  • See a summary of any component or its schema

  • Navigate quickly in a large EventFlow diagram

To open a Quick Outline for the currently active EventFlow view, use one of these methods:

  • Press CRTL-O

  • Right-click in the EventFlow and select Quick Outline.

  • In the StreamBase Studio menu, select DiagramQuick Outline.

The Quick Outline pop-up window has two panes:

Left Outline pane

The left pane contains a tree of component types, which you can expand to see instances of each type. Use the mouse or keyboard arrow keys to navigate the tree. Click a component instance to display a summary in the right pane.

Use the text entry field at the top of the left pane to filter entries. As you begin typing, the list displays (after a short delay) the first item that matches. You can enter simple strings or patterns, using the StreamBase Pattern Matching Language. After you type anything in the filter edit box, you can use the Clear button on the right to clear the edit box and restore the full component tree.

Right Outline pane

The summary pane on the right describes the currently selected component, including its schema fields, group settings, and any typecheck problems detected.

To navigate with the Quick Outline window, use the component tree or edit field to locate a component of interest. When located and selected, press Enter. This closes the Quick Outline, centers the EventFlow diagram on the selected component, and, if necessary, increases the zoom factor so that the selected component is clearly visible.

To close a Quick Outline, press Esc, or change focus to anywhere in StreamBase Studio outside the Quick Outline.

Back to Top ^

Compare Schemas

To compare the schemas of two arcs or two streams in the canvas, hold down the Ctrl key and select two arcs or two streams. Comparing schemas is best used on closely related schemas, such as an old and new version of the same schema. The comparison is more meaningful if one of the selected arcs or streams is downstream of the other in the same flow of tuples.

With two arcs or streams selected, right-click and select Compare Schemas from the context menu. Compare Schemas only appears in the context menu under these selection conditions.

This opens the Compare Schemas dialog, which shows a side-by-side view of the schemas of the two selected components. Use this feature to see what fields are added or removed in schemas as tuples flow downstream. Check the Ignore field order checkbox to compare for the presence of like fields, regardless of field order.

Back to Top ^

Groups

You can group collections of components on your canvas, drawing a box with a colored background around the selected components. You can collapse the contents of a group to a single icon on the canvas.

Groups are a visual tool that can help you edit more efficiently, but they do not affect the functionality of your application. See Using Groups for more on groups.

Back to Top ^

Notes

To document your EventFlows, you can add Notes. Notes can attach to the EventFlow canvas, to individual components, to two or more components selected together, or to Groups. It is even possible to attach a Note to another Note. See Using Notes for more on notes.

Back to Top ^

Tooltips

For quickly viewing properties without modifying them, StreamBase provides an extensive set of tooltips. If tooltips are enabled (the default setting), StreamBase Studio displays key properties for each component when you hover your cursor over it (sometimes called mouseover). The contents of each tooltip depends on the component type and the location of the cursor on the component's icon.

This section describes how properties of some components are shown using tooltips. In the screens that follow, the relevant component is indicated by the mouse pointer. The subsections are:

Back to Top ^

Operator Tooltips

Here are some examples of tooltips for different operators. Notice how the information varies with each operator.

For the Bsort operator, the tooltip shows its name, component type, and describes the sort operation defined.

For the Filter operator, the tooltip displays the predicate (boolean expression) that corresponds to each output port.

For the Join operator, the tooltip tells you that the join is by value (instead of by tuples), shows the predicate (boolean expression) to be applied, and all the other settings defined in the Properties view.

For the Query Table, the tooltip tells you whether the table is in-memory or on-disk, as well as its index fields and schema.

Back to Top ^

Port Tooltips

Each port on a component is depicted as a black square. The tooltip for an input port on the left side or an output port on the right side displays the port's number. For example:

Back to Top ^

Tooltips for Streams and Arcs

The tooltip for an arc between components displays the schema of the tuples on that arc (if known). For example:

In some arc tooltips, the text not null is appended to fields that cannot have a null value. The text is informational, not part of the actual field name or value. In the example below, the timestamp field coming out of the Heartbeat operator will always have a value. In the output stream's tooltip, the same field would not have this text, because it is possible for the intervening operator to change it to a null value.

Back to Top ^

Tooltips for Typecheck Status

If a component has a yellow, gray, or red background, its tooltip displays a relevant error message. For example:

  • Yellow background when the schema compatibility is unknown (for example, the component has not yet been connected to another component):

  • Gray background when a prior (upstream) component has a typecheck error:

  • Red background (typecheck failure):

    For more information about typechecking, see the Typecheck Errors View topic.

Back to Top ^

Toggling Tooltip Properties and Comments

If you have added comments in the General tab of the Properties view of a component (a good documentation practice), the tooltip displays those comments by default instead of the component's properties. To display properties, press and hold Ctrl. To toggle back to comments, release Ctrl. The following example illustrates:

Back to Top ^

Definitions Tab

Use the Definitions tab to manage constants and named schemas for the current EventFlow module, and to manage imports of constants and named schemas from other modules. This section has the following subsections:

Defining and Comparing Named Schemas

The Named Schemas and Constants section of the Definitions tab lists named schemas defined for the current EventFlow module. Named schemas can be used by any component in the current module that takes a schema. See Using Named Schemas in the Authoring Guide for further information.

The tree view in the Named Schemas and Constants section distinguishes between named schemas defined in the current module and named schemas imported from another module.

Manage named schemas as follows:

  • To create a named schema for the current module, click the Add Named Schema button, or right-click in the top section and select Add Named Schema from the context menu. This opens the Edit Named Schema dialog.

  • To modify an existing schema, select it in the list, then use the Edit button or the Edit context menu command. Both functions open the Edit Named Schema dialog.

  • To remove a named schema, select it in the list, then use the Remove button or the Remove context menu command.

You can compare two named schemas in the Named Schemas tab in the same way that you compare the schemas of two components in the canvas. Comparing schemas is best used on closely related schemas, such as an old and new version of the same schema. Use the following steps:

  1. In the Named Schemas and Constants table, select a schema name.

  2. Holding the Ctrl key, select a second schema.

  3. With two schemas selected, right-click and select Compare from the context menu.

  4. The Compare Schemas dialog displays, showing the fields of each schema, with differences highlighted in blue.

See an example of the Compare Schemas dialog in Compare Schemas above.

Back to Top ^

Defining Constants

You can define constants with module scope that can thereafter be referenced in any expression in any component or adapter in the containing module. Designate the value of a constant with an expression, which is calculated once when the container holding the module is loaded into the server. See Using Constants for more on constants, including examples.

The tree view in the Named Schemas and Constants section distinguishes between constants defined in the current module and constants imported from another module.

Manage constants as follows:

  • To create a constant for the current module, click the Add Constant button, or right-click in the top section and select Add Constant from the context menu. This opens the Edit Constant dialog.

  • To modify an existing constant, select it in the list, then use the Edit button or the Edit context menu command. Both functions open the Edit Constant dialog.

  • To remove a constant, select it in the list, then use the Remove button or the Remove context menu command.

Back to Top ^

Using Module Imports

Use the Manage Module Imports section of the Definitions tab to import all or a selection of the named schemas and constants from another module to the current module. The modules from which you can import must be in the current module's Module Search Path.

Before using this feature, add the modules of interest to the current module's search path by setting the project properties for the current module. That is, select the current module's project folder in the Package Explorer, right-click and select Properties from the context menu. Then select Project References and select the project folders of interest.

For large, multi-module applications, this feature allows you to define commonly used schemas and constants in a central module, and import them from the central module as needed by other modules in the application.

Back to Top ^

Parameters Tab

Use the Parameters tab to define module parameters and their default values for the current EventFlow module. You can reference module parameters in expressions in any operator or adapter in the containing module. You can set values for module parameters in a number of ways. This allows you to reuse the same application module in different module references, with different parameter values. For details on module parameters see Parameter Overview and Using Module Parameters.

In StreamSQL programs, module parameters are declared with the CREATE PARAMETERS statement.

Back to Top ^

Dynamic Variables Tab

A dynamic variable is a variable you can define for a StreamBase module that can thereafter be referenced by name in expressions in operators and adapters in that module. Dynamic variables are linked to an input or output stream in the containing module. The value of a dynamic variable is updated when a tuple is received on the linked input stream or when a tuple is emitted on the linked output stream.

The analogous feature for StreamSQL is the DECLARE statement. For both EventFlow and StreamSQL applications, the scope of a dynamic variable is the containing module.

See Using Dynamic Variables for details on this feature, and for a brief tutorial that clarifies the purpose and usefulness of dynamic variables.

Back to Top ^

Metadata Tab

The Metadata tab provides two optional features for your EventFlow application or module:

Application Description

Add an optional description to document the purpose of this application or module. Unlike the descriptions for notes, groups, operators, and data constructs, the application-level description does not appear as a popup in the EventFlow canvas. Application descriptions are saved as an element in the EventFlow XML, and remain with the sbapp file if you extract the application's layout to an sblayout file.

Icons

Configure a custom icon for this application or module to distinguish it graphically. You can customize how your application or module's icon appears in the Palette, and you can add an overlay image to the associated Module Reference icon on the canvas. The following example (which modifies the example used in Extracting an Application Module) shows a large palette icon and an overlay icon customized with a logo:

To customize icons:

  1. Create a bitmap image in PNG, GIF, BMP, or JPEG format, with the following exact required dimensions:

    • Large Palette Icon: 32x32 pixels

    • Small Palette Icon: 16x16 pixels

    • Canvas Overlay Icon: create either a 24x24 pixel or 48x48 pixel icon. If you specify a 24x24 pixel icon, it is overlaid on the bottom right corner of the default canvas icon, as shown in the picture above. If you specify a 48x48 pixel icon, it replaces the default canvas icon.

    Tip

    The icons shown in the example above have a solid background, as do the standard Studio Palette icons. For your 24x24 overlay icon, consider using a transparent background, which can be added to the PNG and GIF formats.

  2. Import the images into your project.

  3. Click each Browse button in the Metadata tab to select the appropriate image for each icon field.

You may need to close and reopen the EventFlow application that references the icon-customized module to see its new icons.

Back to Top ^

Related Topics

Back to Top ^