Contents
In general, there are two ways to create a new EventFlow module file in StreamBase Studio:
-
Create a new EventFlow fragment project, as described on Creating a New StreamBase Project. This creates and opens a new EventFlow module file named the same as the project.
-
Create a new EventFlow module file in an existing project.
To create a new, empty EventFlow module in an existing project:
-
Start the New StreamBase EventFlow™ Module wizard using one of the following methods:
-
Select
> > . -
Click the dropdown arrow next to the New toolbar button (), and select from the dropdown menu:
-
Right-click anywhere in the Project Explorer, and select
> from the context menu. -
With the cursor in any Studio view, press Ctrl+N (Windows) or command+N (Mac) to open the New dialog. Select StreamBase EventFlow™ Module and click .
-
With the cursor in any Studio view, press Alt+Shift+N (Windows) or command+option+N (Mac) to open the > menu at the cursor location. Select StreamBase EventFlow™ Module and press Enter.
-
-
In the New StreamBase EventFlow™ Module wizard, navigate to the package name folder of the project in which you want to add the module.
(If you fail to select an existing package name, the module is created with the default package name. It is strongly discouraged to use the default package name.)
-
Type a name for the module file. Studio adds the
.sbapp
extension if you leave it off. -
Click
. Studio creates a new file and opens it in the EventFlow Editor.
To create a new EventFlow module that extends an existing EventFlow Interface:
-
Follow the steps in Create a New, Empty EventFlow Module File.
-
After step 3, select the Implement interfaces checkbox and click .
-
This opens a dialog that lets you select the name of an EventFlow Interface file, which must exist. Click
to see the EventFlow Interfaces defined in the current project. -
Select an Interface file and click
. -
Click
.
To create a new EventFlow module that extends an existing EventFlow Extension Point:
-
Follow the steps in Create a New, Empty EventFlow Module File.
-
After step 3, select the Extend extension point check box and click .
-
In the Select Extension Point wizard panel, click to see a list of extension points in the current project. Select an extension point and click .
-
Enter a name for the module to be extended by the selected extension point.
-
Click
.
Studio performs the following actions:
-
Creates a new EventFlow module populated with the components defined in the Extension Point's interface.
-
Adds the new module as a locally defined module instance in the Modules tab of the selected Extension Point.
The newly created module only contains the streams, Query Tables, constants, and schemas specified in the interface. Complete the module to add the business logic for the module.
Advanced. For advanced use cases, it is possible to create a new StreamBase EventFlow module file in the selected project in your Studio workspace by linking to an existing file anywhere in the file system.
Note
Do not use this linked file mechanism if your only goal is to share an EventFlow module between projects. Studio provides a much simpler way to share and reuse modules, as described in Project References and Importing Resources from One Module to Another. It is always better to import an external file into Studio than to link to an external file.
This feature establishes a true link, not a copy, of the specified EventFlow module file. When you link to a file that is outside the Studio workspace, any edits to the file in Studio affect the external file. Similarly, if you edit the original file outside of Studio, you are also editing the linked copy in the Studio workspace, possibly rendering the Interface invalid.
For the rare, advanced cases where it is appropriate to create a StreamBase EventFlow module by linking to an existing file, proceed as follows:
-
Follow the steps in Create a New, Empty EventFlow Module File.
-
Before you click
, click . This opens a new line in the dialog. -
Select the Link to file in the file system check box, and use the button to navigate to and select the existing StreamBase EventFlow module file of interest.
Click
to insert path variables in the path to the linked file to avoid hard-coding an absolute path name. The path variables feature is provided by Eclipse, and is not part of StreamBase Studio. For guidance, see the Help topic Path Variables in the Eclipse Workbench User Guide. -
Click
.
Caution
In very advanced cases, it is possible to use both the Implement interfaces and Link to file options at the same time. In this case, the linked-to EventFlow module file must have already been implemented using the same Interface you select in the Choose Interfaces dialog. On creation of such a linked file, Studio typechecking reports any failures to conform to the selected Interfaces.