Developing and running applications that use the Rules Toolkit
Specialized toolkits - release 4.3.1.0-prod20190605 > com.ibm.streams.rules 2.1.2 > Developing and running applications that use the Rules Toolkit
To create applications that use the Rules Toolkit operator, you must configure either IBM 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 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 IBM Streams: ODM-installation-directory/executionserver/lib.
Procedure
- Set the ODM_HOME environment variable by running the following command:
export ODM_HOME=Directory_that_contains_executionserver_dir
- Develop your application. IBM 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:
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::*;
use com.ibm.streams.rules.odm::ODMRulesetExecutor;
- 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
- Set the STREAMS_SPLPATH environment variable to the root directory of a toolkit or multiple toolkits (using a colon (:) as a separator). For example:
- Start the IBM Streams instance.
- Run the application. You can submit the application as a job by using the streamtool submitjob command or by using Streams Studio.