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
- To create a new SPL source file and an optional Main composite:
- In the Project Explorer view, select the existing SPL
project in which you want to create a new SPL source file.
- Right-click on the SPL project and from the menu, select to invoke the New SPL Source File wizard.
- 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.
- 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.
- 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.
- In the Source Type selection,
select SPL source (*.spl).
- 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.
- Click Finish.
- To create a composite operator by cloning
an existing composite operator:
- In the Project Explorer view, right-click
the composite operator that you want to clone, and then click Clone.
- 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.