IBM Streams 4.3.0

Processing mixed-mode files

You can process mixed-mode files, which include defining mixed-mode processing arguments and build generated SPL.

About this task

A mixed-mode file uses Perl to generate SPL code. When you edit a mixed-mode file, which has a file extension of splmm, Streams Studio invokes the SPL compiler to run the Perl code and generate the corresponding SPL file. This step is called preprocessing the mixed-mode file. If the Perl code in the mixed-mode file uses command-line arguments (@ARGV), you might need to specify values for these arguments to preprocess the mixed mode file. From each composite in the generated SPL, one and more build configurations can be created. Each build configuration can be used to build an SPL application. The following procedures are covered:
  • Defining mixed-mode processing arguments.
  • Building generated SPL.

Procedure

  1. Define SPL mixed-mode pre-processing arguments as follows:
    1. From a mixed-mode project in the Project Explorer view, select an .splmm file, right click, and select Properties from the menu.
    2. Select SPL Preprocessing Options on the Properties window.
    3. Click the Add Argument button and provide an argument value in the provided field.
    4. Add as many arguments as are needed by the .splmm file.
    5. To limit the size of the generated SPL or to limit the preprocessing time, you can optionally set these maximal values in the provided boxes. These thresholds help protect from generating large files in the case the Perl code that contains infinite loops, or similar errors.
    6. Click OK when you are done.
  2. To build the generated SPL, for each main composite in the generated SPL, follow the steps that are outlined in Building application Main composites.
    Note: In some cases, the setting of a pre-processor argument can cause a large SPL application to be generated. This setting might cause Streams Studio to result in an out of memory error. If the application is displayed in the SPL editor or the SPL mixed-mode editor at the time of the error, you might encounter problems when you restart Streams Studio with this workspace. To recover from this problem, follow this procedure:
    1. Reset the perspective settings in this workspace so the editors do not get restored upon restart. To reset, delete the XML files in the <workspace>/.metadata/.plugins/org.eclipse.ui.workbench directory.
    2. Modify the pre-processor arguments that are causing an out of memory error. Modify the pre-processor arguments in the following file: <workspace>/<SPL project>/.settings/<splmm application name>.splmmoptions.
    3. Alternatively, you might want to remove all preprocessor arguments settings from this SPL mixed-mode application. In this case, delete <workspace>/<SPL project>/.settings/<splmm application name>.splmmoptions.
    4. Remove the large generated SPL file from your workspace.
    5. Restart Streams Studio after you modify these files.
    Note: Streams Studio does not track how many arguments you must add for an SPL mixed-mode file. The suggested best practice, as you design your SPL mixed-mode file, is to describe the number of arguments it needs in a comment at the beginning of the .splmm file.