IBM Streams 4.3.0

Creating SPL source files and Main composites

You can create new SPL source files and Main composites within an existing SPL project in Streams Studio. With an SPL source file, you to define toolkit artifacts in SPL. These toolkit artifacts include SPL composite operators, SPL functions, and SPL types. A toolkit can contain any number of namespaces, and each namespace can contain any number of these toolkit artifacts.

Before you begin

Create a new or import an existing SPL project.

Procedure

  1. To create a new SPL source file and an optional Main composite:
    1. In the Project Explorer view, select the existing SPL project in which you want to create a new SPL source file.
    2. Right-click on the SPL project and from the menu, select New > SPL Source File to invoke the New SPL Source File wizard.
    3. In the SPL Project field, specify the project where you want this source file to be located. The selected project's name is completed by default. Optionally, you can use the Browse button to locate another project.
    4. In the Namespace field, specify the namespace in which you want the source file to be located. If the specified namespace does not exist, it is created automatically when the file is created.
    5. Optional: Generate a main composite when the new SPL source file is created. To generate the main composite, select the Generate Main composite check box and specify the name of the main composite. If you want to create a blank SPL source file, make sure the Generate Main composite check box is not selected.
    6. In the Source Type selection, select SPL source (*.spl).
    7. If you selected Generate Main composite, the name of the new SPL source file defaults to the Main composite name. To specify a different name for the SPL source file, clear the Use name of main composite check box and specify the name of the SPL source file in the File name field.
    8. Click Finish.
  2. To create a composite operator by cloning an existing composite operator:
    1. In the Project Explorer view, right-click the composite operator that you want to clone, and then click Clone.
    2. Specify details such as the name of the new composite operator, the .spl file name, and namespace where you want to create the composite operator. The composite operator is cloned in the new location.

Results

Streams Studio creates a new SPL source file in the namespace specified. If you selected to generate a main composite, a snippet of the main composite is placed in the new SPL source file. The new SPL source file is opened in an SPL Graphical Editor.

What to do next