IBM Streams 4.2

Developing and running applications that use the Rules Toolkit

SPL standard and specialized toolkits > com.ibm.streams.rules 2.0.0 > Developing and running applications that use the Rules Toolkit

To create applications that use the Rules Toolkit operator, you must configure either IBM InfoSphere Streams or the SPL compiler to be aware of the location of the toolkit. You must also install IBM Operational Decision Manager (ODM) Decision Server and ensure that ODM J2SE jars are accessible to your streams processing applications by setting the ODM_HOME environment variable.

Before you begin

  • Install IBM InfoSphere Streams. Configure your local shell environment. For example, enter the following command:
      source product-installation-root-directory/4.0.0.0/bin/streamsprofile.sh
  • Install ODM Decision Server. For installation instructions, see the ODM documentation. For example: ODM Version 8.7 documentation.

  • Ensure that JAR files in the following directory are accesible by InfoSphere Streams: ODM-installation-directory/executionserver/lib.

Procedure

  1. Set the ODM_HOME environment variable by running the following command:
      export ODM_HOME=Directory_that_contains_executionserver_dir
  2. Develop your application. InfoSphere Streams Studio can help you create and debug SPL and SPL mixed-mode applications. To use the operators from the Rules Toolkit, you must add the toolkit location. To avoid the need to fully qualify the operators, add a use directive in your application. For example, add the following clause in your SPL source file:
       use com.ibm.streams.rules::*;
    You can also specify a use directive for individual operators by replacing the asterisk with the operator name. For example:
       use com.ibm.streams.rules.odm::ODMRulesetExecutor;
  3. Build your application. You can use the sc command or Streams Studio.
    • To build the application in Streams Studio, you must add the toolkit location if you did not already do so.
    • To build the application from the command line, you must configure the SPL compiler to find the root directory of the toolkit. Use one of the following methods:
      • Set the STREAMS_SPLPATH environment variable to the root directory of a toolkit or multiple toolkits (using a colon (:) as a separator). For example:
        export STREAMS_SPLPATH=$STREAMS_INSTALL/toolkits/com.ibm.streams.rules
      • Specify the -t or --spl-path command parameter when you run the sc command. For example:
        sc -t $STREAMS_INSTALL/toolkits/com.ibm.streams.rules -M MyMain
      Note: These command parameters override the STREAMS_SPLPATH environment variable.
  4. Start the InfoSphere Streams instance.
  5. Run the application. You can submit the application as a job by using the streamtool submitjob command or by using Streams Studio.