Contents
An Interface is a defined set of input streams, output streams, and Query Tables, all based on named schemas and table schemas, that application modules can implement. StreamBase Interfaces are described in StreamBase Interfaces.
To create a new, empty application in an existing project:
-
Open the New StreamBase EventFlow Interface wizard using one of the following methods:
-
Select
→ → . -
Click the drop-down arrow next to the New toolbar button (), and select StreamBase Interface from the drop-down menu:
-
Right-click anywhere in the Package Explorer, and select
→ from the context menu. -
With the cursor in any Studio view, press Ctrl+N to open the New dialog. Select EventFlow Application (or ) and click .
-
With the cursor in any Studio view, press Alt+Shift+N to open the → menu at the cursor location. Select StreamBase Interface and press Enter.
-
-
In the New StreamBase EventFlow Interface wizard, select the top-level project folder in which you want to add the Interface.
-
Type a name for the Interface file, including the
.sbint
extension. -
Click
. This opens the Interface Editor, ready to define your new Interface file.
To create a new Interface that extends an existing StreamBase Interface:
-
Follow the steps in Create a New, Empty Interface File.
-
After step 3, select the Extend existing interfaces check box and click .
-
This opens the Choose Interfaces panel. Click
to select from a list all the StreamBase Interfaces file (.sbint
files) in the selected project's module search path. -
Select one or more Interface files and click
. -
Click
.
You can create an interface from the currently open EventFlow module if it has the following characteristics:
-
One or more input streams whose schema is fined with a named schema.
-
One or more output streams with a declared schema.
-
One or more shared or placeholder Query Tables defined with a table schema.
If at least one of these features is not found in the current module, running the
→ command results in an information dialog.If the currently open module meets the qualifications, follow these steps to create a new interface using the current module's stream and table schema definitions:
-
Right-click the canvas background and select
→ from the context menu. -
This opens the Extract Interface dialog, in which the streams and Query Tables that meet the criteria above are shown. (Non-matching streams and Query Tables are omitted from the dialog.) Select the streams and Query Tables that you want to be encapsulated in the new interface.
-
Optional. Click to open a second dialog in which you can view a side-by-side comparison of the underlying XML source for the current module, before and after the refactoring.
-
Click
to create the new interface file, and to refactor the current module as an implementation of that interface. The schema definitions extracted from the module are now defined in the Definitions tab of the module.
Advanced. For advanced use cases, it is possible to create a new StreamBase Interface 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 Interface between projects. Studio provides a simple way to reuse Interfaces defined anywhere in the Studio workspace. 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 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 Interface by linking to an existing file, proceed as follows:
-
Follow the steps in Create a New, Empty Interface 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 the existing StreamBase Interface 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 Extend existing interfaces and Link to file options at the same time. In this case, the linked-to Interface 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.