StreamBase Extension Points View

Introduction

The StreamBase Extension Points view shows a tree view of all Extension Point operators in use in any EventFlow module in the current workspace, along with each module that implements the interface referenced in each Extension Point.

Use this view to open the EventFlow files referenced in the view:

  • Top level entries represent interfaces. Double-click a top-level interface name to open the EventFlow file that contains that interface (as shown in gray text), with that interface selected and centered in the Editor view.

  • Second-level entries represent modules that implement each interface. Double-click a module name to open it in the EventFlow Editor.

Context Menu

The context menu in the Extension Points view has the following entries:

Create New Extension

Use this entry to create a new module that implements the selected interface, and at the same time adds the new module and its alias name to the Extension Point operator that references that interface. This menu entry performs the following actions in a single pass:

  1. Creates a new module that implements the selected interface.

  2. Adds the newly created module to the Module instances grid in the Properties view for the selected interface.

  3. Assigns the newly created module a name to be entered in the Name column in the same Module instances grid.

See Tutorial for the Create New Extension Menu Item below for an example of this process.

Add Extension

Use this entry to add an existing module that implements the selected interface to the Extension Points operator that references that interface. You must have already created a module that extends the selected interface, and it must be in the current project. This context menu performs the following actions:

  1. Switches to the Properties view for the selected Extension Point operator and opens its Modules tab.

  2. Opens the Add Module Instance dialog as if you had clicked the Add button on the Modules tab.

Open

Opens the EventFlow Editor Editor for the selected entry. This menu entry is an alias for the double-click actions described in Introduction.

Tutorial for the Create New Extension Menu Item

This section provides an example of the steps for using Create New Extension from the context menu of the Extension Points view.

The ExtensionPoint.sbapp sample is part of the operator group of samples included in StreamBase. This simple module implements the Multiplier.sbint interface with an Extension Point named Multiply. The Extension Point has two module instances, Doubler.sbapp and Tripler.sbapp, which double and triple their integer input, respectively.

We will add a third module instance named Quadrupler.sbapp. Follow these steps:

  1. Load the operator sample:

    • From the top menu, select File>Import Samples and Community Content.

    • Select operator from the Data Constructs and Operators category.

    • Click OK.

  2. In the Project Explorer view, open ExtensionPoint.sbapp.

  3. Double-click the Multiply component to open its Properties view. Open the Modules tab and notice that there are two module instances:

    Module Name
    Double.sbapp double
    Tripler.sbapp triple
  4. Open the StreamBase Extension Points view.

  5. Select the entry for Multiply, then right-click and select Create New Extension from the context menu.

  6. This opens the New StreamBase EventFlow Application dialog with three differences from the standard version:

    • The sample_operator project folder is preselected.

    • The Implements interface control is no longer a checkbox, it is now a non-editable field with Multiplier.sbint filled in.

    • There is a new field, Module name in Extension Point.

  7. Fill in the empty fields as follows:

    EventFlow Application file name Quadrupler.sbapp
    Module name in Extension Point quadruple
  8. Click Finish. Studio opens an EventFlow Editor session on the new file, Quadrupler.sbapp. The two input streams and one output stream from the Multiplier interface are entered for you, defined with named schemas imported from the interface file.

  9. Complete the implementation of Quadrupler.sbapp with these steps:

    1. From the same project, open Tripler.sbapp.

    2. Select the Union and Triple components and copy them to the clipboard.

    3. Re-open Quadrupler.sbapp and paste the copied components.

    4. Connect the streams and components. Tip: Use Ctrl+A to select all components, then type the keyboard shortcut x x.

    5. Open the Properties view for the copied Triple component and change its name to Quadruple. In the Output Settings tab, change the Add newValue expression to value*4. In the next line, change Tripler.sbapp to Quadrupler.sbapp.

    6. Save Quadrupler.sbapp.

  10. Now reopen ExtensionPoint.sbapp, and look again at the Properties view for the Multiply component as in step 3. Notice that the Module instances grid already has an entry for the new module.

    Module Name
    Double.sbapp double
    Tripler.sbapp triple
    Quadrupler.sbapp quadruple
  11. Run ExtensionPoint.sbapp and send it a tuple with any integer and action=null. Examine the Output Streams view and notice that the new module is already working.