Module Introduction

A StreamBase module is a set of operators that include input and output streams, and is described in a single EventFlow or StreamSQL file. A module can call another module by means of a Module Reference operator. For example, a top-level module can have a Module Reference to a second-level module that is defined in a separate file. The second-level module can have Module References to third-level modules, and so on. Developing with modules allows you to avoid replicating code by reusing the same functionality in multiple applications.

The following is a general workflow for working with application modules. Follow the topic links for details on each step:

  1. Create a new module:

    • Create an EventFlow module by selecting FileNewEventFlow Application.

    • Create a StreamSQL module by selecting FileNewStreamSQL Application.

  2. As an alternative, you can create a module from a portion of an existing EventFlow module, as described in Extracting a Module. (There is no similar provision for extracting a portion of a StreamSQL module.)

  3. Optionally define parameters for your application and use the parameters in expressions in its operators. You can pass parameter values to the top-level module by means of the <operator-parameter> element in the server configuration file. You pass parameter values to called modules as part of the Module Reference in the calling module. See Parameter Overview

  4. Make sure the top-level module can locate its called modules on the module search path.

  5. Make sure any file resources required by operators and adapters in your modules can be located on the resource search path.

  6. In the top-level module, reference called modules with a Module Reference, as described in Referencing a Module.

  7. If the referenced modules contains parameters, set their values in the Module Reference, as described in Using the Module Reference Component. (This overrides any values for the same parameters previously set in the server configuration file.)

Note

When you use a module in multiple applications, remember that any changes to the called module itself are inherited in every module that references it. Conversely, changing the properties of an individual Module Reference does not change the module or any other applications that reference it.