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.
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:
-
Creates a new module that implements the selected interface.
-
Adds the newly created module to the Module instances grid in the Properties view for the selected interface.
-
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:
-
Switches to the Properties view for the selected Extension Point operator and opens its Modules tab.
-
Opens the Add Module Instance dialog as if you had clicked the
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.
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 shipped with 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:
-
Load the
operator
sample:-
From the top menu, select
> . -
Select operator from the Data Constructs and Operators category.
-
Click OK.
-
-
In the Project Explorer view, open
ExtensionPoint.sbapp
. -
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 -
Open the StreamBase Extension Points view.
-
Select the entry for Multiply, then right-click and select Create New Extension from the context menu.
-
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 check box, it is now a non-editable field with
Multiplier.sbint
filled in. -
There is a new field, Module name in Extension Point.
-
-
Fill in the empty fields as follows:
EventFlow Application file name Quadrupler.sbapp Module name in Extension Point quadruple -
Click
. 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. -
Complete the implementation of
Quadrupler.sbapp
with these steps:-
From the same project, open
Tripler.sbapp
. -
Select the Union and Triple components and copy them to the clipboard.
-
Re-open
Quadrupler.sbapp
and paste the copied components. -
Connect the streams and components. Tip: Use Ctrl+A to select all components, then type the keyboard shortcut
x x
. -
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 tovalue*4
. In the next line, changeTripler.sbapp
toQuadrupler.sbapp
. -
Save
Quadrupler.sbapp
.
-
-
Now reopen
ExtensionPoint.sbapp
, and look again at the Properties view for theMultiply
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 -
Run
ExtensionPoint.sbapp
and send it a tuple with any integer andaction
=null
. Examine the Output Streams view and notice that the new module is already working.