EventFlow Editor

This topic describes how to use the EventFlow Editor, which you can use to design a StreamSQL 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, click WindowPreferences in the main menu. Options are described in the topic, StreamBase Studio Preferences.

The first step in using the EventFlow Editor is to open an application; until then, the EventFlow Editor is empty. To open an application, double-click an sbapp file in project folder in the Package Explorer. (To learn how to create a new application, read Creating Your First StreamBase Project and Writing Your First EventFlow Application.)

The EventFlow Editor can be closed or maximized using the editor's toolbar buttons. You can also drag a tab out of a multi-tabbed editor to a different part of the window.

The EventFlow Editor has four tabs, described in the main sections of this topic:

Editor Tab

The Editor tab is the main editing are for EventFlow applications. It is a canvas on which you can graphically assemble the components of your application. The figure below shows an EventFlow Editor with a few components already added and 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 associate operators with data constructs. See Creating Arcs for more information.

  • Move components to create a more desirable arrangement.

The EventFlow Editor has a number of specialized features that you can use to help you edit applications.

Back to Top ^

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. Most of these commands are available in multiple places: a StreamBase Studio menu, in the right-click context menu, or a toolbar button.

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
Undo Edit Reverse changes to the last edited component. Yes Edit No
Create Group Creates a group containing the select components. See Groups. Yes No No
Center Selection Moves the selection to the center of the canvas. 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. Yes Diagram
Zoom Out Decrements the zoom factor of the entire EventFlow, making details smaller. Yes Diagram
Zoom to Fit Zooms the entire EventFlow in or out to fit within the EventFlow Editor. No Diagram
View Source Displays the View Source window. If you have selected a single component, the window contains the sbapp XML source code for that component only; if you selected zero or multiple components, the entire application is shown. To hide GUI-related code (which has no functional effect) in the View Source window, enable the option, Filter non-semantic elements. Yes Diagram No
Quick Outline Displays the whole application's components and details in a Quick Outline window. See Quick Outline. Yes Diagram No
Open in Properties View If a single component is selected, opens its Properties view. Yes No No
Save Schema If a stream is selected, opens the Save Schema dialog. See Using Saved Schemas. Yes No 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 Diagram No
Layout Application Rearranges the EventFlow's components and connections. No Diagram
Reroute Connections Rearranges the EventFlow's connections around components. No Diagram
Typecheck Typechecks the selected components in the EventFlow Editor, or the entire EventFlow (if no components are selected). No Diagram

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

Back to Top ^

Tooltips

Each component in the Editor tab has an associated Properties view, where you can define its properties. 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.

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:

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.

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:

Groups

You can group collections of components on your canvas. Groups are a visual tool that can help you edit more efficiently, but they do not affect the functionality of your application. To create a group:

  1. Select any group of components. For example, hold down your left mouse button and draw a box around the components of interest.

  2. Right-click in any part of the selection, and choose Create Group. A translucent box is created over the selected components.

When you first create a group or select an existing group, its Properties view opens. You can define a name, set the background color, and add a description for the group.

You can select the components inside a group independently of the group. Select the group itself by clicking its title bar or any non-component space inside the group.

Here are some useful things you can do with groups:

  • Move all its components around the canvas together: select and drag the group to move it.

  • Collapse the group to hide its components: click the group's minimize button. To restore the minimized group window, click the + restore button.

  • View the source code of all the group components together: select the group, right-click the group and select View Source from the context menu.

  • Add components to a group:

    1. Select one or more components outside the group.

    2. Begin to drag the selection into the group window.

    3. Press and hold the Shift key while you finish dragging the components into the group window.

    4. Release the Shift key.

  • Delete the group without deleting the components in the group: select the group by clicking its title bar, then press the Delete key.

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.

The text you place in Notes is saved with the EventFlow application, but does not affect the functionality of your application. Note text can be seen as one or more gui.note elements when you view your EventFlow application in text form.

A Note's text can be seen in the Note's tooltip, when you hover the mouse pointer over the Note. You can also select a Note's icon and view the text in the Note's Properties view.

To add a Note:

  1. Select where you want the Note to attach. That is:

    1. Click anywhere in the EventFlow canvas to create a free-standing Note attached to the EventFlow itself.

    2. Select a single component.

    3. Select two or more components.

    4. Select a Group.

  2. Right-click and select Add Note from the context menu.

  3. To add text to the note, click the note to open its Properties view, and edit the Description field.

You can use the following HTML tags in your Note text: b, p, br.

When you delete a component that has an attached Note, the Note remains on the canvas and becomes a free-standing note.

Also see Using Notes.

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.

Parameters Tab

Use the Parameters tab to define parameters in your application. The parameters can be used in operator expressions, and bound to values that are controlled in module references. This allows you to reuse the same application module in different module references, with different parameter values. Please read Using Module Parameters for more information.

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.

Named Schemas Tab

The Named Schemas tab lists named schemas that have been defined at the application level, where they can be shared by any component that takes a schema. You can expand each schema listed in the tab to see its fields.

To create a named schema click the Add button, or right-click in the tab and choose Add. To modify an existing schema use the Edit button or Edit context menu command in the same way. Both functions open the Edit Named Schema dialog. The tab also provides a Remove function.

Named schemas are discussed in Using Named Schemas in the Authoring Guide.

Related Topics

Back to Top ^