Creating a New StreamBase Application

There are two ways to create a new application file in StreamBase Studio:

  • Create a new project that includes a new, empty EventFlow or StreamSQL application. See Creating a New StreamBase Project.

  • Create a new application file in an existing project.

Create a New, Empty Application File

To create a new, empty application in an existing project:

  1. Open the New EventFlow Application wizard (or the New StreamSQL Application wizard) using one of the following methods:

    • Select FileNewEventFlow Application (or FileNewStreamSQL Application).

    • Click the drop-down arrow next to the New toolbar button (), and select EventFlow Application (or StreamSQL Application) from the drop-down menu:

    • Right-click anywhere in the Package Explorer, and select NewEventFlow Application (or NewStreamSQL Application) from the context menu.

    • With the cursor in any Studio view, press Ctrl+N to open the New dialog. Select EventFlow Application (or StreamSQL Application) and click Next.

    • With the cursor in any Studio view, press Alt+Shift+N to open the FileNew menu at the cursor location. Select EventFlow Application (or StreamSQL Application) and press Enter.

  2. In the New StreamBase EventFlow Application wizard (or its StreamSQL equivalent), select the top-level project folder in which you want to add the application.

  3. Type a name for the application file, including the .sbapp (or .ssql) extension.

  4. Click Finish.

Create an Application from an Interface

To create a new EventFlow or StreamSQL application that extends an existing StreamBase Interface:

  1. Follow the steps in Create a New, Empty Application File.

  2. After step 3, select the Implement interfaces check box and click Next.

  3. This opens the Choose Interfaces dialog. Click Add to see all the StreamBase interfaces (.sbint files) in the selected project's module search path.

  4. Select one or more interface files and click OK.

  5. Click Finish.

Create an Application to Extend an Extension Point

To create a new EventFlow or StreamSQL application that extends an existing StreamBase Extension Point:

  1. Follow the steps in Create a New, Empty Application File.

  2. After step 3, select the Extend extension point check box and click Next.

  3. In the Select Extension Point wizard panel, click Browse to see a list of extension points in the current workspace. Select an extension point and click OK.

  4. Type an identifier for the new module.

  5. Click Finish.

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. You must complete the module to add the business logic for the module.

Create an Application by Linking

Advanced. For advanced use cases, it is possible to create a new StreamBase application 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 application 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 application 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 application by linking to an existing file, proceed as follows:

  1. Follow the steps in Create a New, Empty Application File.

  2. Before you click Finish, click Advanced. This opens a new line in the dialog.

  3. Select the Link to file in the file system check box, and use the Browse button to navigate to and select the existing StreamBase application file of interest.

    Click Variables 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.

  4. Click Finish.

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 application 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.