Running rulesets that are deployed to a database
Specialized toolkits - release 4.3.1.0-prod20190605 > com.ibm.streams.rules 2.1.2 > Running rulesets that are deployed to a database
When an IBM Operational Decision Manager (ODM) developer deploys a rules application to a database, the rulesets in the rules application are deployed as tables in the database.
Procedure
- In your SPL application, use the ODMRulesetExecutor operator and specify the following parameters that are required for running rulesets that are deployed to a database.
- The driverName parameter that specifies the name of the database driver.
- The driverPath parameter that specifies the location of the JAR file that contains the database driver.
- The databaseURL parameter that specifies the URL of the database.
- The userName parameter that specifies the name of the user.
- The userPassword parameter specifies the password for the user.
- In addition, you must specify the mandatory parameter rulesetPath and any other optional operator parameters that are required for your application.
- Develop and run the application.
Examples
composite DB2Deployment{
graph
(stream<rstring strVal> Beacon_1_out0) as Beacon_1 = Beacon() {}
(stream<rstring strVal> ODMRulesetExecutor_2_out0)
as ODMRulesetExecutor_2 = ODMRulesetExecutor(Beacon_1_out0) {
param
rulesetPath : "/ruleapp/rules" ;
driverName:"com.ibm.db2.jcc.DB2Driver";
userName:"userName";
userPassword:"db2password";
databaseUrl:"jdbc:db2://hostname:port/dbname";
driverPath:
"directory_where_database_driver_db2jcc.jar_is_located_which_is_accessible_to_IBM_Streams";
}
() as Custom_3 = Custom(ODMRulesetExecutor_2_out0) {}
}