Project Upgrade Reference

TIBCO StreamBase provides an upgrade wizard that automates the upgrading of StreamBase 7.x or Live Datamart 2.x projects to StreamBase 10 format.

This page provides reference material to use when performing those upgrades.

General Notes

Project Name

Choosing a project name is not an arbitrary choice, because the project folder name determines your Maven Artifact ID. This determines part of your project's package name, which, in turn, determines the directory structure of your project.

  • You can use uppercase letters and hyphens in your Project Name, but be aware that these will be converted to lowercase and underscores for use in the Package Name.

Group ID
  • The Group ID you use is an important decision that is difficult to change later.

    Note

    The New Project and Upgrade Project wizards remember the last Group ID you used, and this persists between StreamBase Studio sessions.

  • Use your organization and department's globally unique Group ID, such as com.tibco.ep.sb.projectname. This ensures that the StreamBase artifacts you generate can be reused in other projects globally without danger of a name conflict.

  • As with Java package names, the Group ID is your organization and department's fully qualified domain name read backwards.

  • You can use com.example for your own tests and experiments before committing to a final Group ID.

Package Name

By default, the Package Name for your project is generated from your Group ID + Artifact ID (which is the same as your Project Name).

  • Uppercase letters are converted to lowercase.

  • Hyphens are converted to underscores.

  • In general, the Package Name follows Java Package Name conventions and character restrictions.

  • It is possible to overwrite the generated Package Name in Configure Maven Artifact panel of the New Project wizard, but this is against best practices.

Java Test File

The New Project wizard creates an empty but runnable Java unit test file named TestCase.java in the src/test/java folder.

  • Leave this file in place, but make simple edits to make it a runnable test.

  • The file contains a framework for a Junit test, with minimum project-specific test code in the file. You can edit this test file to work as an actual StreamBase JUnit test for your project.

  • This empty test file will run as an empty test when you run Maven Test (or when you run a Maven goal for which a test is a prerequisite step).

  • In an upgraded project, this file references the empty EventFlow module file also created by the wizard in src/main/eventflow/packagename. To turn TestCase.java into a valid test file for the upgraded project, edit the file to specify the FQN of the top-level EventFlow module in the upgraded src/main/eventflow/packagename folder.

Logback Configuration File

The New Project wizard generates a default, minimal logback-test.xml file in src/test/resources. You can edit this file later to specify logging options to be used when running Maven tests.

Version

The New Project wizard proposes an initial Version number of 0.0.1-SNAPSHOT.

  • In most cases, leave this number as is.

  • If the legacy project you're porting used a Maven build system, you can enter the next major increment in your project numbering system. Use the n.n.n-SNAPSHOT format as shown.

Module Folders

If your legacy project organizes multiple EventFlow modules into project subfolders, you can reproduce that behavior in StreamBase 10. As long as a folder is a sibling or child of the src/main/eventflow/packagename folder, it is automatically in the Maven module search path.

To create a new folder in a StreamBase 10 Maven project:

  1. Select the packagename folder for your project under src/main/eventflow.

  2. Right-click and select New>Folder.

This creates a subfolder that is automatically in the Maven module search path.

Resource Folders

Resource files can be organized into folders in src/main/resources, and the upgrade wizard migrates files found in legacy subfolders into subfolders of src/main/resources.

References in EventFlow modules to the fully qualified name (FQN) of resource files in such subfolders are valid and are honored when running the fragment in that project.

However, Studio chooser dialogs that look for a specific file type only show files in src/main/resources, and do not look into subfolders.

What Goes Where

See What Goes Where for a discussion of the types of files that must be placed into particular folders in your EventFlow or LiveView fragment project folder.

Manually Porting an EventFlow Project

TIBCO strongly recommends using the upgrade wizard to migrate legacy projects to StreamBase 10 Maven format. The following steps to manually migrate a project are provided for general reference.

  1. Open your StreamBase 7 project in Studio 10 (or open it in a parallel instance of StreamBase 7, if you have one).

    1. Do not attempt to run your StreamBase 7 project in StreamBase 10 yet. It might run, or might not, but will introduce complications either way.

  2. Create a new, empty project with File>New>StreamBase Project.

    1. Select EventFlow Fragment or LiveView Fragment as appropriate for the project type you are migrating.

    2. In the next panel, enter a Group ID for this project. See the General Notes section above for more on choosing your Group ID.

    3. Click Finish.

  3. This creates a new project for you in Maven format in the Project Explorer view.

  4. Open the src/main/eventflow folder down to its Package Name level.

    1. The New Project wizard created empty EventFlow and layout files for you, and opened the EventFlow Editor on the empty EventFlow module.

    2. The basename of these files is the same as the project folder name.

    3. Close the EventFlow Editor by clicking the X in its tab.

    4. Delete these wizard-generated files. If you are porting an existing project, it already has one or more EventFlow module files of its own.

  5. Open your legacy project folder and copy its module and resource files to your StreamBase 10 folder, following the same procedure used by the upgrade wizard as described in Where Files Are Copied.

  6. If your StreamBase 7 project includes Java code you wrote to extend StreamBase with custom functions, custom operators, or custom adapters, copy those .java files to src/main/java/packagename. You can organize your Java files into separate packages by creating new folders. To create new package name subfolders, select the packagename folder, right-click, and select New>Folder.

  7. If you opened your StreamBase 7 project in StreamBase 10 in step 1, close it now and remove it from your Studio 10 workspace.

  8. Your StreamBase 10 project should now run normally in Studio. Test this carefully:

    1. Select the top-level EventFlow module, right-click, and select Run As>EventFlow Fragment.

    2. Send tuples to input streams manually in the Manual Input view.

    3. If your project has a feed simulation file, open the Feed Simulations view in the Test/Debug perspective, and make sure your feed simulation file is listed there. Run the feed simulation file, pause it, and stop it.

    4. For a full test, go through the full deployment cycle for your ported application, as described on Deploy Applications with epadmin.