ibmwebsphere operational decision management …...ibmwebsphere operational decision management...
TRANSCRIPT
IBM WebSphere Operational Decision ManagementVersion 8 Release 0
Configuring Decision Server Rules
���
NoteBefore using this information and the product it supports, read the information in “Notices” on page 153.
This edition applies to version 8, release 0, modification 0 of WebSphere Operational Decision Management and toall subsequent releases and modifications until otherwise indicated in new editions.
© Copyright IBM Corporation 2008, 2012.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.
Contents
Configuring Decision Server Rules . . . 1Configuring Rule Designer in Eclipse . . . . . . 1
Extending Eclipse with the Rule Designer updatesites . . . . . . . . . . . . . . . . 1Changing the JVM used by Rule Designer . . . 3
Configuring Rule Execution Server . . . . . . . 3Configuring Rule Execution Server on Java SE . . 3
Before you configure Rule Execution Server onJava SE . . . . . . . . . . . . . . 3Configuring the execution stack on Java SE . . 4Changing the persistence mode . . . . . . 4Database driver issues . . . . . . . . . 5
Configuring Rule Execution Server on WebSphereApplication Server . . . . . . . . . . . 5
Configuring Rule Execution Server onWebSphere Application Server for distributed . 5
Before you start . . . . . . . . . . 5Step 1: Selecting and applying thepersistence type . . . . . . . . . . 7Step 2: Enforcing database user permissions 7Step 3: Creating an empty database schema 8Step 4: Setting up a data source andconnection pool . . . . . . . . . . 9Step 5: Activating security on WebSphereApplication Server . . . . . . . . . 14Step 6: Deploying the Rule ExecutionServer Management EAR . . . . . . . 17Step 7: Populating a Rule Execution Serverdatabase . . . . . . . . . . . . 18Step 8: Deploying the Rule ExecutionServer MBean descriptors. . . . . . . 25Step 9: Deploying the XU RAR . . . . . 25Step 10: Deploying the hosted transparentdecision service EAR . . . . . . . . 27Step 11: Setting the DecodeUrlAsUTF8custom property . . . . . . . . . . 29Step 12: Verifying the deployment andconfiguration . . . . . . . . . . . 29Optional configuration steps. . . . . . 30Troubleshooting Rule Execution Server . . 42
Configuring Rule Execution Server onWebSphere Application Server for Linux onSystem z . . . . . . . . . . . . . 45
Before you start . . . . . . . . . . 45Step 1: Setting up the DB2 database . . . 46Step 2: Creating a JDBC provider . . . . 47Step 3: Setting up Java 2 connectionsecurity. . . . . . . . . . . . . 48Step 4: Creating a data source andconnection pool . . . . . . . . . . 48Step 5: Creating users and groups . . . . 49Step 5a: Mapping the resAdministratorsand resDeployers groups to the Monitorrole . . . . . . . . . . . . . . 50Step 6: Deploying the Rule ExecutionServer Management EAR . . . . . . . 51
Step 7: Populating the RESDB database . . 52Step 7a: Testing the connection to thedatabase . . . . . . . . . . . . 57Step 8: Deploying the Rule ExecutionServer MBean descriptors. . . . . . . 58Step 9: Deploying the XU RAR . . . . . 58Step 10: Deploying the hosted transparentdecision service EAR . . . . . . . . 60Step 11: Setting the DecodeUrlAsUTF8custom property . . . . . . . . . . 61Step 12: Verifying the deployment andconfiguration . . . . . . . . . . . 62Optional configuration steps. . . . . . 63Troubleshooting Rule Execution Server . . 75
Configuring Rule Execution Server usingprofile templates. . . . . . . . . . . 78
Rule Execution Server profile templates . . 78Configuring Rule Execution Server on anew profile . . . . . . . . . . . 79Augmenting an existing profile with RuleExecution Server. . . . . . . . . . 81Configuring Rule Execution Server for highavailability and scalability . . . . . . 83
Configuring Rule Execution Server on Tomcat 7.0 89Before you start . . . . . . . . . . . 89Step 1: Selecting and applying the persistencetype . . . . . . . . . . . . . . . 90Step 2: Enforcing database user permissions 91Step 3: Creating an empty database schema . 92Step 4: Deploying the management RuleExecution Server WAR . . . . . . . . 93Step 5: Populating a Rule Execution Serverdatabase . . . . . . . . . . . . . 94
Populating a database by using the RuleExecution Server Console . . . . . . . 94Populating a database by running SQLscripts . . . . . . . . . . . . . 98
Step 6: Deploying the hosted transparentdecision service. . . . . . . . . . . 100Step 7: Verifying the configuration . . . . 102Optional configuration steps . . . . . . 102
Repackaging the Rule Execution Serverarchive using Ant . . . . . . . . . 102Configuring Rule Execution Server indifferent environments . . . . . . . 103
Troubleshooting . . . . . . . . . . 104Rule Execution Server database driverissues . . . . . . . . . . . . . 104Providing more memory for applications 105
Configuring Rule Execution Server on JBoss 5and 6.1 . . . . . . . . . . . . . . 105
Before you start . . . . . . . . . . 105Step 1: Selecting and applying the persistencetype . . . . . . . . . . . . . . 107Step 2: Enforcing database user permissions 107Step 3: Creating an empty database schema 108
© Copyright IBM Corp. 2008, 2012 iii
Step 4: Creating a data source and connectionpool . . . . . . . . . . . . . . 108Step 5: Configuring security . . . . . . 110Step 6: Deploying the Rule Execution Servermanagement EAR . . . . . . . . . . 111Step 7: Populating a Rule Execution Serverdatabase . . . . . . . . . . . . . 112
Populating a database by using the RuleExecution Server console . . . . . . 112Populating a database by running SQLscripts . . . . . . . . . . . . . 117
Step 8: Deploying the Execution Unit (XU)RAR file . . . . . . . . . . . . . 118Step 9: Deploying the hosted transparentdecision service. . . . . . . . . . . 119Step 10: Verifying the configuration . . . . 120Optional configuration steps . . . . . . 121
Repackaging the Rule Execution Serverarchive using Ant . . . . . . . . . 121Configuring Rule Execution Server indifferent environments . . . . . . . 121Rule Execution Server deployment forhigh availability and scalability . . . . 122
Troubleshooting . . . . . . . . . . 124Configuring the XU memory profiler . . 124Rule Execution Server database driverissues . . . . . . . . . . . . . 125Providing more memory for applications 126
Configuring Rule Execution Server on WebLogic10.3.2 . . . . . . . . . . . . . . . 126
Before you start . . . . . . . . . . 126Step 1: Selecting and applying the persistencetype . . . . . . . . . . . . . . 128Step 2: Enforcing database user permissions 128Step 3: Creating an empty database schema 129Step 4: Creating a data source and connectionpool . . . . . . . . . . . . . . 129Step 5: Configuring security . . . . . . 131
Adding a new group . . . . . . . . 131Adding a new user . . . . . . . . 131
Denying WebLogic Server administratorrights to the resAdmin user . . . . . 133
Step 6: Deploying the Rule Execution ServerManagement EAR . . . . . . . . . . 134Step 7: Populating a Rule Execution Serverdatabase . . . . . . . . . . . . . 135
Populating a database using the RuleExecution Server console . . . . . . 135Populating a database using the SQLscripts . . . . . . . . . . . . . 139
Step 8: Enabling Anonymous Admin ServerLookup for MBeans . . . . . . . . . 140Step 9: Deploying the XU (Execution Unit)RAR . . . . . . . . . . . . . . 141Step 10: Deploying the hosted transparentdecision service EAR . . . . . . . . . 142Step 11: Verifying the configuration . . . . 143Optional configuration steps . . . . . . 144
Repackaging the Rule Execution Serverarchive using Ant . . . . . . . . . 144Configuring Rule Execution Server indifferent environments . . . . . . . 144Rule Execution Server deployment oncluster environments . . . . . . . . 145
Troubleshooting . . . . . . . . . . 148Configuring the XU memory profiler . . 148Rule Execution Server database driverissues . . . . . . . . . . . . . 149Providing more memory for applications 149
Configuring Rule Execution Server in sharedmode . . . . . . . . . . . . . . . 150Configuring Rule Execution Server in scopedmode . . . . . . . . . . . . . . . 151
Notices . . . . . . . . . . . . . . 153Trademarks . . . . . . . . . . . . . . 155
Index . . . . . . . . . . . . . . . 157
iv IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Configuring Decision Server Rules
You can configure how and where Rule Designer runs in Eclipse after you haveinstalled Decision Server. You deploy and configure the provided archives for thesupported application servers in order to test and execute your rule applications inthe environment that you use in production.
Configuring Rule Designer in EclipseAfter installing the product, and if you have not done so at installation time, youcan extend an existing Eclipse with Rule Designer. You can also change the JVMthat Rule Designer uses.
Extending Eclipse with the Rule Designer update sitesYou can use update sites to install Rule Designer on an existing Eclipseenvironment after installing the product.
Before you begin
To install Rule Designer in an existing Eclipse installation, you must make surethat you have the required plug-ins.
The ZIP files for the update sites are available if you have selected thecorresponding option in Installation Manager.
About this task
During the installation of WebSphere® Operational Decision Management inInstallation Manager, you can extend an existing Eclipse. However, if you have notdone so at installation time, you can use the update sites provided in thedistribution to extend your Eclipse environment. The installation process is to addthe Rule Designer plug-ins from an installation of WebSphere Operational DecisionManagement into your Eclipse.
Note:
If you install Rule Designer in an Eclipse environment that uses a non-Englishlocale:v The Eclipse messages remain in that language.v If Rule Designer provides the verbalizer for the language, you can create rule
artifacts in this language. If there is no verbalizer for this language, the ruleartifacts that you create are in English.
v Rule Designer messages appear in the non-English locale if it is supported,otherwise they appear in English.
v To change the locale, so that everything is in English, add the osgi.nl=en_USproperty to the <Eclipse_InstallDir>/configuration/config.ini file, and thenrestart Rule Designer.
© Copyright IBM Corp. 2008, 2012 1
Procedure1. In the configuration/config.ini file of your Eclipse installation, add the
IBM_DS_HOME property to define the variable to the Decision Server installationdirectory.The installation directory contains the components for Decision Server such asexecutionserver and studio.For example, IBM_DS_HOME=C:/Program Files/IBM/WODM80 or C:/ProgramFiles/IBM/WODM80/WODM depending on your installation.You can copy this property from the configuration/config.ini file providedwith the installation of Decision Server.
2. Start Eclipse or a supported IBM® Eclipse-based product.3. Switch to the Java perspective (click Window > Open Perspective > Java).4. Click Help > Install New Software.5. Add the sites to install:
a. In the Install wizard, next to the Work with field, click Add.b. In the Add Repository dialog, click Archive.c. Browse to the <InstallDir>/studio/update-sites directory, click Open,
and select designer-base-update-site.zip.InstallDir refers to your installation directory.
d. In the Name field, enter a name for the site, and then click OK.This might take a few seconds.
e. Proceed the same way to add the rule-designer-update-site.zip updatesite.
6. In the Work with field, select All Available Sites from the list.7. Expand the Business rules and events category, and select IBM WebSphere
Decision Server Designer Base and IBM WebSphere Decision Server RuleDesigner.
8. Click Next.Eclipse calculates the dependencies and requirements.
9. In the Install dialog, click Next, select I accept the terms of the licenseagreement, and click Finish.The installation may take a few seconds to complete. If a security warningabout the validity of the software opens, click OK to proceed with theinstallation.
10. Click Restart Now if you are prompted to restart Eclipse.
What to do next
You can also install the following update sites the same way. These update sites areoptional:v IBM WebSphere Decision Server Rule Designer Samples:
– rule-designer-samples-update-site.zip
v IBM WebSphere Decision Server Scorecard Modeler:– scorecard-update-site.zip
v IBM WebSphere Decision Server COBOL management update sites:– cobol-importer-license-update-site.zip
– cobol-importer-update-site.linux.zip (for installation on Linux)– cobol-importer-update-site.win32.zip (for installation on Windows)
2 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
– cobol-update-site.zip
Tip:
You can check what you have installed by clicking Help > Install New Software,and then clicking the What is already installed? link.
Changing the JVM used by Rule DesignerYou can change the JVM used by Rule Designer.
About this task
On Windows, by default the WebSphere Operational Decision Managementinstaller installs the IBM Java Virtual Machine (JVM) with Rule Designer. However,you can select a different JVM during or after installation. On UNIX, you mustselect a JVM during installation.
You can change the JVM used by Rule Designer on an existing installation ofWebSphere Operational Decision Management. The Rule Designer shortcut runsEclipse using the JVM specified in the <Eclipse_InstallDir>\eclipse.ini file.
Note:
v You can also use the -vm and -vmargs in the command line of the eclipse.exefile.
v To run on Sun Hotspot Virtual Machines, Rule Designer needs a PermGen sizeof at least 128 MB. Use the --launcher.XXMaxPermSize parameter. For moreinformation, see The Eclipse runtime options.
For more information on how to set the parameters in the eclipse.ini file, seeEclipse.ini.
Procedure1. Change JVM in the <Eclipse_InstallDir>\eclipse.ini file.2. Save the changes.
Configuring Rule Execution ServerTo use Rule Execution Server on any instance of an application server other thanthe Samples Server, you must deploy and configure the provided archives.
Note:
To add execution environments on z/OS®, you must use Decision Server for z/OS.For more information, see Configuring Rule Execution Server on WebSphereApplication Server for z/OS.
Configuring Rule Execution Server on Java SEOn the Java SE platform, the Execution Unit (XU) is deployed as a simple JavaStandard Edition JAR. This implements a lightweight J2C container, which uses theWebSphere Operational Decision Management pooling infrastructure. The resourceis scoped to a client application.
Before you configure Rule Execution Server on Java SEReview important information about installing Rule Execution Server on Java SE.
Configuring Decision Server Rules 3
In Java SE if the management stack is not used in the same JVM and the same JMXMBean server, RuleApp management using Ant, API, or JMX should be performedwith caution as the Rule Execution Server Console will not be up-to-date withmodifications to the persisted resources.
The procedure to install Rule Execution Server typically involves:v “Configuring the execution stack on Java SE.”v “Changing the persistence mode.” If required, create your database and SQL
table and JDBC access with JNDI lookup.
Note:
If you choose to work with Java SE, be aware of the following limitations:v The Execution Unit (XU) is not shared. Therefore, it consumes more memory.v XU pooling is only configured through the ra.xml deployment descriptor.v Only Java SE rule sessions are available, there are no EJBs or message-driven
rule beans (MDB) execution components:– No remote EJB call from the client– No JMS support– No transaction support: you need to implement your own transaction
management logic as EJB does.
In addition, if you use Java SE in a Web container there are a number oflimitations:v No Rule Execution Server Console
– No deployment from Rule Designer or Decision Center– No cluster support– No execution statistics (monitoring)
v No hosted transparent decision servicesv No Decision Validation Services
Configuring the execution stack on Java SEConfigure the execution stack by setting the class path in your Ant script.
Procedure1. Set the executionserver.home property:
<property name="executionserver.home" value="<InstallDir>/executionserver"/>
2. Import the classpath-executionserver.xml file:<import file="${executionserver.home}/lib/classpath-executionserver.xml"/>
3. Set the path for the executionserver.j2se.classpath property.The execution.j2se.classpath property defines all the JARs needed to executeRule Execution Server on Java SE.
Changing the persistence modeChange the persistence mode.
4 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
About this task
To change the persistence mode, modify the resource adapter descriptor file, thenadd it to your class path.
The deployment descriptor includes comments to help you configure the file toyour needs. The properties to change to modify persistence are:v persistenceTypev persistenceProperties
For information on creating archives configured with a persistence type, refer tothe ressetup.xml Ant script.
Procedure1. To change the execution stack from the default file persistence modify the
resource adapter descriptor file ra.xml located in:<InstallDir>/executionserver/bin
2. After you have configured this file, add it to your class path. At run time,ra.xml overrides the default_ra.xml file provided in jrules-res-execution.jar.
Database driver issuesThe JDBC Not Bound error message is issued when an error occurs during thecreation of the data source.
Refer to the traces to locate the original cause. In the vast majority of cases one ofthe following is likely:v A directory does not exist or cannot be read or written to (Derby).v There is a missing schema or table.v There are missing privileges to access the database resource.
Configuring Rule Execution Server on WebSphere ApplicationServer
To be able to use Rule Execution Server on a new instance of WebSphereApplication Server, you must deploy the provided archives and perform a numberof configuration steps. You can configure a cluster by using a profile template.
Configuring Rule Execution Server on WebSphere ApplicationServer for distributedTo be able to use Rule Execution Server on an instance of WebSphere ApplicationServer, you must deploy the provided archives for this server and perform anumber of configuration tasks.
Before you start:
To configure Rule Execution Server on WebSphere Application Server, you mustfollow specific steps. Some are mandatory, while others are optional or contextual.
The Rule Execution Server console includes an Installation Settings wizard. If youlog on as the administrator, you can use it to create resources in an empty databaseschema and run SQL drop statements that clear an existing Rule Execution Serverdatabase. See Populating a database using the Rule Execution Server console formore information.
Configuring Decision Server Rules 5
For some tasks, you can also run Ant commands, for example to repackage themanagement EAR file.
Note: Specific integration extensions are available from this URL: WebSphereOperation Decision Management Integration SupportPacs
The following table summarizes the steps that you follow to configure RuleExecution Server on WebSphere Application Server, depending on the type ofpersistence that you choose.
Installation StepsPersistence
File Data source JDBC
“Step 1: Selecting and applying thepersistence type” on page 7
Default persistencemode
“Step 2: Enforcing database userpermissions” on page 7
“Step 3: Creating an empty database schema”on page 8
Not applicable
“Step 4: Setting up adata source andconnection pool” onpage 9
“Creating a JDBCprovider” on page 9
Not applicable
“Creating a datasource andconnection pool” onpage 10
Not applicable
“Creating J2Cauthentication data”on page 11
Not applicable
“Setting customproperties” on page12
Not applicable
“Testing theconnection to thedatabase” on page 13
Not applicable
“Step 5: Activatingsecurity onWebSphereApplication Server”on page 14
“Creating users andgroups” on page 14
“Mapping theresAdministratorsgroup to the Monitorrole” on page 16
“Security policies forthe Rule ExecutionServer console” onpage 16
“Step 6: Deploying the Rule Execution ServerManagement EAR” on page 17
“Step 7: Populating a Rule Execution Serverdatabase” on page 18
Not applicable
6 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Installation StepsPersistence
File Data source JDBC
“Step 8: Deploying the Rule Execution ServerMBean descriptors” on page 25
“Step 9: Deploying the XU RAR” on page 25
“Step 10: Deploying the hosted transparentdecision service EAR” on page 27
Optional Optional Optional
“Step 11: Setting the DecodeUrlAsUTF8custom property” on page 29
Required if youdeployed the EAR filefor hosted transparentdecision services(previous step).
Required if youdeployed the EAR filefor hosted transparentdecision services(previous step).
Required if youdeployed the EAR filefor hosted transparentdecision services(previous step).
“Step 12: Verifying the deployment andconfiguration” on page 29
Optional Optional Optional
Step 1: Selecting and applying the persistence type:
You can change the default datasource RuleApp and Java XOM persistencesettings by running an Ant script that generates a new Rule Execution Servermanagement archive.
By default, persistence is set to datasource for both RuleApps and managed JavaXOMs in the deployment descriptor of the Rule Execution Server managementarchive.
To change the persistence settings, the distribution provides an Ant script in the<WODM_InstallDir>/executionserver/bin/ressetup.xml file. Use it to create a newinstance of the Rule Execution Server management archive and, in the case of aJava EE application server, the Execution Unit (XU).
Note:
v If you use file-based persistence on Solaris, your file system must support allcharacters used in directory and file names that are present in the ruleset path(RuleApp name and ruleset name). Set the LANG system property with theencoding that is compatible with your package and rule names, for exampleen_US.UTF-8.
v If you select the file persistence type for RuleApps, you cannot use DecisionWarehouse.
v MySQL persistence: If you choose to use MySQL as a persistence back end, addor set the following properties in the MySQL configuration file my.ini (onWindows) or my.cnf (on UNIX operating systems):sql-mode=STRICT_ALL_TABLESmax_allowed_packet=1073741824
For more information about these settings, see the MySQL 5.0 reference manual:5.1.6. Server SQL Modes and 5.1.3 Server System Variables.
Step 2: Enforcing database user permissions:
If Rule Execution Server data is stored in a database, you can restrict the type ofoperations that a user can perform on a database by defining access privileges.
Configuring Decision Server Rules 7
The data source that contains the Rule Execution Server data is always mapped toa database user.
Note:
The database privilege types differ across the supported databases. Defining andassigning privileges is performed by a database administrator.
Any privilege listed in the table as Not required denotes that it is not required bythe Rule Execution Server data source.
The following table highlights the database permissions that you must enforce fordatabase users, with attention given to the type of operation that you want them toperform:
Database permission
Operation
Browse and editrulesets/ruleApps(resAdmin)
Create the Rule ExecutionServer schema
CREATE ANY INDEX Not required Required
DROP ANY INDEX Not required Required
CREATE ANY SEQUENCE Not required Required
DROP ANY SEQUENCE Not required Required
SELECT ANY SEQUENCE Required Not required
CREATE ANY TABLE Not required Required
DROP ANY TABLE Not required Required
INSERT ANY TABLE Required Not required
SELECT ANY TABLE Required Not required
UPDATE ANY TABLE Required Not required
DELETE ANY TABLE Required Not required
CREATE ANY TRIGGER Not required Required
CREATE ANY VIEW Not required Required
DROP ANY VIEW Not required Required
Step 3: Creating an empty database schema:
Use SQL scripts to create a dedicated schema in the database if you are usingdatabase persistence.
About this task
v If you set persistence to file in “Step 1: Selecting and applying the persistencetype” on page 7, you can skip all the database-related tasks and proceed to“Step 6: Deploying the Rule Execution Server Management EAR” on page 17.
v If you use the default persistence (datasource) or you set persistence to jdbc,you must create a empty dedicated database schema and then populate thedatabase.
In this procedure, the WebSphere Application Server installation home directory isC:/Program Files/IBM/WebSphere/AppServer.
8 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
1. To create an empty database schema, follow the procedure below, which goesthrough the steps for a Derby database as an example.You create a Derby database schema in one of the following ways:v By setting a custom property: After you have defined the Derby data source,
you modify the createDatabase custom property and set it to create. Thedatabase is created by the first database connection.
v From the command line: follow the steps below.2. To populate the database with tables, views, and so on, continue to “Step 6:
Deploying the Rule Execution Server Management EAR” on page 17, and thento “Step 7: Populating a Rule Execution Server database” on page 18.
To create a Derby database schema:
Procedure
1. Stop the application server.2. Launch <WasInstallDir>/derby/bin/embedded/ij.bat or ij.sh.3. Create the database and connect to it.
For example, to create the new database resdb as the user resAdmin andconnect to it, use the following command:ij>connect ’jdbc:derby:<WasInstallDir>/derby/databases/resdb;user=resAdmin;password=resAdmin;create=true’;
4. Close the ij utility.ij> quit;
5. Start the application server.Related information:“Step 1: Selecting and applying the persistence type” on page 7You can change the default datasource RuleApp and Java XOM persistencesettings by running an Ant script that generates a new Rule Execution Servermanagement archive.“Step 2: Enforcing database user permissions” on page 7If Rule Execution Server data is stored in a database, you can restrict the type ofoperations that a user can perform on a database by defining access privileges.“Setting custom properties” on page 12The database to which you want to connect might require that you set somecustom properties.
Step 4: Setting up a data source and connection pool:
You must create a JDBC provider (data source) and connection pool for WebSphereApplication Server.
Creating a JDBC provider:
To enable Rule Execution Server, you create a JDBC provider in WebSphereApplication Server, as the first step in creating a data source.
About this task
The first step in creating a data source, based on the database schema that youhave created in “Step 3: Creating an empty database schema” on page 8, is tocreate a JDBC provider.
Configuring Decision Server Rules 9
Note:
v Some drivers (such as Oracle OCI drivers) need to access additional libraries atrun time (.dll or .so files). As a consequence, you must set up your workingenvironment to access these libraries (PATH, LD_LIBRARY_PATH, and so on).
v You can install the JDBC provider on the cell, node, cluster, or server level. Thisprocedure documents installation at node level.
Procedure
1. Log in to the Integrated Solutions Console.2. In the panel, open Resources > JDBC and click JDBC Providers.3. In the panel, under Scope select the Node=xxx, Server=yyy, where xxx is the
name of your node and yyy the name of your server, and then click New.4. In Step 1, select the database type, provider type, and an implementation type
that supports XA features. For example:
Option Description
Database type Derby
Provider type Derby JDBC Provider
Implementation type XA data source: Enter a name, for exampleRule Execution Server JDBC Provider.
5. Click Next.6. Skip Step 2.
A summary is provided in Step 3.7. Check that the class path to the JAR file of your driver and the implementation
class are correct.Default values are usually sufficient.
8. Click Finish and Save to save the changes to the master configuration, makingsure that the Synchronize changes with Nodes check box is selected.
9. Restart your server to have these changes taken into account.Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Creating a data source and connection pool:
Create a connection pool and a data source in WebSphere Application Server toenable Rule Execution Server.
About this task
After you have created your JDBC provider, you can create a data source andconnection pool.
Procedure
1. In the Integrated Solutions Console, open Resources > JDBC and Datasources.
2. In the Scope side panel, select the scope that you selected for the JDBCprovider in “Creating a JDBC provider” on page 9.
10 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
3. In Step 1, enter a name for the data source in the Data source name field andjdbc/<your_data_source_name> in the JNDI name field, and click Next.
Important: The name of the data source is not important here, but in the JNDIname, you must reuse the data source name that you entered. For example, ifyou entered resdatasource as the data source name, set the JNDI name tojdbc/resdatasource. Otherwise, Rule Execution Server cannot use the datasource.
4. In Step 2, choose Select an existing JDBC provider, select the JDBC providerthat you created in “Creating a JDBC provider” on page 9 and click Next.
5. In Step 3, enter the specific database properties for the data source.Typically, the full path to the database C:/Program Files/IBM/WebSphere<version_number>/AppServer/derby/databases/resdb or${USER_INSTALL_ROOT}/derby/databases/resdb).
6. Deselect Use this data source in container managed persistence (CMP).7. Click Next.8. In Step 4, set up any required security aliases and click Next when done.
In Step 5, a summary of the data source is provided.9. Click Finish and then Save to save the changes to the master configuration.Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Creating J2C authentication data:
In WebSphere Application Server, you can secure your enterprise informationsystem by creating J2C authentication data.
About this task
After you have created your data source and connection pool, you create the J2Cauthentication data. J2C is a secure mechanism for integrating enterpriseinformation systems to an application server and enterprise applications.
This step uses resAdmin as the user ID and resAdmin as the password. Your user IDand password might be different, depending on the user or schema that is used toexecute the Rule Execution Server SQL script. If you perform the step as described,tables are created under the resAdmin schema.
In the case of a Derby database, if the connect command does not contain the userID, then the user ID and password use the default values APP and APP. If youcreate the tables under the APP schema, you do not need to perform this step.
Procedure
1. In the Integrated Solutions Console, open Resources > JDBC and Datasources.
2. Click resdatasource.3. Under Related Items, click JAAS - J2C authentication data.4. Click New and set the fields Alias, User ID, and Password. For example, this
procedure uses the following values:v Alias: ResDerbyUser
Configuring Decision Server Rules 11
v User ID: resAdminv Password: resAdmin
5. Click Apply and Save to save directly to the master configuration.6. Open Resources > JDBC and Data sources and click resdatasource.7. In the Security settings section, for Component-managed authentication alias,
select the <NodeName>/ResDerbyUser alias, where <NodeName> is the name of theWebSphere Application Server node on which you are configuringRuleExecution Server.
8. For Container-managed authentication alias, select <node name>/ResDerbyUser.9. Click Apply and Save to save directly to the master configuration.Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Setting custom properties:
The database to which you want to connect might require that you set somecustom properties.
About this task
Depending on the database to which you want to connect, you have differentproperties to define. The table below presents the minimum set of propertiesrequired to define the supported databases. If the driver that you use is not listed,check the WebSphere Application Server documentation for more information.
Note: Some of these properties might have be already defined. For example, if youare following this configuration procedure and have created a Derby database, allthe properties for that database have already been defined.
Table 1. Database driver properties
Database Properties
DB2® UniversalJDBC Driver
v databaseName: The actual database name if driverType is set to 4,or a locally catalogued database name if driverType is set to 2
v driverType: The possible values are 2 or 4. The followingproperties are required only if driverType is 4:
– serverName: The TCP/IP address or host name
– portNumber: The TCP/IP port number
DB2 Universal JDBCXA Driver
v databaseName: The locally catalogued database name
v driverType: The possible values are 2 or 4. If you are running aversion of DB2 earlier than DB2 V8.1 FP6, you are restricted tousing only Type 2 driver. The following properties are requiredonly if driverType is 4:
– serverName: The TCP/IP address or host name
– portNumber: The TCP/IP port number
DB2 legacyCLI-based Type 2
databaseName: for example, Sample
Oracle JDBC Driver URL: For example, jdbc:oracle:oci:@sample
Derby databaseName: The path to the location of the database files. Formore information, refer to the Derby documentation.
12 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
You can also set custom properties for any of the resources listed in the Customproperties page.
Procedure
1. In the Integrated Solutions Console, open Resources > JDBC and click Datasources.
2. Click the data source that you want to customize.3. Under Additional Properties, click Custom properties.4. Change an existing property or create a new one by clicking New.
a. Click createDatabase.The General Properties page opens.
b. Type createcreate in the Value field.
For example, for a Derby data source, if you have not created the database yet,you can set the value of the createDatabase property to create. The database iscreated at the first database connection.
5. Click OK and Save to save the changes to the master configuration.Related information:“Step 1: Selecting and applying the persistence type” on page 7You can change the default datasource RuleApp and Java XOM persistencesettings by running an Ant script that generates a new Rule Execution Servermanagement archive.“Step 2: Enforcing database user permissions” on page 7If Rule Execution Server data is stored in a database, you can restrict the type ofoperations that a user can perform on a database by defining access privileges.“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Testing the connection to the database:
After you have created a data source and connection pool, and set the customproperties, you can test the connection to your database.
Procedure
1. In the Integrated Solutions Console, open Resources > JDBC and click Datasources.
2. Select the check box next to the data source that you want to test and click Testconnection.
Results
The status of the connection is indicated at the top, as shown in the followingexample.
ExampleThe test connection operation for data source resdatasource on serverserver1 at node <NodeName> was successful.
Configuring Decision Server Rules 13
Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Step 5: Activating security on WebSphere Application Server:
WebSphere Application Server provides security infrastructure and mechanisms toprotect sensitive Java EE resources and administrative resources and to addressenterprise end-to-end security requirements on authentication, resource accesscontrol, data integrity, confidentiality, privacy, and secure interoperability.
Introduction to WebSphere Application Server security:
In WebSphere Application Server, security is organized in layers, from the platformsecurity up to the WebSphere Application Server-specific layer, based on the JavaEE model, over the Java security layer.
The following diagram shows the security layers in WebSphere Application Server.
WebSphere Application Server supports the Java EE model for creating,assembling, securing, and deploying applications.
By default, the Rule Execution Server console does not require security inWebSphere Application Server. However, to activate access control for RuleExecution Server in WebSphere Application Server, follow these steps:1. “Creating users and groups”: If you do not already have groups and users
defined or if you want define new groups and users, proceed with thesubsequent steps. If you already have groups and users defined that can matchthe expected role, you will proceed to connect them to the roles during theapplication deployment.
2. “Mapping the resAdministrators group to the Monitor role” on page 16
Creating users and groups:
14 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Create users and groups and assign them roles using a user registry with afederated repository.
Before you begin
If you do not have groups and users defined or if you want to define new groupsand users, proceed with the following steps. If you already have suitable groupsand users defined, skip this procedure and connect users to their appropriate roleswhen you deploy your applications.
About this task
WebSphere Application Server uses various kinds of user registries: OS, LDAP, orCustom. To configure a federated repository as a user registry, you work from theWebSphere Application Server Integrated Solutions Console.
Procedure
1. In the side panel, open Security > Global security.2. Configure the repository security as follows:
v If Federated repositories is already selected under Current realmdefinition, make sure that Enable application security is selected. If youselect Enable application security, you must click Apply and Save to savethe changes to the master configuration.
v If Federated repositories is not already selected, click SecurityConfiguration Wizard, and then complete the wizard as follows:
a. In Step 1, to specify the level of protection, select Enable applicationsecurity and click Next.
b. In Step 2, select Federated repositories and click Next.c. In Step 3, type a name in the Primary administrative user name field and
enter websphere in the Password field, and then click Next.d. In Step 4, review the security configuration summary and click Finish.e. Click Save to save the changes to the master configuration.f. Restart WebSphere Application Server.
Then you must log in to the Integrated Solutions Console as the primaryadministrative user.
3. In the side panel, open Users and Groups > Manage Groups, and then clickCreate.
4. Enter resAdministrators as the group name, then click Create.5. Click Create Like and create another group named resDeployers. Click
Create.6. Click Create Like again and enter another group named resMonitors. Click
Create, then click Close.7. In the side panel, open Users and Groups > Manage Users and then click
Create.8. Enter resAdmin as the User ID and again resAdmin as the password. Also
specify the given name and last name.9. Click Group Membership and proceed as follows:
a. Select the resAdministrators, resDeployers and resMonitors groups.b. Click Add.c. Click Close, then click Create and Close again.
Configuring Decision Server Rules 15
10. Create users with deployer and monitor roles as follows:a. Create another user named resDeployer with password resDeployer.b. Assign the user to the resDeployers and resMonitors groups.c. Create a user named resMonitor with password resMonitor.d. Assign the user to the resMonitors group.
11. Restart your application server or your deployment manager.Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.“Security policies for the Rule Execution Server console”To be able to record and manage sets of MBeans, you need to override theWebSphere Application Server security policies for the Rule Execution Serverconsole.
Mapping the resAdministrators group to the Monitor role:
You can give Rule Execution Server users access to the model MBeans by mappingthe custom resAdministrators group to the Monitor role.
About this task
To access the MBeans of the Rule Execution Server model, an application musthave sufficient security credentials, restricted to the Monitor role in the WebSphereApplication Server authentication system.
You can give Rule Execution Server users access to the model MBeans byconfiguring a mapping between the resAdministrators group declared in thecustom registry and the Monitor role.
Procedure
1. In the Integrated Solutions Console, open Users and Groups >Administrative group roles.
2. Click Add.3. For Role(s), select Monitor, click Search, and move the entry beginning with
resAdministrators from the Available column to the Mapped to role column,and then click OK.
4. Click Save to save directly to the master configuration.5. Restart your application server or your deployment manager.Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Security policies for the Rule Execution Server console:
To be able to record and manage sets of MBeans, you need to override theWebSphere Application Server security policies for the Rule Execution Serverconsole.
16 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
When the global security of WebSphere Application Server is activated, the MBeanserver is not accessible from the deployed application. You must override thesesecurity policies for the Rule Execution Server console so that it can record andmanage a set of MBeans.
Rule Execution Server is packaged with a specific policy file, was.policy, whichoverrides the server policies. The was.policy file is packaged in the META-INFdirectory of the jrules-res-management-WAS<version_number>.ear file.
Step 6: Deploying the Rule Execution Server Management EAR:
After you have activated the security, you deploy the Rule Execution Server EARto WebSphere Application Server.
About this task
You deploy the Rule Execution Server management EAR to WebSphere ApplicationServer to apply the persistence type you set in a previous step and you mapsecurity users groups.
Procedure
1. Open the Integrated Solutions Console.2. In the side panel, open Applications > New Application and click New
Enterprise Application.3. In the side panel, select Local file system, browse to the archive file, and click
Next.In production environments, the EAR file is likely to sit on a remote server.v <InstallDir>/executionserver/applicationservers/WebSphere7/jrules-
res-management-WAS7.ear
v <InstallDir>/executionserver/applicationservers/WebSphere8/jrules-res-management-WAS8.ear
4. Select the check box Detailed - Show all installation options and parameters.5. Expand Choose to generate default bindings and mappings, select the check
box Generate Default Bindings, and click Next.6. Click Continue to accept the security warning.7. In Step 1, click Next to accept the default settings.8. In Step 2, proceed as follows:
v If you have only one server, skip Step 2.v If you have more than one server, select the server to which you want to
deploy the application, and then select the check box for ILOG RuleExecution Server Console and click Next.
9. In Step 3 through Step 8, click Next to accept the default settings.10. Click Step 9: Map security roles to users or groups. Here you map security
roles to users and groups, as follows:a. Select the check box next to the resAdministrators role.b. Click Map groups and click Search. The groups are shown in a column
titled Available.c. Click resAdministrators under Available, then click the arrow button to
move resAdministrators to the Selected column.d. Click OK to return to the Mapping Users to Roles page.
Configuring Decision Server Rules 17
e. Repeat steps 10a on page 17 through 10d on page 17 to map the rolesresDeployers and resMonitors for the other groups, making sure that onlythe check box next to the role that you are assigning is selected.
Role Mapped groups
resAdministrators resAdministrators
resDeployers resDeployers
resMonitors resMonitors
11. Click Next.v On WebSphere Application Server 7, Step 10 provides a summary.v On WebSphere Application Server 8, proceed as follows:a. Click Next.b. In Step 10 and Step 11, click Next to accept the default settings.
Step 12 provides a summary.12. Click Finish.13. After the installation has completed, click Manage Applications at the bottom
of the panel.14. Click ILOG Rule Execution Server.15. Click Manage Modules.16. Click ILOG Rule Execution Server Console.17. Under General Properties, for Class loader order, select Classes loaded with
local class loader first (parent last).18. Click OK, then click Save to save directly to the master configuration.19. In the side panel, open Applications > Application Types > WebSphere
enterprise applications.20. In the Enterprise Applications page, select the check box next to ILOG Rule
Execution Server and click Start to start the application.Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Step 7: Populating a Rule Execution Server database:
After you have created an empty database schema, you can populate the RuleExecution Server database by running SQL scripts, either from the Rule ExecutionServer console or from the SQL tool of your database.
Populating a database using the Rule Execution Server console:
To populate a Rule Execution Server database, you can run the database scriptsfrom the Rule Execution Server console and use the Installation Settings wizard ifyou work on Windows and other supported distributed platforms.
Installation Settings wizard overview:
On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.
18 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
The Rule Execution Server Console contains an Installation Settings wizard. If youare configuring your Rule Execution Server with database persistence and want topopulate your database, you can use the wizard for the following purposes:v Select the type of schema database resources that you want to create.v Create the required resources, in an empty database schema, to use Rule
Execution Server.
Note:
Keep the following points in mind:– Only the users who configure Rule Execution Server from a distributed
platform and Windows can work from the Installation Settings wizard.– You must create the empty database schema on your application server before
you use the Installation Settings wizard.– To open the Installation Settings wizard, you must log in to the Rule
Execution Server Console with administrator rights resAdmin.– To configure the database to store managed Java XOM, you follow the
procedure twice, with a different target database each time.
The Installation Settings wizard creates all the required tables for Rule ExecutionServer and for Decision Validation Services, even if you do not have a license forDecision Validation Services.
Note: If you are using file persistence or have an existing data schema, theInstallation Settings wizard does not open when you log in to the Rule ExecutionServer Console. If you want to modify the database schema having already createdthe database tables, you must run the SQL scripts in the database client.
The combination of persistence settings for RuleApps and managed Java XOMsaffects the way in which you use the Installation Settings wizard.v If the RuleApp persistence and the Java XOM persistence are both set to file:
No wizard is presented.v If the RuleApp persistence and the Java XOM persistence are both set to
datasource: When you sign in to the Rule Execution Server Console, theRuleApp persistence details part of the Installation Settings wizard appears foryou to create the schema for RuleApps and the Decision Warehouse trace. Afteryou have completed this step, the Java XOMs persistence details part of thewizard is displayed for you to configure the database for Java XOM persistence.
v If the RuleApp persistence is set to file and the Java XOM is set to datasource:You see only Java XOMs persistence details and you cannot use the DecisionWarehouse.
v If the RuleApp persistence is set to datasource and the Java XOM is set to fileor is not defined: When you sign in to the Rule Execution Server Console, onlyRuleApp persistence details appears for you to create the schema for RuleApps.The Java XOMs persistence details part of the wizard is not shown.
The following table summarizes the cases.
Configuring Decision Server Rules 19
Persistence
RuleApps
file datasource or jdbc
Java XOMs file No InstallationSettings wizard
RuleAppspersistence detailsonly
datasource or jdbc Java XOMspersistence detailsonly
No DecisionWarehouse
Complete InstallationSettings wizard
Related tasks:“Opening the Rule Execution Server console”To open the Rule Execution Server console and the Installation Settings wizard,you must sign in with resAdministrators rights.
Opening the Rule Execution Server console:
To open the Rule Execution Server console and the Installation Settings wizard,you must sign in with resAdministrators rights.
Before you begin
Read the Installation Settings wizard overview.
Procedure
To open the Rule Execution Server Console and access the Installation Settingswizard:1. Start your database, if you are using data source persistence or you set
persistence to JDBC.2. Open the Rule Execution Server console in a Web browser by typing res at the
root URL on the host machine:v If your browser is not running on the same host as the application server,
replace localhost with the address of the machine.v If the web application is mapped to a host which is defined on a port that is
different from the default of the server, change the port number to the hostport number.
3. Sign in to the Rule Execution Server console as the administrator.For example:
User ID
resAdmin
Password
resAdmin
Results
If you are using database persistence and the database schema is empty, theInstallation Settings wizard opens and you can use it to complete the installation.
20 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Related information:“Installation Settings wizard overview” on page 18On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.“Step 1: Welcome to the Installation Settings wizard”The Installation Settings wizard opens to a Welcome page.
Step 1: Welcome to the Installation Settings wizard:
The Installation Settings wizard opens to a Welcome page.
If you open the Rule Execution Server Console with datasource as the persistencesetting and an empty database schema, the Installation Settings wizard opens.
The wizard can display two parts:v It starts with RuleApp persistence details if you set datasource persistence for
RuleApps, whatever the persistence type for managed Java XOMs.v Java XOMs persistence details is shown after RuleApp persistence details if
you have set datasource persistence for both RuleApps and Java XOMs. In thiscase, you go through the same steps twice.The wizard starts with Java XOMs persistence details if you have set thepersistence type to file for RuleApps and to datasource for managed JavaXOMs.
Both parts of the wizard are similar and you use them in the same way:1.
The Welcome page provides the following information:v Persistence details about the type of database used. This includes information
about the driver and JDBC URL.v A brief description of the purpose of the Installation Settings wizard.v A diagnostic report that provides information about why the persistence
check failed (because you have not yet created the database tables).Click Next to proceed.
2. “Step 2: Choose the database schema”3. “Step 3: Review the database schema” on page 224. “Step 4: The Installation Settings wizard report” on page 23Related tasks:“Opening the Rule Execution Server console” on page 20To open the Rule Execution Server console and the Installation Settings wizard,you must sign in with resAdministrators rights.
Step 2: Choose the database schema:
After you have read the Welcome page, you choose the database schema. Specificsettings are available for DB2. Optionally, you can select a customized SQL script.
Before you begin
You must have created the empty database schema before you use the InstallationSettings wizard.
Configuring Decision Server Rules 21
About this task
After you have read the Welcome page, you select an available Rule ExecutionServer database schema or you upload a custom schema.
Procedure
To choose the database schema:1. In the Database schema selected field, select an available database schema
type.A type that corresponds to the type of database you are using is selected bydefault, but you can choose another type from the drop-down list.If you select a db2 or db2_os390 schema, an extra field displays so that you canenter the name of the buffer pool, which is used to create the DecisionWarehouse tablespace. This buffer pool must have a page size of 32K. Checkthe DB2 documentation for information about how to create a 32K buffer pool.
Note:
The scripts for creating the Decision Warehouse database on DB2 are writtenfor databases that use automatic storage. When you use the Installation Settingswizard, you create both the Rule Execution Server and the Decision Warehousedatabase, so your database must use automatic storage.
If you have not configured your DB2 database to use automatic storage, youcannot use the Rule Execution Server Console to create the Rule ExecutionServer tables.
2. Optional: Select custom if you want to use a customized SQL script, then clickBrowse to select the location of the custom script.
3. Click Next to review the database schema.
Step 3: Review the database schema:
After you have selected a database schema, you confirm the creation of a schemafor Rule Execution Server. You can also use SQL drop statements that flush datafrom an existing table and view the SQL statements.
Before you begin
Before using this option, ensure that you have a backup of database resources.
Procedure
To confirm the creation of a schema:1. Select from the following options:
Create SQL schema “resAdmin”
Select this option to run the SQL statement for the schema type selectedin the previous step.
Keep drop SQL statements
Select this option to flush data from an existing Rule Execution Serverdatabase.
Show SQL statements
22 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Select this option to display the SQL statements.2. Click Execute to start the options that you have selected.
Step 4: The Installation Settings wizard report:
After you have confirmed the database schema, the Installation Settings wizardcreates the schema. A report shows the status of the schema creation.
Procedure
To use the options in the report:1. Click Show execution details to view the list of SQL statements executed.2. Click Finish.
If you have just worked in RuleApps persistence details and the persistencesetting for managed Java XOMs is datasource, the Java XOMs persistencedetails part of the wizard displays now for you to repeat the procedure.
Populating a database by running SQL scripts:
After you have created an empty database schema, you populate the RuleExecution Server database. One way of doing so consists in running SQL scripts.
The script that creates the database schema is namedrepository_<DatabaseName>.sql.
Note:
If you want to use Decision Warehouse, you can also create the required databasetable by running the script trace_<DatabaseName>.sql. If you are also persistingthe Java XOM in a database, you must create these tables by running thexomrepository_<DatabaseName>.sql script.
If you use Command Editor to run the scripts, you must log in with the credentialsyou use for the data source for Rule Execution Server.
Use any tool that can handle SQL to import and run the SQL scripts. The toolsprovided for each database include:
Database Database tool
IBM DB2 DB2 command line processor
Derby ij command line processor
H2 H2 console
HSQL HSQL database manager
MySQL mysql command line processor
Oracle sqlplus command line processor
SQL Server Query Tool
Sybase isql command line processor
To access the database, the database user must be granted the followingcredentials:v A user ID
Configuring Decision Server Rules 23
v A passwordv Complete privileges on the tables and view of the schema (create, insert,
delete)v Privileges for index creation (create index)v On Oracle, additional creation privileges create trigger and create sequence.
When you use an Oracle database, run all the scripts in the SQL Plus client.
When you use DB2, the scripts that create the Rule Execution Server databasetables are written for databases that use automatic storage. The followingconstraints apply:v BP32K is the buffer pool that is expected in SYSCAT.BUFFERPOOLS. If BP32K is not
there, you can use the existing buffer pool or create a new buffer pool namedBP32K. Use the following command to query SYSCAT.BUFFERPOOLS for the existingbuffer pool:Select * from SYSCAT.BUFFERPOOLS
Otherwise, use the following command to create a buffer pool named BP32K:CREATE BUFFERPOOL BP32K SIZE 2000 PAGESIZE 32K
v You must update the trace_db2.sql script and select the custom option in theInstallation Settings wizard to run it. Modify the following line in the script tospecify storage for the tablespace:CREATE TABLESPACE RESDWTS PAGESIZE 32K BUFFERPOOL BP32K;
Here is an example of the tablespace specification in the script:CREATE TABLESPACE RESDWTS PAGESIZE 32K MANAGED BY Database
USING [ FILE ’C:\DB2\Container.file’ 640 ] BUFFERPOOL BP32K;
v You might have to further modify the script based on your database settings.
Running the Derby SQL scripts
This example uses a sample Derby schema to describe the installation of RuleExecution Server. It is assumed that the WebSphere installation home directory isC:/Program Files/IBM/WebSphere/AppServer and the embedded version of Derby isused.
Note:
The following steps are optional if you plan to use a JDBC data source. After youhave defined the Derby data source, you can modify the createDatabase customproperty and set it to create. The database is created by the first databaseconnection.
The following example describes how to create a Derby schema.1. Stop the application server.2. Launch <WAS_InstallDir>/derby/bin/embedded/ij.bat or ij.sh.3. Create and connect to the database. For example, to create and connect to the
new database resdb as the user resAdmin, use the command:ij>connect ’jdbc:derby: <WAS_InstallDir>/derby/databases/resdb;user=resAdmin;password=resAdmin;create=true’;
4. Run the script that creates the database schema:ij> run ’<InstallDir>/executionserver/databases/repository_derby.sql’;
If the script is being run for the first time, some errors related to the dropstatements might occur.
24 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Note: If you have installed Decision Validation Services, you must also createthe required database schema by running the script trace_derby.sql. SeeAdditional steps to configure Decision Validation Services for moreinformation.
5. Close the ij utility:ij> quit;
6. Start the application server.
Step 8: Deploying the Rule Execution Server MBean descriptors:
To configure Rule Execution Server for WebSphere Application Server, you mustalso deploy the MBean descriptors.
Before you begin
Make sure you give the application server process enough access right to read thejrules-mbean-descriptors.jar file. For example, change the permissions on thefile using a chmod 777 command.
About this task
The Rule Execution Server architecture is based on the Java Management Extension(JMX) API. MBeans are Java objects used by the JMX API. To configure RuleExecution Server for WebSphere Application Server, you must deploy the MBeandescriptors, either globally for all Rule Execution Server instances or for a singleRule Execution Server instance.v To deploy globally, copy the <InstallDir>/executionserver/lib/jrules-mbean-
descriptors.jar file to the <WAS_HOME>/lib directory.v To deploy to a targeted server instance, follow the procedure below.
Procedure
To deploy MBean descriptors:1. Open the Integrated Solutions Console.2. In the panel, open Servers > Server Types > WebSphere application servers.3. In the Application servers pane, click the name of your server.4. Under Server Infrastructure, expand Java and Process Management and click
Process definition.
Note: In WebSphere Application Server for z/OS, an additional layer providesthree resources that can be administered: Adjunct, Control, and Servant. If youare working in that environment, select the Servant.
5. Under Additional Properties, click Java Virtual Machine.6. In the Classpath field, add <InstallDir>/executionserver/lib/jrules-mbean-
descriptors.jar.7. Click OK, then Save to save the changes directly to the master configuration.
Step 9: Deploying the XU RAR:
After you have deployed the MBean descriptors, you deploy resource adapterarchive (RAR) for the Execution Unit (XU) onto WebSphere Application Server.
Configuring Decision Server Rules 25
About this task
This phase of the Rule Execution Server configuration consists in deploying theExecution Unit (XU) resource adapter archive (RAR) on WebSphere ApplicationServer and add the properties by which to identify it. The RAR file contains theXU and the persistence layer.
In the following procedure, <version_number> refers to the version of WebSphereApplication Server to which you deploy the XU RAR.
Important:
In some cases, because of your application constraints, you might have to deploythe XU inside the application. It is your decision to choose the appropriatedeployment mode of the XU: either embed it into the EAR or deploy it as a globalconnector. In any case, be aware of the following consequences.v When the XU is deployed as a global connector:
– The deployed Java EE applications might use its third-party libraries (such asASM) instead of the libraries deployed in the application server.
– Use a parent last setting for the XU Java EE application if your Java EEapplication does not support the version of the third-party librariesdistributed with Decision Server. If you cannot use a parent last setting, youmight need to embed the XU into the EAR that executes the rules.
v If you choose an embedded XU packaging, use a parent last setting for thecode library if the third-party libraries version deployed at the level of theapplication-server code library are not compatible with the XU.
Procedure
To deploy the XU RAR:1. Open the Integrated Solutions Console.2. In the panel, open Resources > Resource Adapters and click Resource
adapters, then click Install RAR.3. In the panel, select Local file system and browse to the resource archive file:
<InstallDir>/executionserver/applicationservers/WebSphere<version_number>/jrules-res-xu-WAS<version_number>.rar
4. In Scope, select the node where you want to install the XU RAR file, and thenclick Next.
5. In the General Properties page, set the name for the XU, such as RES XUResource Adapter, and click OK.
6. Navigate to the new XU resource adapter and change the scope to view theadapter.
7. Under Additional Properties, click J2C connection factories and New.8. Enter the following values:
v Name: xu_cfv JNDI name: eis/XUConnectionFactory
9. Click OK and Save to save the changes to the master configuration.10. Optionally, you can define more than one XU resource adapter.
You need additional XU resource adapters when you have more than onenode in your environment or you want to isolate the developmentenvironment and testing environment in one single node. You can deploy a
26 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
JCA resource adapter at any level, depending on the capability of theapplication server. On WebSphere Application Server, you can install the XUresource adapter at the cell, node, cluster, or server level. But you must installit at the node level before you can deploy it at other levels.For example, to define a XU resource adapter on the server level:a. In the panel, open Resources > Resource Adapters and click Resource
adapters, then click Install RAR.b. Select the scope Node=xxx, Server=yyy, where xxx is the name of your
node, yyy is the name of your server.c. Click New and enter the name of the XU as XU.d. In Archive Path, select ${CONNECTOR_INSTALL_ROOT}/jrules-res-xu-
WAS7.rar or ${CONNECTOR_INSTALL_ROOT}/jrules-res-xu-WAS8.rar.e. Click OK.f. Repeat 5 on page 26 through 9 on page 26 to define the connection factory.
11. Restart the server.
Tip:
Whenever you install or uninstall a XU, you must restart your applicationserver.
What to do next
For more information, especially for instructions about packaging a connector intoan EAR or about installing additional XU resource adapters, see one of thefollowing information centers:v WebSphere Application Server Version 7.0 Information Centerv WebSphere Application Server Version 8.0 Information CenterRelated information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Step 10: Deploying the hosted transparent decision service EAR:
You can optionally deploy the EAR file for hosted transparent decision services.
About this task
Optionally, deploy the hosted transparent decision service. To do so, you mustdeploy the EAR file on the same node as the Execution Unit (XU).
Procedure
1. Open the Integrated Solutions Console.2. In the side panel, click Applications > New Application and New Enterprise
Application.3. In the side panel, select Local file system and browse to the archive file, and
then click Next.<InstallDir>/executionserver/applicationservers/WebSphere<version_number>/jrules-res-htds-WAS<version_number>.ear
4. Select the check box Detailed - Show all installation options and parameters.a. Expand Choose to generate default bindings and mappings.
Configuring Decision Server Rules 27
b. Select the check box Generate Default Bindings.c. Click Next.
5. Click Continue to accept the security warning.6. For Step 1 to Step 11, click Next to accept the default settings.
Step 12 provides a summary.7. Click Finish.8. After the installation has completed, click Save to save directly to the master
configuration.9. In the side panel, open Applications > Application Types > WebSphere
enterprise applications and click jrules-res-htds-WAS7 orjrules-res-htds-WAS8.
10. Click Manage Modules.11. Click DecisionService.12. Under General Properties, for Class loader order, select Classes loaded with
local class loader first (parent last).13. Click OK.14. Click OK and Save to save directly to the master configuration.15. In the side panel, open Applications > Application Types > WebSphere
enterprise applications.16. In the Enterprise Applications page, select the check box next to
jrules-res-htds-WAS7 or jrules-res-htds-WAS8, and then click Start to startthe application.
What to do next
The hosted transparent decision service requires that you set the web containercustom property DecodeUrlAsUTF8 to false to support a localized ruleset path.
By default, the ruleset.xmlDocumentDriverPool.maxSize ruleset property value isset to 1. This value could cause a bottleneck if you have several clients executing ahosted transparent decision service concurrently. Increasing the value of thisproperty could significantly increase the performance. To optimize performance,the value should depend on the number of concurrent executions of the ruleset.For example, if you have five concurrent clients, 5 might be a good value.
Set this value from the Ruleset View in the Rule Execution Server console asfollows:1. Click the Explorer tab.2. Click RuleApps in the Navigator panel to display the RuleApps View.3. Click the name of the RuleApp that contains the ruleset in the RuleApps View.4. In the RuleApp View, click the relevant ruleset.5. In the Ruleset View, click Add Property.
A New Ruleset Property form opens.6. Select the predefined property ruleset.xmlDocumentDriverPool.maxSize in the
drop-down list.7. Set the required value.8. Click Add.
28 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Step 11: Setting the DecodeUrlAsUTF8 custom property:
After you have deployed the hosted transparent decision service EAR, you definethe web container custom property DecodeUrlAsUTF8 to support localized rulesetpaths.
About this task
The hosted transparent decision service requires that you set the web containercustom property DecodeUrlAsUTF8 to False to support a localized ruleset path.
Procedure
To set the DecodeUrlAsUTF8 web container custom property:1. Open the Integrated Solutions Console.2. Click Servers > Server Types > WebSphere application servers, then click the
server name.3. Under Container Settings, click Web container settings > Web container.4. Under Additional Properties, click Custom properties.5. Click New and then type DecodeUrlAsUTF8 as the name and False as the value.6. Click Apply and Save to save directly to the master configuration.
Step 12: Verifying the deployment and configuration:
It is good practice to verify that Rule Execution Server has been successfullydeployed and configured by running the diagnostics.
About this task
By running the available diagnostics onto Rule Execution Server, you can verifywhether deployment and configuration have been successful. This step is optionalbut recommended.
Important:
v To let a scalable number of users access resources through the Java components,JCA assigns the task of implementing connection pooling to application servervendors.
v If the diagnostics are performed before any Execution Units (XU) have beenstarted, the test is passed and a message displays to report that no ExecutionUnit (XU) has been initialized.
v On WebSphere Application Server, the pool size is not instantiated beforehandand therefore prevents the server diagnostics from validating a Rule ExecutionServer before the first execution of a rule engine. The diagnostics remain usefulto validate a configuration, especially in a cluster, and to check which ExecutionUnits registered with the management model have been started.
Procedure
To run the Rule Execution Server diagnostics:
Configuring Decision Server Rules 29
1. Open the Rule Execution Server console by typing res at the root URL on thehost machine:http://<machine_name>:<PORT>/res
On WebSphere Application Server for z/OS, the value of <PORT> is likely tobe WC_defaulthost. To find out the value of WC_defaulthost:If security isenabled, the prefix is https://
a. In the Integrated Solutions Console, go to Servers > Server types >Websphere application servers.
b. Click the name of your server.c. Under Communications, click Ports.d. If the web application is mapped to a host that is defined on a different
port, change the port to the host port number.2. Sign in to the Rule Execution Server console.3. In the Rule Execution Server console, click the Diagnostics tab.4. Click Run Diagnostics.
Results
You see a report listing all the diagnostic tests that have just been run. A checkmark is shown next to each test. Click Expand All to show details about all thechecks.
Optional configuration steps:
When configuring Rule Execution Server on WebSphere Application Server forz/OS, you can enhance your configuration with options such as configuringWOLA, integrating WebSphere MQ, setting up a multiserver configuration, ordeploying onto a server cluster.
Integrating WebSphere MQ in WebSphere Application Server to support asynchronousexecution:
If you use the WebSphere MQ messaging provider support in WebSphereApplication Server, you can deploy Java EE applications that directly leverage theenterprise messaging capabilities of WebSphere MQ.
WebSphere MQ integration overview:
The Java Message Service (JMS) API enables access to rule services. To use amessage-driven rule bean, you must create the necessary resources under theWebSphere MQ JMS provider. Both the publish-and-subscribe and thepoint-to-point models are supported.
A Decision Server rule service can be accessed by an asynchronous invocationpattern that uses the Java Message Service (JMS) API. When a JMS messagearrives, the EJB container calls a message-driven rule bean (MDB). The MDB canreside locally or remotely from the client application. In turn, the message-drivenrule bean calls the rulesets that are running in the Execution Unit (XU). The realcall to the rule engine is delegated to a simple rule session.
In WebSphere Application Server, the client application is the scenario running inWebSphere Application Server that calls the rule service, the server is theapplication server where Rule Execution Server is installed. Rule Execution Serveris usually running remotely to the client application.
30 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
To use a Decision Server message-drive rule bean, you must create the necessaryresources under the WebSphere MQ JMS provider at the proper scope for both theclient and the server side to make them visible for the client application and theDecision Server MDB respectively. Decision Server implements both standards ofasynchronous messaging: the Publish-and-Subscribe Model and the Point-to-PointModel. The following procedure demonstrates how to set up both a point-to-pointmessaging model and a publish-and-subscribe model. If you need only one ofthem, you can comment out the resource reference in the deployment descriptor ofDecision Server MDB.
Before installation, you must create the following resources in WebSphere MQ:v Queue: JRulesIn, JRulesOutv Topic: JRulesTopicIn, JRulesTopicOut
Use these resources to submit rule execution requests and obtain execution results.
You must perform the following tasks to integrate WebSphere MQ in WebSphereApplication Server:1. “Creating the WebSphere MQ queue connection factory”2. “Creating the WebSphere MQ input queue” on page 323. “Creating the WebSphere MQ output queue” on page 324. “Creating a topic connection factory” on page 335. “Creating the WebSphere MQ input topic” on page 336. “Creating the WebSphere MQ output topic” on page 347. “Creating the WebSphere MQ queue activation specification” on page 348. “Creating the WebSphere MQ topic activation specification” on page 359. “Installing the message-driven rule bean” on page 36
10. “Enabling server-wide Last Participant Support” on page 37
Creating the WebSphere MQ queue connection factory:
To create the WebSphere MQ queue connection factory, you create the queue, thenyou configure the connection factory by following the connection factory wizard.
Procedure
To create a queue connection factory to connect WebSphere MQ with the DecisionServer MDB:1. Log in to the Integrated Solutions Console.2. Open Resources > JMS and click JMS Providers.3. In the panel, select the WebSphere MQ messaging provider.4. Under Additional Properties, click Queue connection factories.5. Click New.6. In Step 1: Configure basic attributes, set the fields Name and JNDI name as
follows, then Click Next.
Name JRules Queue Connection Factory
JNDI namejms/BRESQueueConnectionFactory
7. In Step 2: Select connection method, select Enter all the requiredinformation into this wizard and click Next.
Configuring Decision Server Rules 31
8. In Step 2.1: Supply queue connection details, type the name of your queuemanager or queue sharing group, then click Next.
9. In Step 2.2: Enter connection details, type the connection details to establish aconnection to the queue manager or queue sharing group, then click Next.The default queue port is 1414.
10. In Step 3: Test connection, click Test connection.If your message queue is running, you see the following message:A connection was successfully made to WebSphere MQ.
11. Click Next.A summary opens showing the details of the connection factory.
12. Click Finish and then click Save to save directly to the master configuration.
Creating the WebSphere MQ input queue:
After you have created the WebSphere MQ queue connection factory, you can nowcreate the JMS queue destination for receiving a request message. To do so, you setthe scope to node or server level, you select the provider, name the queue, andfinally save the configuration.
Procedure
To create the JMS queue:1. In the Integrated Solutions Console, open Resources > JMS and click Queues.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In General Properties, set the fields Name, JNDI name, and Queue name as
follows:
Name JRules Input Queue
JNDI namejms/BRESQueueIn
Queue nameJRulesIn
5. Type in the name of your queue manager or queue sharing group name, thenclick OK.
6. Click Save to save directly to the master configuration.
Creating the WebSphere MQ output queue:
After you have created the input queue for request messages, you must also createthe JMS queue destination for sending a response message. To do so, you set thescope to node or server level, select the provider, name the queue, and save.
Procedure
To create the output queue:1. In the Integrated Solutions Console, open Resources > JMS and click Queues.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In General Properties, set the fields Name, JNDI name, and Queue name as
follows:
32 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Name JRules Output Queue
JNDI namejms/BRESQueueOut
Queue nameJRulesOut
5. Type in the name of your queue manager or queue sharing group name, thenclick OK.
6. Click Save to save directly to the master configuration.
Creating a topic connection factory:
After you have created the queue factory, input queue, and output queue, youmust create a topic connection factory. To do so, you set the scope to node orserver, select the provider and JNDI name, enter the connection details, test theconnection, and save.
Procedure
To create a topic connection factory:1. In the Integrated Solutions Console, open Resources > JMS and click Topic
connection factories.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In Step 1: Configure basic attributes set the fields Name, and JNDI name as
follows and click Next.
Name JRules Topic Connection Factory
JNDI namejms/BRESTopicConnectionFactory
5. In Step 2: Select connection method, select Enter all the requiredinformation into this wizard and click Next.
6. In Step 2.1: Supply queue connection details, type the name of your queuemanager or queue sharing group, then click Next.
7. In Step 2.2: Enter connection details, type the connection details to establish aconnection to the queue manager or queue sharing group (the default queueport is 1414), then click Next.
8. In Step 3: Test connection, click Test connection.If your message queue is running, you see the following message:A connection was successfully made to WebSphere MQ.
9. Click Next.A summary opens showing the details of the connection factory.
10. Click Finish, then click Save to save directly to the master configuration.
Creating the WebSphere MQ input topic:
After you have created the WebSphere MQ topic connection factory, you can createthe JMS topic destination for receiving a request message. To do so, you set thescope to node or server level, select the provider, set the JNDI and input topicnames, and save.
Configuring Decision Server Rules 33
Procedure
To create the JMS input topic:1. In the Integrated Solutions Console, open Resources > JMS and click Topics.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In General Properties, set the fields Name, JNDI name, and Topic name as
follows, then click OK.
Name
JRules Input Topic
JNDI name
jms/BRESTopicIn
Topic name
JRulesTopicIn
5. Click Save to save directly to the master configuration.
Creating the WebSphere MQ output topic:
After you have created the WebSphere MQ topic connection factory and inputtopic, you must also create the JMS queue destination for sending a responsemessage. To do so, you set the scope to node or server level, select the provider, setthe JNDI and output topic names, and save.
Procedure
To create the JMS output topic:1. In the Integrated Solutions Console, open Resources > JMS and click Topics.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In General Properties, set the fields Name, JNDI name, and Topic name as
follows and then click OK.
Name
JRules Output Topic
JNDI name
jms/BRESTopicOut
Topic name
JRulesTopicOut
5. Click Save to save directly to the master configuration.
Creating the WebSphere MQ queue activation specification:
After you have configured WebSphere MQ queues, you create the queue activationspecification.
About this task
The queue activation specification manages the relationship between the DecisionServer message-driven rule beans (MDB) running in WebSphere Application Server
34 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
and a destination in WebSphere MQ. To create the activation specification, you setthe scope to node or server level, select the provider, set the specification and JNDInames, enter the connection details, and save.
Procedure
To create the activation specification:1. In the Integrated Solutions Console, open Resources > JMS and click
Activation specifications.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In Step 1: Configure basic attributes set the fields Name, and JNDI name as
follows and then click Next.
Name
JRules Activation Spec
JNDI name
eis/IlrRuleExecutionEJB
5. In Step 1.1: Specify MDB destination data, set the field Destination JNDIname to jms/BRESQueueIn, set the Destination type to Queue, then click Next.
6. In Step 2: Select connection method, select Enter all the requiredinformation into this wizard and click Next.
7. In Step 2.1: Supply queue connection details, type the name of your queuemanager or queue sharing group, then click Next.
8. In Step 2.2: Enter connection details, type the connection details to establish aconnection to the queue manager or queue sharing group, then click Next.The default queue port is 1414.
9. In Step 3: Test connection, click Test connection.If your message queue is running, you see the following message:A connection was successfully made to WebSphere MQ.
10. Click Next.A summary opens showing the details of the connection factory.
11. Click Finish, then click Save to save directly to the master configuration.
Creating the WebSphere MQ topic activation specification:
After you have created the queue activation specification, you create the topicactivation specification.
About this task
The topic activation specification manages the relationship between the DecisionServer message-driven rule beans (MDB) running in WebSphere Application Serverand a destination in WebSphere MQ. To create the activation specification, you setthe scope to node or server level, select the provider, set the specification and JNDInames, enter the connection details, and save.
Procedure
To create the topic activation specification:
Configuring Decision Server Rules 35
1. In the Integrated Solutions Console, open Resources > JMS and clickActivation specifications.
2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In Step 1: Configure basic attributes set the fields Name, and JNDI name as
follows, and then click Next.
Name JRules Topic Activation Spec
JNDI nameeis/IlrRuleExecutionTopicEJB
5. In Step 1.1: Specify MDB destination data set the field Destination JNDIname to jms/BRESTopicIn, set the Destination type to Topic, then click Next.
6. In Step 1.2: Configure Durable Subscription, select Nondurablesubscription, then click Next.
7. In Step 2: Select connection method, select Enter all the requiredinformation into this wizard and click Next.
8. In Step 2.1: Supply queue connection details, type the name of your queuemanager or queue sharing group, then click Next.The default queue port is 1414.
9. In Step 2.2: Enter connection details, type the connection details to establish aconnection to the queue manager or queue sharing group, then click Next.
10. In Step 3: Test connection, click Test connection.If your message queue is running, you see the following message:A connection was successfully made to WebSphere MQ.
11. Click Next.A summary opens showing the details of the connection factory.
12. Click Finish, then click Save to save directly to the master configuration.
Installing the message-driven rule bean:
After you have created the queue and topic activation specifications, you install theDecision Server message-driven rule bean (MDB) in WebSphere Application Serveras an enterprise application. To do so, you create a new enterprise application.
Procedure
To install the Decision Server message-driven rule bean:1. Open the Integrated Solutions Console.2. In the panel, open Applications > New Application and click New Enterprise
Application.3. In the panel, select Local file system and Browse to the following path:
<InstallDir>/executionserver/applicationservers/WebSphere<version_number>/jrules-res-mdb-WAS<version_number>.jar.
4. Click Next.5. Select the check box Detailed - Show all installation options and parameters.6. Expand Choose to generate default bindings and mappings and select the
check box Generate Default Bindings.7. Click Next, then click Continue to accept the security warning.8. Click Step 5: Bind listeners for message-driven beans.
36 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
a. Type jms/BRESTopicIn as the Destination JNDI name forIlrRuleExecutionTopicEJB.
b. Type jms/BRESQueueIn as the Destination JNDI name forIlrRuleExecutionEJB.
c. Click Next.9. Click Step 6: Map resource references to resources and then click Next.
Use the default binding for the referenced resources.Step 7 provides a summary.
10. Click Finish.11. When the installation has completed, click Save directly to the master
configuration.12. In the Integrated Solutions Console, open Applications > Application Types
> WebSphere enterprise applications.13. In the Enterprise Applications page, select the check box next to
jrules-res-mdb-WAS<version_number>.jar and click Start to start theapplication.
Enabling server-wide Last Participant Support:
To complete the integration of WebSphere MQ, you enable Last ParticipantSupport.
About this task
To finish integrating WebSphere MQ in WebSphere Application Server forasynchronous execution, you enable Last Participant Support (LPS) so that a singleone-phase commit resource is used with any number of two-phase commitresources in the same global transaction. To do so, you set theACCEPT_HEURISTIC_HAZARD custom property to true in the Integrated SolutionsConsole and then restart the application server.
Procedure
To enable server-wide LPS:1. Open the Integrated Solutions Console.2. Click Servers > Server Types > WebSphere application servers and the server
name.The properties page for the application server opens
3. Under Container Settings, expand Container Services and click TransactionService.The properties page for the transaction service opens.
4. Under Additional Properties, click Custom properties.5. On the Custom Properties page, click New and type ACCEPT_HEURISTIC_HAZARD
as the Name and TRUE as the Value.6. Click Apply and Save directly to the master configuration.7. Restart your application server.
Configuring Rule Execution Server in different environments:
Configuration settings required to enable Rule Execution Server on differentenvironments in a single cell.
Configuring Decision Server Rules 37
About this task
It is very likely that the development of your BRMS requires more than a singledeployment of Rule Execution Server. The development life cycle of a business ruleapplication is similar to any other software development process, including stagesfor implementation, testing, deployment, and maintenance. At the very least, youare likely to need an environment for your development team, one for your QAteam, and another one for in-production applications. In the cases where youconfigure Rule Execution Server in a single cell, it is good practice to isolate therulesets that you use on each server, and ensure that the Execution Units (XUs) donot interfere with each other.
Note: These instructions assume that you do not configure multiple instances ofRule Execution Server in a single cell.
To set up different environments in a single cell, follow these steps:1. Set up different data sources.2. Deploy and configure a XU for each environment.3. Deploy the Rule Execution Server console for each environment.
Procedure
To configure Rule Execution Server in different environments:1. Set up different data sources.
Use a unique JNDI name. For example: jdbc/resdatasourceEnv1 andjdbc/resdatasourceEnv2.
2. Deploy a XU for each environment and define a J2C connection factory.a. In the side panel, open Resources > Resource Adapters > J2C connection
factories and click the name of the connection factory xu_cf) See Step 9:Deploying the XU RAR for information on creating a connection factory.
b. Modify the JNDI name to eis/XUConnectionFactoryEnv1.
Note: You must modify the execution components that call this XU so thatthey use this JNDI instead of the default.
c. Under Additional Properties, click Custom properties.d. Click the plugins property.e. In the Value field, change xuName=default in the property to
xuName=xuEnv1, and then click OK.f. Click the persistenceProperties property.g. In the Value field, change JNDI_NAME=jdbc/resdatasource to
JNDI_NAME=jdbc/resdatasourceEnv1.h. Click OK and Save to save the changes to the master configuration.i. Repeat the same process for XUs in other environments.
3. Deploy the Rule Execution Server console for each environment.a. To modify the deployment descriptor of the Rule Execution Server console
EAR: in the web.xml file, uncomment the JMX_XU_QUERY_PART parameter andspecify xuName=xuEnv1.
b. Deploy the Rule Execution Server console EAR on the server in the resourcereference settings in the application server.1) Set the JNDI for the data source to jdbc/resdatasourceEnv1.2) Set the JNDI name for the XU to eis/ConnectionFactoryEnv1.
38 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
c. Repeat the process to deploy the Rule Execution Server console for the otherenvironments.
4. Restart the node agents after you complete the configuration5. Call the XU instances to register the XU with the Rule Execution Server
console.
Rule Execution Server deployment on cluster environments:
Taking into account cluster configuration and topology, you can deploy RuleExecution Server to WebSphere Application Server cell in cluster mode.
Cluster configuration and topology:
When you deploy Rule Execution Server onto server clusters, each node hosts oneExecution Unit (XU) which is used only by a local rule session. The clustertopology significantly affects the notification mechanism.
Within the Java EE framework, clusters provide mission-critical services to ensureminimal downtime and maximum scalability. A cluster is a group of applicationservers that transparently run your Java EE application as if it were a single entity.
Cluster implementations on Java EE application servers come with their own set ofterminology. Each of the following terms are important to understand how yourcluster performs:v Cluster and component failover servicesv HTTP session failoverv Single points of failure in a cluster topology
On a cluster configuration, deploy an Execution Unit (XU) on each node. There isone XU for each node of a cluster. Use the administration console of applicationservers to handle cluster deployment. A XU instance can be used only by a local(same node) rule session. The rule session and the XU communicate using directJava method calls, so the XU does not require serialization.
Configuring Decision Server Rules 39
A cluster that uses Rule Execution Server involves a collaboration between theRule Execution Server MBeans. The topology of the cluster has significantinfluence on the management of the notification mechanism when a resource ischanged.
The management model is likely to use several times a basic scenario of adistributed notification mechanism within a cluster to interact with the variousExecution Unit (XU) instances. A XU MBean is deployed with the XU tocollaborate with the Rule Execution Server JMX infrastructure.
The following sequence applies:1. A management client sets a resource on a ruleset MBean.2. The ruleset makes a query to the MBean Server to retrieve all the XU instances
in the cluster (this operation requires a specific implementation for eachapplication server).
3. A notification is sent to each instance.
Rule Execution Server deployment on WebSphere Application Server cells:
Deployment of Rule Execution Server in a WebSphere Application Server cell(distributed or z/OS) relies on a number of best practices.
A WebSphere Application Server cell is a virtual unit that consists of a deploymentmanager and one or more nodes. When deploying the different Rule ExecutionServer components on WebSphere Application Server or WebSphere ApplicationServer for z/OS, it is important that you deploy the management module onto asingle server in the cell. Only a single management module is necessary to manageall Execution Units (XU) on each server.
It is important to define a logical subset of servers. You must set up theconfiguration in the following way:v Dedicate a stand-alone server of the cell outside the cluster to the deployment of
the Rule Execution Server management module. A failover mechanism is notnecessary.
v Dedicate a cluster of servers or stand-alone servers to the deployment of the XU.You can install the XU (.rar file) only at the node level and you must declarethe resource adapter at the node or server level so that every server in the nodecontains this definition.
v Define the data source at the node level (see the documentation about creatingJDBC providers).
Such a configuration guarantees that a single management module is instantiatedin the WebSphere Application Server cell, as illustrated in the following diagram.
40 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
The notification mechanism uses a simple pattern because Rule Execution ServerMBeans rely on the distributed MBean mechanism provided by WebSphereApplication Server. When an MBean is registered in a server of a WebSphereApplication Server cell, it is automatically visible to the Deployment ManagerMBean Server.
To notify each Execution Unit of changes in the management model, query theDeployment Manager MBean Server, then notify each Execution Unit retrieved bythe query.
For more information, see:
Configuring Decision Server Rules 41
v WebSphere Application Server Version 7.0 Information Centerv WebSphere Application Server Version 8.0 Information Centerv Building Java EE applications with a WebSphere cluster environment
Troubleshooting Rule Execution Server:
Various paths are available for you in case of poor performance: you activate theExecution Unit (XU) log to study the execution trace, configure the XU memoryprofiler, explore database driver issues, or allocate more memory to applications.
Note:
v To let a scalable number of users access resources through the Java components,JCA assigns the task of implementing connection pooling to application servervendors.
v If the diagnostics are performed before any Execution Units (XU) have beenstarted, the test is passed and a message displays to report that no ExecutionUnit (XU) has been initialized.
v On WebSphere Application Server, the pool size is not instantiated beforehandand therefore prevents the server diagnostics from validating a Rule ExecutionServer before the first execution of a rule engine. The diagnostics remain usefulto validate a configuration, especially in a cluster, and to check which ExecutionUnits registered with the management model have been started.
For more information, see Troubleshooting and support resources.
Activating the XU log in WebSphere Application Server:
Provides step-by-step instructions to activate the Execution Unit (XU) log inWebSphere Application Server, specify a trace, and change the trace level.
Activating the log:
You activate the Execution Unit (XU) log in the WebSphere Application Serverconsole.
About this task
The log for the Rule Execution Server is stored in the same location as the otherapplication server logs. The default directory is ${SERVER_LOG_ROOT}/trace.log.
Procedure
To activate the log in the WebSphere Application Server console:1. Click Servers > WebSphere application servers.2. In the Application Servers page, click ServerName.3. Under Troubleshooting, click Change log detail levels.4. In the Configuration tab, enter ilog.*=all=enabled into the trace specification,
and click OK.5. Click save to save the change to the master configuration.
Specifying a trace:
When you activate the XU log, you can specify the trace level.
42 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Procedure
To specify a trace in the WebSphere Application Server console:1. In the Application Servers page, click ServerName.2. Under Troubleshooting, click Change log detail levels.3. In the Configuration tab, replace *=info with *=info: ilog.*=all in the trace
specification, and click OK.4. Click save to save the change to the master configuration.
Changing the trace level:
When you specify a trace for the XU log, you can later change the trace level.
Procedure
To change the trace level of the XU:1. Select Resources > Resource Adapters > XU RAR file > J2C Connection
Factories > XU_CF > Custom Properties.2. Modify the traceLevel property. The valid values are: FINE, INFO, WARNING,
SEVERE, OFF.3. Save the server configuration.4. Restart the application server.
Configuring the XU memory profiler:
The XU memory profiler provides information about the memory usage of theExecution Unit (XU). The XU memory profiler is a Java Agent.
Important: When the memory profiler is enabled, performance can be poorer. Useit when memory issues have to be investigated. Do not use the memory profiler ona production server.
When the XU memory profiler is enabled, you can use it to retrieve usageinformation:v In the XU Dump
If you have memory issues, enable the memory profiler before you send the XUmemory dump to IBM Support.
v Using IlrRulesetUsageInformation#getEstimatedMemorySizeThe method gives a size estimation of the memory usage of a ruleset. You canretrieve information on how a ruleset is used from the instance of the class.Get the instance in one of the following ways:– From the XU plug-in, when the method is called.– From the XU custom ruleset cache. The instance is passed as a parameter of
the method .The method getEstimatedMemorySize in IlrRulesetUsageInformation gives a sizeestimation of the memory usage of a ruleset. You can retrieve information onhow a ruleset is used from the instance of theIlrRulesetUsageInformationMonitor class.Get the IlrRulesetUsageInformationMonitor instance from either:– The XU plug-in, when the method setRulesetUsageInformationMonitor in
IlrDefaultPlugin is called.
Configuring Decision Server Rules 43
– The XU custom ruleset cache. The IlrRulesetUsageInformationMonitorinstance is passed as a parameter of the method initialize in IlrRulesetCache.
To configure the XU memory profiler:
1. Set the XU configuration parameter rulesetUsageMonitorEnabled to true in thera.xml deployment descriptor file of the XU RAR.The XU RAR files with the default configuration properties are located in therespective WebSphere folders under <InstallDir>/executionserver/applicationservers. Modify the ra.xml file, and then update the RAR in theAdministrative console.
2. In the WebSphere Application Server console, open Servers > Server Types >WebSphere application servers.
3. In the Application servers pane, click the name of your server.4. Under Server Infrastructure, expand Java and Process Management and click
Process definition.
Note: On z/OS, an additional layer provides three resources that can beadministered: Adjunct, Control, and Servant. If you are working in thatenvironment, select the Servant.
5. Under Additional Properties, click Java Virtual Machine.6. Add the following line to the parameter Generic JVM arguments:
-javaagent:<InstallDir>/executionserver/lib/jrules-res-memory-agentclient.jar
Rule Execution Server database driver issues:
Lists the known database driver issues.
JDBC not bound:
A JDBC not bound error message is raised when an error occurs during the creationof the data source.
Refer to the traces to locate the original cause. In the vast majority of cases one ofthe following is likely:v A directory does not exist or cannot be read or written.v There is a missing schema or table.v There are missing privileges to access the database resource.
Providing more memory for applications:
If you experience core dumps or Java out-of-memory errors, you can make morememory available to WebSphere Application Server by increasing the maximumheap size for the Java Virtual Machine (JVM).
Procedure
To increase the WebSphere Application Server memory settings:1. In the WebSphere Application Server console, open Servers > Server Types >
WebSphere application servers.2. In the Application servers panel, click the name of your server.3. Under Server Infrastructure, expand Java and Process Management and click
Process definition.
44 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Note: On z/OS, an additional layer provides three resources that can beadministered: Adjunct, Control, and Servant. If you are working in thatenvironment, select Servant.
4. Under Additional Properties, click Java Virtual Machine.5. Set the Initial heap size and Maximum heap size fields to the appropriate
values.For example, you can enter the following values:v For a 32-bit configuration: 512 and 1024 MB respectivelyv For a 64-bit configuration: 1024 and 4096 MB respectively
6. Click OK, then Save to save the changes directly to the master configuration.
Configuring Rule Execution Server on WebSphere ApplicationServer for Linux on System zTo be able to use Rule Execution Server on an instance of WebSphere ApplicationServer for Linux on System z®, you must set up the persistence for the resources,create a JDBC provider, deploy the provided archives for this server, and activatesecurity.
Before you start:
Review the tasks you must perform to complete the configuration of WebSphereApplication Server for Linux on System z.
Specific integration extensions are available. For more information, refer to:WebSphere Operation Decision Management Integration SupportPacs.
Refer to “What steps to follow” to understand the tasks you must complete.
Use the Rule Execution Server console to create resources in an empty databaseschema and run SQL drop statements that clear an existing Rule Execution Serverdatabase.
Software Prerequisites
You must have installed the following software before you configure RuleExecution Server:v WebSphere Application Server for Linux on System zv DB2 Version 9.5 or 10v Java 1.6 included in your PATH statement.
You also need the following rights:v Access to the WebSphere Application Server Integrated Solutions Consolev DB2 Administrator authority to CREATE a database and CREATE & UPDATE
tablesv Authority to create a directory structure for the Rule Execution Server filesv Authority to start and stop WebSphere Application Server
What steps to follow
The following table summarizes the configuration steps that you follow to installRule Execution Server on WebSphere Application Server:
Configuring Decision Server Rules 45
Configuration Steps Required
“Step 1: Setting up the DB2 database”
“Step 2: Creating a JDBC provider” on page 47
for data source persistence
“Step 3: Setting up Java 2 connection security” on page 48
“Step 4: Creating a data source and connection pool” onpage 48
for data source persistence
“Step 5: Creating users and groups” on page 49
“Step 5a: Mapping the resAdministrators and resDeployersgroups to the Monitor role” on page 50
“Step 6: Deploying the Rule Execution Server ManagementEAR” on page 51
“Step 7: Populating the RESDB database” on page 52
for data source persistence
“Step 7a: Testing the connection to the database” on page 57
for data source persistence
“Step 8: Deploying the Rule Execution Server MBeandescriptors” on page 58
“Step 9: Deploying the XU RAR” on page 58
“Step 10: Deploying the hosted transparent decision serviceEAR” on page 60
Optional
“Step 11: Setting the DecodeUrlAsUTF8 custom property”on page 61
Optional
“Step 12: Verifying the deployment and configuration” onpage 62
Optional
Step 1: Setting up the DB2 database:
Customizable scripts are provided to populate your DB2 database, but you mustfirst create an empty database.
This step assumes that the persistence is set to datasource. The existing DB2installation is assumed to have automatic storage and a 32K buffer pool with thedefault ID of BP32K.
46 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
You can use the Rule Execution Server console or you can run the SQL scriptsprovided, which are located in <InstallDir>/executionserver/databases.
A readme file in this directory provides additional information on the scripts.
You must create the Rule Execution Server database if it does not exist.
Note:
You need DB2 Administrator permission to create the database.
To create the database, enter the following commands:su {DB2AdminName}db2CREATE DATABASE {RESDBName}
After you have created the database, you use the console or the provided SQLscripts to populate the database.
Step 2: Creating a JDBC provider:
To enable Rule Execution Server, you create a JDBC provider in WebSphereApplication Server, as the first step in creating a data source.
About this task
The first step in creating a data source, based on the database schema that youhave created in “Step 1: Setting up the DB2 database” on page 46, is to create aJDBC provider.
Note:
You can install the JDBC provider on the cell, node, cluster, or server level.
Procedure
1. Log in to the Integrated Solutions Console.2. In the side panel, open Resources > JDBC and click JDBC Providers.3. In Scope, select the Node=xxx, Server=yyy, where xxx is the name of you
node and yyy the name of your server, then click New.4. In Step 1 select the database type, provider type, and implementation type.
For example:
Option Description
Database type DB2
Provider type DB2, Universal JDBC Driver
Implementation type Select Connection pool data source, thentype a name, for example, DB2 UniversalJDBC Driver Provider for RES.
5. Click Next.6. In Step 2, leave all the class path values, including the blanks, as the default
values.7. Click Next.
A summary is provided in Step 3.
Configuring Decision Server Rules 47
8. Check that the class path to the driver JAR file and the implementation classare correct.Default values are usually sufficient.
9. Click Finish and Save to save the changes to the master configuration.The DB2 installation process might have installed thedb2jcc_license_cisuz.jar file to a location that is not in the WebSphereApplication Server path.
10. Find the db2jcc_license_cisuz.jar file by running the following command:It is best to do this as the root user to avoid permissions messages.find / -name db2jcc_license_cisuz.jar
11. From the Integrated Solutions Console, open Environment > WebSpherevariables and click DB2UNIVERSAL_JDBC_DRIVER_PATH.
12. Set the value to the path returned by the find command.13. Click OK and Save to save the changes to the master configuration.Related information:“Rule Execution Server database driver issues” on page 104Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Step 3: Setting up Java 2 connection security:
In WebSphere Application Server, you can secure your enterprise informationsystem by creating J2C authentication data.
About this task
After you have created your data source and connection pool, you create the J2Cauthentication data. J2C is a secure mechanism for integrating enterpriseinformation systems to an application server and enterprise applications.
Procedure
To set up J2C connection security:1. From the Integrated Solutions Console, open Security > Global Security.2. From the side panel, expand Java Authentication and Authorization Service
and select J2C authentication data.3. Click New and provide the DB2 Administrator's credentials in the User ID and
Password fields.4. Click Apply and Save to save directly to the master configuration.
Step 4: Creating a data source and connection pool:
You create a connection pool and a data source in WebSphere Application Server toenable Rule Execution Server.
About this task
After you have created your JDBC provider, you can create a data source andconnection pool.
48 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Procedure
1. In the Integrated Solutions Console open Resources > JDBC and Datasources.
2. In the Scope side panel, select the scope that you selected for the JDBCprovider in “Step 2: Creating a JDBC provider” on page 47, and then clickNew.
3. In Step 1, enter resdatasource in the Data source name field andjdbc/<your_data_source_name> in the JNDI name field, and click Next.
Important: The name of the data source is not important here, but in the JNDIname, you must reuse the data source name that you entered. For example, ifyou entered resdatasource as the data source name, set the JNDI name tojdbc/resdatasource. Otherwise, Rule Execution Server cannot use the datasource.
4. In Step 2, choose Select an existing JDBC provider, select the JDBC providerthat you created previously, and click Next.
5. In Step 3, enter the specific database properties for the data source.v Driver type: 4v Database name: Type your database name, for example DSN910GP.v Server name: Type you server name.v Port number: Type your port number.
6. Deselect Use this data source in container managed persistence (CMP), thenclick Next.
7. In Step 4, select the DB2 Administrator's authentication alias from theComponent-managed authentication alias option and then click Next.
8. In Step 5, a summary of the data source is provided. Click Finish and Save tosave the changes to the master configuration.
Step 5: Creating users and groups:
Create users and groups that map to the Rule Execution Server security roles.
Before you begin
If you do not have groups and users defined or if you want to define new groupsand users, proceed with the following steps. If you already have suitable groupsand users defined, skip this procedure and connect users to their appropriate roleswhen you deploy your applications.
About this task
WebSphere Application Server uses various kinds of user registries (OS, LDAP, orCustom). Security roles for Rule Execution Server are defined in the applicationdeployment descriptor. You can map these roles to actual users and groups withinyour environment. Use the following procedure to configure a user registry with afederated repository.
Procedure
1. Log in to the Integrated Solutions Console.2. In the side panel, open Security > Global security.3. Configure the repository security as follows:
Configuring Decision Server Rules 49
v If Federated repositories is already selected under Current realmdefinition, make sure that Enable application security is selected. If youselect Enable application security, you must click Apply and Save to savethe changes to the master configuration.
v If Federated repositories is not already selected, click SecurityConfiguration Wizard and complete the wizard as follows:
a. In Step 1, to specify the level of protection, select Enable applicationsecurity and click Next.
b. In Step 2, select Federated repositories and click Next.c. In Step 3, type a name in the Primary administrative user name field and
websphere in the Password field, and click Next.d. In Step 4, review the security configuration summary and click Finish.e. Click Save to save the changes to the master configuration.f. Restart the server.
You must log into the Integrated Solutions Console as the primaryadministrative user. The secure port is used, for examplehttps://example.hursley.ibm.com:1234/ibm/console/logon.jsp
4. In the side panel, openUsers and Groups > Manage Groups and clickCreate.
5. Enter resAdministrators as the group name, type a description asappropriate, then click Create.
6. Click Create Like and create another group named resDeployers. Type adescription if required. Click Create.
7. Click Create Like again and enter another group named resMonitors, type adescription as appropriate, then click Create. Click Close.
8. In the panel open Users and Groups > Manage Users.Click Create.
9. Enter resAdmin as the User ID and again resAdmin as the password. Alsospecify the given name and last name.
10. Click Group Membership and proceed as follows:a. Click Search.b. Select the resAdministrators, resDeployers and resMonitors groups and
click Add.c. Click Close, then click Create and Close again.
11. Create users with deployer and monitor roles as follows:a. Create another user named resDeployer with password resDeployer.b. Assign the user to the resDeployers and resMonitors groups.c. Create a user named resMonitor with password resMonitor.d. Assign the user to the resMonitors group.
12. Restart your application server or your deployment manager.
Step 5a: Mapping the resAdministrators and resDeployers groups to the Monitorrole:
When creating user groups, you might have to map the resAdministrators andresDeployers users to the Monitor role.
50 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
About this task
To access the MBeans of the Rule Execution Server model, an application musthave sufficient security credentials, restricted to the Monitor role in the WebSphereApplication Server authentication system.
Rule Execution Server users can be given access to the MBeans of the model byconfiguring a mapping between the resAdministrators group and theresDeployers group declared in the custom registry and the Monitor role.
Procedure
1. In the Integrated Solutions Console, open Users and Groups > Administrativegroup roles.
2. Click Add.3. For Role(s) select Monitor, then click Search and use the arrow button to move
the entry beginning with resAdministrators from the Available column to theMapped to role column.
4. Do the same for resDeployers, then click OK.5. Click the Save to save directly to the master configuration.6. Restart your application server or your deployment manager.
Step 6: Deploying the Rule Execution Server Management EAR:
Deploy the Rule Execution Server EAR on WebSphere Application Server.
Procedure
1. Open the Integrated Solutions Console.2. In the side panel, open Applications > New Application and click New
Enterprise Application.3. In the side panel, select either Local file system or Remote file system
(depending where the EAR file is located), then and Browse to one of thefollowing files and then click Next.v <InstallDir>/executionserver/applicationservers/WebSphere7/jrules-
res-management-WAS7.ear
v <InstallDir>/executionserver/applicationservers/WebSphere8/jrules-res-management-WAS8.ear
4. Select the check box Detailed - Show all installation options and parameters.5. Expand Choose to generate default bindings and mappings, select the check
box Generate Default Bindings, and then click Next.6. Click Continue to accept the security warning.7. In Step 1 click Next to accept the default settings.8. In Step 2, proceed as follows:
v If you have only one server, skip Step 2.v If you have more than one server, select the server that you want to deploy
the application to, and then select the check box for Rule Execution ServerConsole and click Next.
9. In Step 3 to Step 5 click Next to accept the default settings.10. In Step 6, you map the resource references to JNDI resources.
a. Select the check box for the eis/XUConnectionFactory resource reference.b. Click Browse, select the entry named xu_cf, and click Apply.
Configuring Decision Server Rules 51
c. For the jdbc/resdatasource reference, click Browse, and select the entrynamed resdatasource.
d. Click Apply, and then click Next.11. In Step 7 and Step 8 click Next to accept the default settings.12. Click Step 9: Map security roles to users or groups. Here you map security
roles to users and groups, as follows:a. Select the check box next to the resAdministrators role.b. Click Map groups and click Search. The groups are shown in a column
titled Available.c. Click resAdministrators under Available, then click the arrow button to
move resAdministrators to the Selected column.d. Click OK to return to the Mapping Users to Roles page.e. Repeat steps 12a through 12d to map the resDeployers and resMonitors
roles for the other groups, making sure that only the check box next to therole that you are assigning is selected.
Role Mapped groups
resAdministrators resAdministrators
resDeployers resDeployers
resMonitors resMonitors
13. Click Next.Step 10 provides a summary.
14. Click Finish.15. When the installation has completed, click Manage Applications at the
bottom of the panel.16. Click Rule Execution Server.17. Click Manage Modules.18. Click Rule Execution Server Console.19. Under General Properties, forClass loader order, select Classes loaded with
local class loader first (parent last).20. Click OK and Save to save directly to the master configuration.21. In the side panel, open Applications > Application Types > WebSphere
enterprise applications.22. In the Enterprise Applications page, select the check box next to Rule
Execution Server and click Start to start the application.
Step 7: Populating the RESDB database:
After you have created an empty database schema, you can populate the RuleExecution Server database by running SQL scripts, either from the CommandEditor or from the Rule Execution Server console.
Populating a database using the Rule Execution Server console:
To populate a Rule Execution Server database, you can run the database scriptsfrom the Rule Execution Server console and use the Installation Settings wizard ifyou work on Windows and other supported distributed platforms.
Installation Settings wizard overview:
52 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.
The Rule Execution Server Console contains an Installation Settings wizard. If youare configuring your Rule Execution Server with database persistence and want topopulate your database, you can use the wizard for the following purposes:v Select the type of schema database resources that you want to create.v Create the required resources, in an empty database schema, to use Rule
Execution Server.
Note:
Keep the following points in mind:– Only the users who configure Rule Execution Server from a distributed
platform and Windows can work from the Installation Settings wizard.– You must create the empty database schema on your application server before
you use the Installation Settings wizard.– To open the Installation Settings wizard, you must log in to the Rule
Execution Server Console with administrator rights resAdmin.– To configure the database to store managed Java XOM, you follow the
procedure twice, with a different target database each time.
The Installation Settings wizard creates all the required tables for Rule ExecutionServer and for Decision Validation Services, even if you do not have a license forDecision Validation Services.
Note: If you are using file persistence or have an existing data schema, theInstallation Settings wizard does not open when you log in to the Rule ExecutionServer Console. If you want to modify the database schema having already createdthe database tables, you must run the SQL scripts in the database client.
The combination of persistence settings for RuleApps and managed Java XOMsaffects the way in which you use the Installation Settings wizard.v If the RuleApp persistence and the Java XOM persistence are both set to file:
No wizard is presented.v If the RuleApp persistence and the Java XOM persistence are both set to
datasource: When you sign in to the Rule Execution Server Console, theRuleApp persistence details part of the Installation Settings wizard appears foryou to create the schema for RuleApps and the Decision Warehouse trace. Afteryou have completed this step, the Java XOMs persistence details part of thewizard is displayed for you to configure the database for Java XOM persistence.
v If the RuleApp persistence is set to file and the Java XOM is set to datasource:You see only Java XOMs persistence details and you cannot use the DecisionWarehouse.
v If the RuleApp persistence is set to datasource and the Java XOM is set to fileor is not defined: When you sign in to the Rule Execution Server Console, onlyRuleApp persistence details appears for you to create the schema for RuleApps.The Java XOMs persistence details part of the wizard is not shown.
The following table summarizes the cases.
Configuring Decision Server Rules 53
Persistence
RuleApps
file datasource or jdbc
Java XOMs file No InstallationSettings wizard
RuleAppspersistence detailsonly
datasource or jdbc Java XOMspersistence detailsonly
No DecisionWarehouse
Complete InstallationSettings wizard
Opening the Rule Execution Server console:
To open the Rule Execution Server console and the Installation Settings wizard,you must sign in with resAdministrators rights.
Before you begin
Read the Installation Settings wizard overview.
Procedure
To open the Rule Execution Server Console and access the Installation Settingswizard:1. Start your database, if you are using data source persistence or you set
persistence to JDBC.2. Open the Rule Execution Server console in a Web browser by typing res at the
root URL on the host machine:v If your browser is not running on the same host as the application server,
replace localhost with the address of the machine.v If the web application is mapped to a host which is defined on a port that is
different from the default of the server, change the port number to the hostport number.
3. Sign in to the Rule Execution Server console as the administrator.For example:
User ID
resAdmin
Password
resAdmin
Results
If you are using database persistence and the database schema is empty, theInstallation Settings wizard opens and you can use it to complete the installation.
Step 1: Welcome to the Installation Settings wizard:
The Installation Settings wizard opens to a Welcome page.
54 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
If you open the Rule Execution Server Console with datasource as the persistencesetting and an empty database schema, the Installation Settings wizard opens.
The wizard can display two parts:v It starts with RuleApp persistence details if you set datasource persistence for
RuleApps, whatever the persistence type for managed Java XOMs.v Java XOMs persistence details is shown after RuleApp persistence details if
you have set datasource persistence for both RuleApps and Java XOMs. In thiscase, you go through the same steps twice.The wizard starts with Java XOMs persistence details if you have set thepersistence type to file for RuleApps and to datasource for managed JavaXOMs.
Both parts of the wizard are similar and you use them in the same way:1.
The Welcome page provides the following information:v Persistence details about the type of database used. This includes information
about the driver and JDBC URL.v A brief description of the purpose of the Installation Settings wizard.v A diagnostic report that provides information about why the persistence
check failed (because you have not yet created the database tables).Click Next to proceed.
2. “Step 2: Choose the database schema” on page 213. “Step 3: Review the database schema” on page 224. “Step 4: The Installation Settings wizard report” on page 23
Step 2: Choose the database schema:
After you have read the Welcome page, you choose the database schema. Specificsettings are available for DB2. Optionally, you can select a customized SQL script.
Before you begin
You must have created the empty database schema before you use the InstallationSettings wizard.
About this task
After you have read the Welcome page, you select an available Rule ExecutionServer database schema or you upload a custom schema.
Procedure
To choose the database schema:1. In the Database schema selected field, select an available database schema
type.A type that corresponds to the type of database you are using is selected bydefault, but you can choose another type from the drop-down list.If you select a db2 or db2_os390 schema, an extra field displays so that you canenter the name of the buffer pool, which is used to create the DecisionWarehouse tablespace. This buffer pool must have a page size of 32K. Checkthe DB2 documentation for information about how to create a 32K buffer pool.
Configuring Decision Server Rules 55
Note:
The scripts for creating the Decision Warehouse database on DB2 are writtenfor databases that use automatic storage. When you use the Installation Settingswizard, you create both the Rule Execution Server and the Decision Warehousedatabase, so your database must use automatic storage.
If you have not configured your DB2 database to use automatic storage, youcannot use the Rule Execution Server Console to create the Rule ExecutionServer tables.
2. Optional: Select custom if you want to use a customized SQL script, then clickBrowse to select the location of the custom script.
3. Click Next to review the database schema.
Step 3: Review the database schema:
After you have selected a database schema, you confirm the creation of a schemafor Rule Execution Server. You can also use SQL drop statements that flush datafrom an existing table and view the SQL statements.
Before you begin
Before using this option, ensure that you have a backup of database resources.
Procedure
To confirm the creation of a schema:1. Select from the following options:
Create SQL schema “resAdmin”
Select this option to run the SQL statement for the schema type selectedin the previous step.
Keep drop SQL statements
Select this option to flush data from an existing Rule Execution Serverdatabase.
Show SQL statements
Select this option to display the SQL statements.2. Click Execute to start the options that you have selected.
Step 4: The Installation Settings wizard report:
After you have confirmed the database schema, the Installation Settings wizardcreates the schema. A report shows the status of the schema creation.
Procedure
To use the options in the report:1. Click Show execution details to view the list of SQL statements executed.2. Click Finish.
If you have just worked in RuleApps persistence details and the persistencesetting for managed Java XOMs is datasource, the Java XOMs persistencedetails part of the wizard displays now for you to repeat the procedure.
56 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Populating the database running the SQL scripts:
SQL scripts are available for you to populate the database.
About this task
The script that creates the database schema is named repository_db2.sql. You canalso create the required database schema for Decision Warehouse by running thescript trace_db2.sql.
If you are storing the Java XOM in the database, you must create these tables byrunning the xomrepository_db2.sql script.
Important: Users working with DB2 on z/OS as the back-end database for therules at run time must apply a fix to a database storage overflow problem. This fixis particularly important for the Decision Warehouse trace table, which can containa lot of high-volume LOB data. You can find information about this fix on the IBMsupport web site.
Procedure
1. Connect to the Rule Execution Server database:CONNECT TO{RESDBName}QUIT
2. Navigate to the directory <InstallDir>/executionserver/databases.3. Run the following command to create the Rule Execution Server tables:
db2 -tvf repository_db2.sql
4. Optional: Run the following command to create the Decision Warehouse tables:db2 -tvf trace_db2.sql
5. Optional: Run the following command to create the Java XOM tables:db2 -tvf xomrepository_db2.sql
6. Disconnect from the database:db2 DISCONNECT {RESDBName}
7. Exit the {DB2AdminName} UserID:EXIT
Step 7a: Testing the connection to the database:
After you have created a data source and connection pool, and set the customproperties, you can test the connection to the database.
Procedure
1. In the Integrated Solutions Console, open Resources > JDBC and click Datasources.
2. Select the check box next to the data source that you want to test and click Testconnection.
Results
The status of the connection is indicated at the top of the screen.
Potential connection errors:
Configuring Decision Server Rules 57
v Java class ..com.ibm.db2.jcc is not found: Make sure that the jcc driversclass path is correctly set.
v Null Userid is not supported — SQL ERRORCODE 4461,: Authentication hasfailed. Make sure that the JAAS-J2C Authentication credentials are correct.
Step 8: Deploying the Rule Execution Server MBean descriptors:
To configure Rule Execution Server for WebSphere Application Server, you mustalso deploy the MBean descriptors.
Before you begin
Make sure you give the application server process enough access right to read thejrules-mbean-descriptors.jar file. For example, change the permissions on thefile using a chmod 777 command.
About this task
The Rule Execution Server architecture is based on the Java Management Extension(JMX) API. MBeans are Java objects used by the JMX API. To configure RuleExecution Server for WebSphere Application Server, you must deploy the MBeandescriptors, either globally for all Rule Execution Server instances or for a singleRule Execution Server instance.v To deploy globally, copy the <InstallDir>/executionserver/lib/jrules-mbean-
descriptors.jar file to the <WAS_HOME>/lib directory.v To deploy to a targeted server instance, follow the procedure below.
Procedure
To deploy MBean descriptors:1. Open the Integrated Solutions Console.2. In the panel, open Servers > Server Types > WebSphere application servers.3. In the Application servers pane, click the name of your server.4. Under Server Infrastructure, expand Java and Process Management and click
Process definition.
Note: In WebSphere Application Server for z/OS, an additional layer providesthree resources that can be administered: Adjunct, Control, and Servant. If youare working in that environment, select the Servant.
5. Under Additional Properties, click Java Virtual Machine.6. In the Classpath field, add <InstallDir>/executionserver/lib/jrules-mbean-
descriptors.jar.7. Click OK, then Save to save the changes directly to the master configuration.
Step 9: Deploying the XU RAR:
After you have deployed the MBean descriptors, you deploy resource adapterarchive (RAR) for the Execution Unit (XU) onto WebSphere Application Server.
58 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
About this task
This phase of the Rule Execution Server configuration consists in deploying theExecution Unit (XU) resource adapter archive (RAR) on WebSphere ApplicationServer and add the properties by which to identify it. The RAR file contains theXU and the persistence layer.
Important:
In some cases, because of your application constraints, you might have to deploythe XU inside the application. It is your decision to choose the appropriatedeployment mode of the XU: either embed it into the EAR or deploy it as a globalconnector. Refer to the application server documentation for instructions onpackaging a connector into an EAR. In any case, be aware of the followingconsequences.v When the XU is deployed as a global connector:
– The deployed Java EE applications might use its third-party libraries (such asASM) instead of the libraries deployed in the application server.
– Use a parent last setting for the XU Java EE application if your Java EEapplication does not support the version of the third-party librariesdistributed with Decision Server. If you cannot use a parent last setting, youmight need to embed the XU into the EAR that executes the rules.
v If you choose an embedded XU packaging, use a parent last setting for thecode library if the third-party libraries version deployed at the level of theapplication-server code library are not compatible with the XU.
Procedure
1. Open the Integrated Solutions Console.2. In the side panel, open Resources > Resource Adapters and click Resource
adapters, then click Install RAR.3. In the side panel, select either Local file system or Remote file system,
depending where the RAR file is located, then and Browse to:v WebSphere Application Server 7.0: <InstallDir>/executionserver/
applicationservers/WebSphere7/jrules-res-xu-WAS7.rar
v WebSphere Application Server 8.0: <InstallDir>/executionserver/applicationservers/WebSphere8/jrules-res-xu-WAS8.rar
4. In the Scope side panel, select the node where you want to install the XURAR file and click Next.
5. In the General Properties page, set the name for the XU, such as ILOG RES XUResource Adapter, and click OK.
6. Navigate to the created XU resource adapter and change the scope to view theadapter.
7. Under Additional Properties, click J2C connection factories and New.8. Enter the following values:
v Name: xu_cfv JNDI name: eis/XUConnectionFactory
9. Click OK and Save to save the changes to the master configuration.10. Optional: You can define more than one XU resource adapter.
Additional XU resource adapters are required when you have more than onenode in your environment or you want to isolate the developmentenvironment and testing environment in one single node. You can deploy a
Configuring Decision Server Rules 59
JCA resource adapter at any level, depending on the capability of theapplication server. On WebSphere Application Server, you can install the XUresource adapter at the cell, node, cluster, or server level. For example, todefine an XU resource adapter on the server level:a. In the side panel, open Resources > Resource Adapters and click
Resource adapters, then click Install RAR.Select the scope Node=xxx, Server=yyy (where xxx is the name of yournode, yyy is the name of your server).
b. Click New. Enter the name of the XU as XU.In Archive Path, select ${CONNECTOR_INSTALL_ROOT}/jrules-res-xu-WAS7.rar or ${CONNECTOR_INSTALL_ROOT}/jrules-res-xu-WAS8.rar
c. Click OK.d. Repeat steps 5 on page 59 through to 9 on page 59 to define the
connection factory.11. Restart the server.
Tip:
Whenever you install or uninstall an XU you must restart the server.
What to do next
For more information, see:v WebSphere Application Server 7.0 documentationv WebSphere Application Server 8.0 documentation.
Step 10: Deploying the hosted transparent decision service EAR:
If you require the hosted transparent decision service, you must deploy the EARon the same node as the XU.
Procedure
1. Open the Integrated Solutions Console.2. In the side panel, click Applications > New Application and New Enterprise
Application.3. Select either Local file system or Remote file system, depending where the
EAR file is located, Browse to the following file and click Next.v WebSphere Application Server 7.0: <InstallDir>/executionserver/
applicationservers/WebSphere7/jrules-res-htds-WAS7-for-zos.ear
v WebSphere Application Server 8.0: <InstallDir>/executionserver/applicationservers/WebSphere8/jrules-res-htds-WAS8-for-zos.ear
4. Select the check box Detailed - Show all installation options and parameters.a. Expand Choose to generate default bindings and mappings.b. Select the check box Generate Default Bindings.c. Click Next.
5. Click Continue to accept the security warning.6. For Step 1 to Step 8, click Next to accept the default settings.
Step 9 provides a summary.7. Click Finish.
60 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
8. After the installation has completed, click Save to save directly to the masterconfiguration.
9. In the panel, open Applications > Application Types > WebSphereenterprise applications. Click the jrules-res-htds-WAS7 orjrules-res-htds-WAS8.
10. Click Manage Modules.11. Click DecisionService.12. Under General Properties, for Class loader order, select Classes loaded with
local class loader first (parent last).13. Click OK.14. Click OK and Save to save directly to the master configuration.15. In the panel, open Applications > Application Types > WebSphere
enterprise applications.16. In the Enterprise Applications page, select the check box next to
jrules-res-htds-WAS7 or jrules-res-htds-WAS8 and click Start to start theapplication.
What to do next
The hosted transparent decision service requires that you set the web containercustom property DecodeUrlAsUTF8 to False to support a localized ruleset path.
By default the ruleset.xmlDocumentDriverPool.maxSize ruleset property value isset to 1. This value could cause a bottleneck if you have several clients executing ahosted transparent decision service concurrently. Increasing the value of thisproperty could significantly increase the performance. To optimize performance,the value should depend on the number of concurrent executions of the ruleset.For example, if you have 5 concurrent clients, 5 may be a good value.
Set this value using the Ruleset View in the Rule Execution Server console asfollows:1. Click the Explorer tab.2. Click RuleApps in the Navigator panel to display the RuleApps View.3. Click the name of the RuleApp that contains the ruleset in the RuleApps View.4. In the RuleApp View, click the relevant ruleset.5. In the Ruleset View, click Add Property.
A New Ruleset Property form opens.6. Select the predefined property ruleset.xmlDocumentDriverPool.maxSize in the
dropdown list.7. Set the required value.8. Click Add.
Step 11: Setting the DecodeUrlAsUTF8 custom property:
After you have deployed the hosted transparent decision service EAR, you definethe web container custom property DecodeUrlAsUTF8 to support localized rulesetpaths.
About this task
The hosted transparent decision service requires that you set the web containercustom property DecodeUrlAsUTF8 to False to support a localized ruleset path.
Configuring Decision Server Rules 61
Procedure
To set the DecodeUrlAsUTF8 web container custom property:1. Open the Integrated Solutions Console.2. Click Servers > Server Types > WebSphere Application Server and the server
name.3. Under Container Settings, click Web container settings > Web container.4. Under Additional Properties, click Custom properties.5. Click New and enter DecodeUrlAsUTF8 as the name and False as the value.6. Click Apply and Save to save directly to the master configuration.
Step 12: Verifying the deployment and configuration:
It is good practice to verify that Rule Execution Server has been successfullydeployed and configured by running the diagnostics.
About this task
By running the available diagnostics onto Rule Execution Server, you can verifywhether deployment and configuration have been successful. This step is optionalbut recommended.
Important:
v To let a scalable number of users access resources through the Java components,JCA assigns the task of implementing connection pooling to application servervendors.
v If the diagnostics are performed before any Execution Units (XU) have beenstarted, the test is passed and a message displays to report that no ExecutionUnit (XU) has been initialized.
v On WebSphere Application Server, the pool size is not instantiated beforehandand therefore prevents the server diagnostics from validating a Rule ExecutionServer before the first execution of a rule engine. The diagnostics remain usefulto validate a configuration, especially in a cluster, and to check which ExecutionUnits registered with the management model have been started.
Procedure
To run the Rule Execution Server diagnostics:1. Open the Rule Execution Server console by typing res at the root URL on the
host machine:http://<machine_name>:<PORT>/res
On WebSphere Application Server for z/OS, the value of <PORT> is likely tobe WC_defaulthost. To find out the value of WC_defaulthost:If security isenabled, the prefix is https://
a. In the Integrated Solutions Console, go to Servers > Server types >Websphere application servers.
b. Click the name of your server.c. Under Communications, click Ports.d. If the web application is mapped to a host that is defined on a different
port, change the port to the host port number.2. Sign in to the Rule Execution Server console.3. In the Rule Execution Server console, click the Diagnostics tab.
62 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
4. Click Run Diagnostics.
Results
You see a report listing all the diagnostic tests that have just been run. A checkmark is shown next to each test. Click Expand All to show details about all thechecks.
Optional configuration steps:
When configuring Rule Execution Server on WebSphere Application Server forz/OS, you can enhance your configuration with options such as configuringWOLA, integrating WebSphere MQ, setting up a multiserver configuration, ordeploying onto a server cluster.
Integrating WebSphere MQ in WebSphere Application Server to support asynchronousexecution:
If you use the WebSphere MQ messaging provider support in WebSphereApplication Server, you can deploy Java EE applications that directly leverage theenterprise messaging capabilities of WebSphere MQ.
WebSphere MQ integration overview:
The Java Message Service (JMS) API enables access to rule services. To use amessage-driven rule bean, you must create the necessary resources under theWebSphere MQ JMS provider. Both the publish-and-subscribe and thepoint-to-point models are supported.
A Decision Server rule service can be accessed by an asynchronous invocationpattern that uses the Java Message Service (JMS) API. When a JMS messagearrives, the EJB container calls a message-driven rule bean (MDB). The MDB canreside locally or remotely from the client application. In turn, the message-drivenrule bean calls the rulesets that are running in the Execution Unit (XU). The realcall to the rule engine is delegated to a simple rule session.
In WebSphere Application Server, the client application is the scenario running inWebSphere Application Server that calls the rule service, the server is theapplication server where Rule Execution Server is installed. Rule Execution Serveris usually running remotely to the client application.
To use a Decision Server message-drive rule bean, you must create the necessaryresources under the WebSphere MQ JMS provider at the proper scope for both theclient and the server side to make them visible for the client application and theDecision Server MDB respectively. Decision Server implements both standards ofasynchronous messaging: the Publish-and-Subscribe Model and the Point-to-PointModel. The following procedure demonstrates how to set up both a point-to-pointmessaging model and a publish-and-subscribe model. If you need only one ofthem, you can comment out the resource reference in the deployment descriptor ofDecision Server MDB.
Before installation, you must create the following resources in WebSphere MQ:v Queue: JRulesIn, JRulesOutv Topic: JRulesTopicIn, JRulesTopicOut
Use these resources to submit rule execution requests and obtain execution results.
Configuring Decision Server Rules 63
You must perform the following tasks to integrate WebSphere MQ in WebSphereApplication Server:1. “Creating the WebSphere MQ queue connection factory” on page 312. “Creating the WebSphere MQ input queue” on page 323. “Creating the WebSphere MQ output queue” on page 324. “Creating a topic connection factory” on page 335. “Creating the WebSphere MQ input topic” on page 336. “Creating the WebSphere MQ output topic” on page 347. “Creating the WebSphere MQ queue activation specification” on page 348. “Creating the WebSphere MQ topic activation specification” on page 359. “Installing the message-driven rule bean” on page 36
10. “Enabling server-wide Last Participant Support” on page 37
Creating the WebSphere MQ queue connection factory:
To create the WebSphere MQ queue connection factory, you create the queue, thenyou configure the connection factory by following the connection factory wizard.
Procedure
To create a queue connection factory to connect WebSphere MQ with the DecisionServer MDB:1. Log in to the Integrated Solutions Console.2. Open Resources > JMS and click JMS Providers.3. In the panel, select the WebSphere MQ messaging provider.4. Under Additional Properties, click Queue connection factories.5. Click New.6. In Step 1: Configure basic attributes, set the fields Name and JNDI name as
follows, then Click Next.
Name JRules Queue Connection Factory
JNDI namejms/BRESQueueConnectionFactory
7. In Step 2: Select connection method, select Enter all the requiredinformation into this wizard and click Next.
8. In Step 2.1: Supply queue connection details, type the name of your queuemanager or queue sharing group, then click Next.
9. In Step 2.2: Enter connection details, type the connection details to establish aconnection to the queue manager or queue sharing group, then click Next.The default queue port is 1414.
10. In Step 3: Test connection, click Test connection.If your message queue is running, you see the following message:A connection was successfully made to WebSphere MQ.
11. Click Next.A summary opens showing the details of the connection factory.
12. Click Finish and then click Save to save directly to the master configuration.
Creating the WebSphere MQ input queue:
64 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
After you have created the WebSphere MQ queue connection factory, you can nowcreate the JMS queue destination for receiving a request message. To do so, you setthe scope to node or server level, you select the provider, name the queue, andfinally save the configuration.
Procedure
To create the JMS queue:1. In the Integrated Solutions Console, open Resources > JMS and click Queues.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In General Properties, set the fields Name, JNDI name, and Queue name as
follows:
Name JRules Input Queue
JNDI namejms/BRESQueueIn
Queue nameJRulesIn
5. Type in the name of your queue manager or queue sharing group name, thenclick OK.
6. Click Save to save directly to the master configuration.
Creating the WebSphere MQ output queue:
After you have created the input queue for request messages, you must also createthe JMS queue destination for sending a response message. To do so, you set thescope to node or server level, select the provider, name the queue, and save.
Procedure
To create the output queue:1. In the Integrated Solutions Console, open Resources > JMS and click Queues.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In General Properties, set the fields Name, JNDI name, and Queue name as
follows:
Name JRules Output Queue
JNDI namejms/BRESQueueOut
Queue nameJRulesOut
5. Type in the name of your queue manager or queue sharing group name, thenclick OK.
6. Click Save to save directly to the master configuration.
Creating a topic connection factory:
Configuring Decision Server Rules 65
After you have created the queue factory, input queue, and output queue, youmust create a topic connection factory. To do so, you set the scope to node orserver, select the provider and JNDI name, enter the connection details, test theconnection, and save.
Procedure
To create a topic connection factory:1. In the Integrated Solutions Console, open Resources > JMS and click Topic
connection factories.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In Step 1: Configure basic attributes set the fields Name, and JNDI name as
follows and click Next.
Name JRules Topic Connection Factory
JNDI namejms/BRESTopicConnectionFactory
5. In Step 2: Select connection method, select Enter all the requiredinformation into this wizard and click Next.
6. In Step 2.1: Supply queue connection details, type the name of your queuemanager or queue sharing group, then click Next.
7. In Step 2.2: Enter connection details, type the connection details to establish aconnection to the queue manager or queue sharing group (the default queueport is 1414), then click Next.
8. In Step 3: Test connection, click Test connection.If your message queue is running, you see the following message:A connection was successfully made to WebSphere MQ.
9. Click Next.A summary opens showing the details of the connection factory.
10. Click Finish, then click Save to save directly to the master configuration.
Creating the WebSphere MQ input topic:
After you have created the WebSphere MQ topic connection factory, you can createthe JMS topic destination for receiving a request message. To do so, you set thescope to node or server level, select the provider, set the JNDI and input topicnames, and save.
Procedure
To create the JMS input topic:1. In the Integrated Solutions Console, open Resources > JMS and click Topics.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In General Properties, set the fields Name, JNDI name, and Topic name as
follows, then click OK.
Name
JRules Input Topic
JNDI name
66 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
jms/BRESTopicIn
Topic name
JRulesTopicIn
5. Click Save to save directly to the master configuration.
Creating the WebSphere MQ output topic:
After you have created the WebSphere MQ topic connection factory and inputtopic, you must also create the JMS queue destination for sending a responsemessage. To do so, you set the scope to node or server level, select the provider, setthe JNDI and output topic names, and save.
Procedure
To create the JMS output topic:1. In the Integrated Solutions Console, open Resources > JMS and click Topics.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In General Properties, set the fields Name, JNDI name, and Topic name as
follows and then click OK.
Name
JRules Output Topic
JNDI name
jms/BRESTopicOut
Topic name
JRulesTopicOut
5. Click Save to save directly to the master configuration.
Creating the WebSphere MQ queue activation specification:
After you have configured WebSphere MQ queues, you create the queue activationspecification.
About this task
The queue activation specification manages the relationship between the DecisionServer message-driven rule beans (MDB) running in WebSphere Application Serverand a destination in WebSphere MQ. To create the activation specification, you setthe scope to node or server level, select the provider, set the specification and JNDInames, enter the connection details, and save.
Procedure
To create the activation specification:1. In the Integrated Solutions Console, open Resources > JMS and click
Activation specifications.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In Step 1: Configure basic attributes set the fields Name, and JNDI name as
follows and then click Next.
Configuring Decision Server Rules 67
Name
JRules Activation Spec
JNDI name
eis/IlrRuleExecutionEJB
5. In Step 1.1: Specify MDB destination data, set the field Destination JNDIname to jms/BRESQueueIn, set the Destination type to Queue, then click Next.
6. In Step 2: Select connection method, select Enter all the requiredinformation into this wizard and click Next.
7. In Step 2.1: Supply queue connection details, type the name of your queuemanager or queue sharing group, then click Next.
8. In Step 2.2: Enter connection details, type the connection details to establish aconnection to the queue manager or queue sharing group, then click Next.The default queue port is 1414.
9. In Step 3: Test connection, click Test connection.If your message queue is running, you see the following message:A connection was successfully made to WebSphere MQ.
10. Click Next.A summary opens showing the details of the connection factory.
11. Click Finish, then click Save to save directly to the master configuration.
Creating the WebSphere MQ topic activation specification:
After you have created the queue activation specification, you create the topicactivation specification.
About this task
The topic activation specification manages the relationship between the DecisionServer message-driven rule beans (MDB) running in WebSphere Application Serverand a destination in WebSphere MQ. To create the activation specification, you setthe scope to node or server level, select the provider, set the specification and JNDInames, enter the connection details, and save.
Procedure
To create the topic activation specification:1. In the Integrated Solutions Console, open Resources > JMS and click
Activation specifications.2. Set the scope to either Node level or Server level, then click New.3. In the panel, select WebSphere MQ messaging provider, then click OK.4. In Step 1: Configure basic attributes set the fields Name, and JNDI name as
follows, and then click Next.
Name JRules Topic Activation Spec
JNDI nameeis/IlrRuleExecutionTopicEJB
5. In Step 1.1: Specify MDB destination data set the field Destination JNDIname to jms/BRESTopicIn, set the Destination type to Topic, then click Next.
6. In Step 1.2: Configure Durable Subscription, select Nondurablesubscription, then click Next.
68 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
7. In Step 2: Select connection method, select Enter all the requiredinformation into this wizard and click Next.
8. In Step 2.1: Supply queue connection details, type the name of your queuemanager or queue sharing group, then click Next.The default queue port is 1414.
9. In Step 2.2: Enter connection details, type the connection details to establish aconnection to the queue manager or queue sharing group, then click Next.
10. In Step 3: Test connection, click Test connection.If your message queue is running, you see the following message:A connection was successfully made to WebSphere MQ.
11. Click Next.A summary opens showing the details of the connection factory.
12. Click Finish, then click Save to save directly to the master configuration.
Installing the message-driven rule bean:
After you have created the queue and topic activation specifications, you install theDecision Server message-driven rule bean (MDB) in WebSphere Application Serveras an enterprise application. To do so, you create a new enterprise application.
Procedure
To install the Decision Server message-driven rule bean:1. Open the Integrated Solutions Console.2. In the panel, open Applications > New Application and click New Enterprise
Application.3. In the panel, select Local file system and Browse to the following path:
<InstallDir>/executionserver/applicationservers/WebSphere<version_number>/jrules-res-mdb-WAS<version_number>.jar.
4. Click Next.5. Select the check box Detailed - Show all installation options and parameters.6. Expand Choose to generate default bindings and mappings and select the
check box Generate Default Bindings.7. Click Next, then click Continue to accept the security warning.8. Click Step 5: Bind listeners for message-driven beans.
a. Type jms/BRESTopicIn as the Destination JNDI name forIlrRuleExecutionTopicEJB.
b. Type jms/BRESQueueIn as the Destination JNDI name forIlrRuleExecutionEJB.
c. Click Next.9. Click Step 6: Map resource references to resources and then click Next.
Use the default binding for the referenced resources.Step 7 provides a summary.
10. Click Finish.11. When the installation has completed, click Save directly to the master
configuration.12. In the Integrated Solutions Console, open Applications > Application Types
> WebSphere enterprise applications.
Configuring Decision Server Rules 69
13. In the Enterprise Applications page, select the check box next tojrules-res-mdb-WAS<version_number>.jar and click Start to start theapplication.
Enabling server-wide Last Participant Support:
To complete the integration of WebSphere MQ, you enable Last ParticipantSupport.
About this task
To finish integrating WebSphere MQ in WebSphere Application Server forasynchronous execution, you enable Last Participant Support (LPS) so that a singleone-phase commit resource is used with any number of two-phase commitresources in the same global transaction. To do so, you set theACCEPT_HEURISTIC_HAZARD custom property to true in the Integrated SolutionsConsole and then restart the application server.
Procedure
To enable server-wide LPS:1. Open the Integrated Solutions Console.2. Click Servers > Server Types > WebSphere application servers and the server
name.The properties page for the application server opens
3. Under Container Settings, expand Container Services and click TransactionService.The properties page for the transaction service opens.
4. Under Additional Properties, click Custom properties.5. On the Custom Properties page, click New and type ACCEPT_HEURISTIC_HAZARD
as the Name and TRUE as the Value.6. Click Apply and Save directly to the master configuration.7. Restart your application server.
Configuring Rule Execution Server in different environments:
Configuration settings required to enable Rule Execution Server on differentenvironments in a single cell.
About this task
It is very likely that the development of your BRMS requires more than a singledeployment of Rule Execution Server. The development life cycle of a business ruleapplication is similar to any other software development process, including stagesfor implementation, testing, deployment, and maintenance. At the very least, youare likely to need an environment for your development team, one for your QAteam, and another one for in-production applications. In the cases where youconfigure Rule Execution Server in a single cell, it is good practice to isolate therulesets that you use on each server, and ensure that the Execution Units (XUs) donot interfere with each other.
Note: These instructions assume that you do not configure multiple instances ofRule Execution Server in a single cell.
70 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
To set up different environments in a single cell, follow these steps:1. Set up different data sources.2. Deploy and configure a XU for each environment.3. Deploy the Rule Execution Server console for each environment.
Procedure
To configure Rule Execution Server in different environments:1. Set up different data sources.
Use a unique JNDI name. For example: jdbc/resdatasourceEnv1 andjdbc/resdatasourceEnv2.
2. Deploy a XU for each environment and define a J2C connection factory.a. In the side panel, open Resources > Resource Adapters > J2C connection
factories and click the name of the connection factory xu_cf) See Step 9:Deploying the XU RAR for information on creating a connection factory.
b. Modify the JNDI name to eis/XUConnectionFactoryEnv1.
Note: You must modify the execution components that call this XU so thatthey use this JNDI instead of the default.
c. Under Additional Properties, click Custom properties.d. Click the plugins property.e. In the Value field, change xuName=default in the property to
xuName=xuEnv1, and then click OK.f. Click the persistenceProperties property.g. In the Value field, change JNDI_NAME=jdbc/resdatasource to
JNDI_NAME=jdbc/resdatasourceEnv1.h. Click OK and Save to save the changes to the master configuration.i. Repeat the same process for XUs in other environments.
3. Deploy the Rule Execution Server console for each environment.a. To modify the deployment descriptor of the Rule Execution Server console
EAR: in the web.xml file, uncomment the JMX_XU_QUERY_PART parameter andspecify xuName=xuEnv1.
b. Deploy the Rule Execution Server console EAR on the server in the resourcereference settings in the application server.1) Set the JNDI for the data source to jdbc/resdatasourceEnv1.2) Set the JNDI name for the XU to eis/ConnectionFactoryEnv1.
c. Repeat the process to deploy the Rule Execution Server console for the otherenvironments.
4. Restart the node agents after you complete the configuration5. Call the XU instances to register the XU with the Rule Execution Server
console.
Rule Execution Server deployment on cluster environments:
Taking into account cluster configuration and topology, you can deploy RuleExecution Server to WebSphere Application Server cell in cluster mode.
Cluster configuration and topology:
Configuring Decision Server Rules 71
When you deploy Rule Execution Server onto server clusters, each node hosts oneExecution Unit (XU) which is used only by a local rule session. The clustertopology significantly affects the notification mechanism.
Within the Java EE framework, clusters provide mission-critical services to ensureminimal downtime and maximum scalability. A cluster is a group of applicationservers that transparently run your Java EE application as if it were a single entity.
Cluster implementations on Java EE application servers come with their own set ofterminology. Each of the following terms are important to understand how yourcluster performs:v Cluster and component failover servicesv HTTP session failoverv Single points of failure in a cluster topology
On a cluster configuration, deploy an Execution Unit (XU) on each node. There isone XU for each node of a cluster. Use the administration console of applicationservers to handle cluster deployment. A XU instance can be used only by a local(same node) rule session. The rule session and the XU communicate using directJava method calls, so the XU does not require serialization.
A cluster that uses Rule Execution Server involves a collaboration between theRule Execution Server MBeans. The topology of the cluster has significantinfluence on the management of the notification mechanism when a resource ischanged.
The management model is likely to use several times a basic scenario of adistributed notification mechanism within a cluster to interact with the variousExecution Unit (XU) instances. A XU MBean is deployed with the XU tocollaborate with the Rule Execution Server JMX infrastructure.
The following sequence applies:1. A management client sets a resource on a ruleset MBean.
72 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
2. The ruleset makes a query to the MBean Server to retrieve all the XU instancesin the cluster (this operation requires a specific implementation for eachapplication server).
3. A notification is sent to each instance.
Rule Execution Server deployment on WebSphere Application Server cells:
Deployment of Rule Execution Server in a WebSphere Application Server cell(distributed or z/OS) relies on a number of best practices.
A WebSphere Application Server cell is a virtual unit that consists of a deploymentmanager and one or more nodes. When deploying the different Rule ExecutionServer components on WebSphere Application Server or WebSphere ApplicationServer for z/OS, it is important that you deploy the management module onto asingle server in the cell. Only a single management module is necessary to manageall Execution Units (XU) on each server.
It is important to define a logical subset of servers. You must set up theconfiguration in the following way:v Dedicate a stand-alone server of the cell outside the cluster to the deployment of
the Rule Execution Server management module. A failover mechanism is notnecessary.
v Dedicate a cluster of servers or stand-alone servers to the deployment of the XU.You can install the XU (.rar file) only at the node level and you must declarethe resource adapter at the node or server level so that every server in the nodecontains this definition.
v Define the data source at the node level (see the documentation about creatingJDBC providers).
Such a configuration guarantees that a single management module is instantiatedin the WebSphere Application Server cell, as illustrated in the following diagram.
The notification mechanism uses a simple pattern because Rule Execution ServerMBeans rely on the distributed MBean mechanism provided by WebSphere
Configuring Decision Server Rules 73
Application Server. When an MBean is registered in a server of a WebSphereApplication Server cell, it is automatically visible to the Deployment ManagerMBean Server.
To notify each Execution Unit of changes in the management model, query theDeployment Manager MBean Server, then notify each Execution Unit retrieved bythe query.
For more information, see:v WebSphere Application Server Version 7.0 Information Centerv WebSphere Application Server Version 8.0 Information Centerv Building Java EE applications with a WebSphere cluster environment
Using WebSphere Application Server in cluster mode:
When you use WebSphere Application Server in cluster mode, you must define thedata source requirements at one of cell, node, cluster, or server levels.
Procedure
To define the data source:1. Required: Create a JDBC provider on each member node of the WebSphere
cluster.The implementation type of JDBC provider must be an XA data source.
2. Required: Save the configuration.Select the check box Synchronize changes with Nodes.
3. Required: Create the data source under the Rule Execution Server JDBCprovider. This data source must be connected to the Rule Execution Serverdatabase resource.The data source name must be: resdatasource.
74 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
The data source JNDI name must be: jdbc/resdatasource.
Troubleshooting Rule Execution Server:
Various paths are available for you in case of poor performance: you activate theExecution Unit (XU) log to study the execution trace, configure the XU memoryprofiler, explore database driver issues, or allocate more memory to applications.
Note:
v To let a scalable number of users access resources through the Java components,JCA assigns the task of implementing connection pooling to application servervendors.
v If the diagnostics are performed before any Execution Units (XU) have beenstarted, the test is passed and a message displays to report that no ExecutionUnit (XU) has been initialized.
v On WebSphere Application Server, the pool size is not instantiated beforehandand therefore prevents the server diagnostics from validating a Rule ExecutionServer before the first execution of a rule engine. The diagnostics remain usefulto validate a configuration, especially in a cluster, and to check which ExecutionUnits registered with the management model have been started.
For more information, see Troubleshooting and support resources.
Activating the XU log in WebSphere Application Server:
Provides step-by-step instructions to activate the Execution Unit (XU) log inWebSphere Application Server, specify a trace, and change the trace level.
Activating the log:
You activate the Execution Unit (XU) log in the WebSphere Application Serverconsole.
About this task
The log for the Rule Execution Server is stored in the same location as the otherapplication server logs. The default directory is ${SERVER_LOG_ROOT}/trace.log.
Procedure
To activate the log in the WebSphere Application Server console:1. Click Servers > WebSphere application servers.2. In the Application Servers page, click ServerName.3. Under Troubleshooting, click Change log detail levels.4. In the Configuration tab, enter ilog.*=all=enabled into the trace specification,
and click OK.5. Click save to save the change to the master configuration.
Specifying a trace:
When you activate the XU log, you can specify the trace level.
Configuring Decision Server Rules 75
Procedure
To specify a trace in the WebSphere Application Server console:1. In the Application Servers page, click ServerName.2. Under Troubleshooting, click Change log detail levels.3. In the Configuration tab, replace *=info with *=info: ilog.*=all in the trace
specification, and click OK.4. Click save to save the change to the master configuration.
Changing the trace level:
When you specify a trace for the XU log, you can later change the trace level.
Procedure
To change the trace level of the XU:1. Select Resources > Resource Adapters > XU RAR file > J2C Connection
Factories > XU_CF > Custom Properties.2. Modify the traceLevel property. The valid values are: FINE, INFO, WARNING,
SEVERE, OFF.3. Save the server configuration.4. Restart the application server.
Configuring the XU memory profiler:
The XU memory profiler provides information about the memory usage of theExecution Unit (XU). The XU memory profiler is a Java Agent.
Important: When the memory profiler is enabled, performance can be poorer. Useit when memory issues have to be investigated. Do not use the memory profiler ona production server.
When the XU memory profiler is enabled, you can use it to retrieve usageinformation:v In the XU Dump
If you have memory issues, enable the memory profiler before you send the XUmemory dump to IBM Support.
v Using IlrRulesetUsageInformation#getEstimatedMemorySizeThe method gives a size estimation of the memory usage of a ruleset. You canretrieve information on how a ruleset is used from the instance of the class.Get the instance in one of the following ways:– From the XU plug-in, when the method is called.– From the XU custom ruleset cache. The instance is passed as a parameter of
the method .The method getEstimatedMemorySize in IlrRulesetUsageInformation gives a sizeestimation of the memory usage of a ruleset. You can retrieve information onhow a ruleset is used from the instance of theIlrRulesetUsageInformationMonitor class.Get the IlrRulesetUsageInformationMonitor instance from either:– The XU plug-in, when the method setRulesetUsageInformationMonitor in
IlrDefaultPlugin is called.
76 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
– The XU custom ruleset cache. The IlrRulesetUsageInformationMonitorinstance is passed as a parameter of the method initialize in IlrRulesetCache.
To configure the XU memory profiler:
1. Set the XU configuration parameter rulesetUsageMonitorEnabled to true in thera.xml deployment descriptor file of the XU RAR.The XU RAR files with the default configuration properties are located in therespective WebSphere folders under <InstallDir>/executionserver/applicationservers. Modify the ra.xml file, and then update the RAR in theAdministrative console.
2. In the WebSphere Application Server console, open Servers > Server Types >WebSphere application servers.
3. In the Application servers pane, click the name of your server.4. Under Server Infrastructure, expand Java and Process Management and click
Process definition.
Note: On z/OS, an additional layer provides three resources that can beadministered: Adjunct, Control, and Servant. If you are working in thatenvironment, select the Servant.
5. Under Additional Properties, click Java Virtual Machine.6. Add the following line to the parameter Generic JVM arguments:
-javaagent:<InstallDir>/executionserver/lib/jrules-res-memory-agentclient.jar
Rule Execution Server database driver issues:
Lists the known database driver issues.
JDBC not bound:
A JDBC not bound error message is raised when an error occurs during the creationof the data source.
Refer to the traces to locate the original cause. In the vast majority of cases one ofthe following is likely:v A directory does not exist or cannot be read or written.v There is a missing schema or table.v There are missing privileges to access the database resource.
Providing more memory for applications:
If you experience core dumps or Java out-of-memory errors, you can make morememory available to WebSphere Application Server by increasing the maximumheap size for the Java Virtual Machine (JVM).
Procedure
To increase the WebSphere Application Server memory settings:1. In the WebSphere Application Server console, open Servers > Server Types >
WebSphere application servers.2. In the Application servers panel, click the name of your server.3. Under Server Infrastructure, expand Java and Process Management and click
Process definition.
Configuring Decision Server Rules 77
Note: On z/OS, an additional layer provides three resources that can beadministered: Adjunct, Control, and Servant. If you are working in thatenvironment, select Servant.
4. Under Additional Properties, click Java Virtual Machine.5. Set the Initial heap size and Maximum heap size fields to the appropriate
values.For example, you can enter the following values:v For a 32-bit configuration: 512 and 1024 MB respectivelyv For a 64-bit configuration: 1024 and 4096 MB respectively
6. Click OK, then Save to save the changes directly to the master configuration.
Configuring Rule Execution Server using profile templatesYou can create new profiles for Rule Execution Server and configure a WebSphereApplication Server cluster for high availability and scalability.
To create a new stand-alone server to host Rule Execution Server, you must firstcreate a new profile. You can create a profile using the Profile Management Tool orby using the manageprofiles command.
Rule Execution Server profile templates:
When you install Decision Server, the installer copies files for cluster configurationto the directory for shared profiles and to the WebSphere Application Serverdirectory for profile templates.
The following table lists what files are copied to each directory.<WODM_InstallDir> is the directory where you installed Decision Server and<WAS_InstallDir> is the directory where you installed WebSphere ApplicationServer. If you specify <WAS_InstallDir> when you install Decision Server, theprofile templates are copied to that directory as shown in the table.
Important: If you do not install the product Samples and Tutorials, you mustmanually copy the folders from <WODM_InstallDir> to <WAS_InstallDir>.
Table 2. Installation of profile template files and directories
Target directory When Copied files
<WODM_InstallDir>/executionserver/applicationservers/WebSphere8
After DecisionServer isinstalled
v The EAR files for the Rule ExecutionServer console, Scenario Service Provider(SSP), and hosted transparent decisionservices
v The RAR file for the Execution Unit (XU)
<WODM_InstallDir>/shared/profiles/profileTemplates/rules
After DecisionServer isinstalled
v The Decision Server profile template toaugment a deployment manager profile
v The management/ds subdirectory thatcontains the scripts to augment adeployment manager profile
<WAS_InstallDir>/profileTemplates/rules
After DecisionServer isinstalled if<WAS_InstallDir>is selected in theinstaller
The management/ds subdirectory thatcontains the scripts to augment adeployment manager profile.
78 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Configuring Rule Execution Server on a new profile:
To create a new stand-alone instance of Rule Execution Server environment, youmust first create a Decision Server profile. You can create a profile using the ProfileManagement Tool or by using the manageprofiles command.
Before you begin
During profile creation, you are asked to select the database manager that hosts thetables for the execution server run time. Unless you are using Apache Derby, createthis database before you configure a new profile. See Creating a Rule ExecutionServer database.
About this task
Depending on your operating system, you can either use the Profile ManagementTool or the manageprofiles command to create a new profile:v On a 32-bit operating system, you can use the Profile Management Tool. The
Profile Management Tool is not supported on an HP-UX operating system, onany 64-bit operating system, or on z/OS.
v On a 32-bit operating system or any other operating system, you can use themanageprofiles command.
The procedure describes how to use the manageprofiles command to configureRule Execution Server on a new profile.
Procedure
1. Open a command prompt (Windows) or a terminal emulator (Linux and UNIXenvironments) and navigate to the <WAS_InstallDir>/bin directory.
2. Run the manageprofiles command by using manageprofiles.bat for Windowsor manageprofiles.sh for Linux and UNIX environments. You must provide thefollowing parameters:
-createTo create the new profile.
-templatePath <template_path>where <template_path> is the location of the profile template. Provide thepath to <WAS_InstallDir>/profileTemplates/rules/default/ds.
Use the following optional parameters:
-dsHome installation locationwhere installation location is the fully-qualified path of the Decision Serverinstallation directory <InstallDir>. You must specify this parameter if youhave installed Decision Server in a non-default location.
-profileName profile_namewhere profile_name is the name of the profile.
-cellName cell_namewhere cell_name is the name of the cell.
-nodeName node_namewhere node_name is the name of the node.
-hostName host_namewhere host_name is the host name of the computer hosting the profile.
Configuring Decision Server Rules 79
-serverName server_namewhere server_name is the server name.
-enableAdminSecurity true|falsewhere true switches on WebSphere Application Server administrativesecurity. If you provide this parameter, you must also provide-adminUserName and -adminPassword. The default is false if you do notspecify this parameter.
-adminUserName usernamewhere username is the user ID to access WebSphere Application Server.Only required if enableAdminSecurity is enabled.
-adminPassword passwordwhere password is the password for the user ID to access WebSphereApplication Server. Only required if enableAdminSecurity is enabled.
-dbType database_typewhere database_type specifies the database product. Valid values are:v Derby_Embedded: the default valuev DB2_Universal
v Derby_NetworkServer
v Oracle
v MS_SQL_Server
-dbName database_namewhere database_name is the name of the database. Required unless -dbTypeis Derby_Embedded.
-dbUserId database_user_namewhere database_user_name is the user ID to access the database server.Required unless -dbType is Derby_Embedded.
-dbPassword passwordwhere password is the password for the user ID to access the databaseserver. Required unless -dbType is Derby_Embedded.
-dbJDBCClasspath database_jdbc_classpathwhere database_jdbc_classpath specifies the path to the JDBC class path files.Required unless -dbType is Derby_Embedded.
-dbJDBCLicenseClasspath database_jdbc_license_classpathwhere database_jdbc_license_classpath specifies the path to the JDBC classpath files. Only required if -dbType is DB2_Universal.
-dbHostName host_namewhere host_name is the host name for the database server. Required unless-dbType is Derby_Embedded.
-dbServerPort port_numberwhere port_number is the port of the TCP/IP service, or the port on whichthe database is listening. Required unless -dbType is Derby_Embedded.
Results
After running the manageprofiles command, the profile is created.
80 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Examples
The following examples show how to configure Rule Execution Server with thedefault messaging provider on Windows and Linux.
The first example creates a new application server profile on Windows usingembedded Apache Derby as the database provider and WebSphere ApplicationServer default messaging as the messaging provider.manageprofiles.bat -create -templatePath "C:\Program Files\IBM\WODM80\WODM\WAS\profileTemplates\rules\default\ds" -dsHome "C:\Program Files\IBM\WODM
The second example creates a new application server profile on Linux and UNIXenvironments using embedded Apache Derby as the database provider andWebSphere Application Server default messaging as the messaging provider.manageprofiles.sh -create -templatePath"/opt/ibm/WODM80/WODM/WAS/profileTemplates/rules/default/ds" -dsHome "/opt/ibm/WODM80/WODM"
Augmenting an existing profile with Rule Execution Server:
To create a new instance of Rule Execution Server on an existing WebSphereApplication Server, you can augment the profile using the manageprofilescommand.
Before you begin
Before you augment an existing WebSphere Application Server application serverprofile, ensure that all application servers in the profile are stopped.
During profile creation; you are asked to select the database manager, which hoststhe tables for the event runtime. If you are not using Apache Derby, create thedatabase before you create a new profile. See Creating a Rule Execution Serverdatabase.
About this task
You can use the manageprofiles command or the Profile Management Tool toaugment an existing profile:v The manageprofiles command is supported on all operating systems.v The Profile Management Tool is only supported on 32-bit operating systems. The
Profile Management Tool is not supported on an HP-UX operating system, onany 64-bit operating system, or on z/OS.
The procedure describes how to use the manageprofiles command to augmentRule Execution Server on an existing profile.
Procedure
1. Open a command prompt (Windows) or a terminal emulator (Linux and UNIXenvironments) and navigate to the <WAS_InstallDir>/bin directory.
2. Run the manageprofiles command, using manageprofiles.bat for Windows ormanageprofiles.sh for Linux and UNIX environments. Provide the followingparameters:
-augmentTo augment the existing profile.
-unaugmentTo undo the augmentation of the profile.
Configuring Decision Server Rules 81
-templatePath <template_path>where <template_path> is the location of the profile template. Provide thefollowing value for the application server profile: <WAS_InstallDir>/profileTemplates/rules/default/ds.
-profileName profile_namewhere profile_name is the name of the existing application server profile thatyou are augmenting.
Optionally, you can specify the following parameters:
-dsHome installation locationwhere installation location is the fully-qualified path that is the installationlocation for Decision Server. You must specify this parameter if you haveinstalled Decision Server in a location other than the default.
-profileName profile_namewhere profile_name is the name of the profile.
-cellName cell_namewhere cell_name is the name of the cell.
-nodeName node_namewhere node_name is the name of the node.
-hostName host_namewhere host_name is the host name of the computer hosting the profile.
-serverName server_namewhere server_name is the server name.
-enableAdminSecurity true|falsewhere true switches on WebSphere Application Server administrativesecurity. If you provide this parameter, you must also provide-adminUserName and -adminPassword. The default is false if you do notspecify this parameter.
-adminUserName usernamewhere username is the user ID to access WebSphere Application Server.Only required if enableAdminSecurity is enabled.
-adminPassword passwordwhere password is the password for the user ID to access WebSphereApplication Server. Only required if enableAdminSecurity is enabled.
-dbType database_typewhere database_type specifies the database product. Valid values are:v Derby_Embedded: the default valuev DB2_Universal
v Derby_NetworkServer
v Oracle
v MS_SQL_Server
-dbName database_namewhere database_name is the name of the database. Required unless -dbTypeis Derby_Embedded.
-dbUserId database_user_namewhere database_user_name is the user ID to access the database server.Required unless -dbType is Derby_Embedded.
82 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
-dbPassword passwordwhere password is the password for the user ID to access the databaseserver. Required unless -dbType is Derby_Embedded.
-dbJDBCClasspath database_jdbc_classpathwhere database_jdbc_classpath specifies the path to the JDBC class path files.Required unless -dbType is Derby_Embedded.
-dbJDBCLicenseClasspath database_jdbc_license_classpathwhere database_jdbc_license_classpath specifies the path to the JDBC classpath files. Only required if -dbType is DB2_Universal.
-dbHostName host_namewhere host_name is the host name for the database server. Required unless-dbType is Derby_Embedded.
-dbServerPort port_numberwhere port_number is the port of the TCP/IP service, or the port on whichthe database is listening. Required unless -dbType is Derby_Embedded.
Results
After running the manageprofiles command, the profile is augmented.
Examples
The following examples show how to configure Rule Execution Server with thedefault messaging provider.
The first example augments an existing application server profile called AppSrv01on Windows using embedded Apache Derby as the database provider.manageprofiles.bat -augment-templatePath "C:\Program Files\IBM\WODM80\WODM\WAS\profileTemplates\rules\default\ds" -dsHome"C:\Program Files\IBM\WODM80\WODM" -profileName AppSrv01
The second example augments an existing application server profile calledAppSrv01 on Linux and UNIX environments using embedded Apache Derby asthe database provider.manageprofiles.sh -augment-templatePath "/opt/ibm/WODM80/WODM/WAS/profileTemplates/rules/default/ds" -dsHome/opt/ibm/WODM80/WODM -profileName AppSrv01
The following examples show how to unaugment Rule Execution Server from anexisting profile.
The first example unaugments an existing Decision Server application serverprofile called WODMSrv01 on Windows.manageprofiles.bat -unaugment -templatePath"C:\Program Files\IBM\WODM80\WODM\WAS\profileTemplates\rules\default\ds"-profileName WODMSrv01
The second example unaugments an existing Decision Server application serverprofile called WODMSrv01 on Linux and UNIX.manageprofiles.sh -unaugment -templatePath"/opt/ibm/WODM80/WODM/WAS/profileTemplates/rules/default/ds"-profileName WODMSrv01
Configuring Rule Execution Server for high availability and scalability:
Configuring Decision Server Rules 83
To achieve high availability and scalability, you can configure a cluster on yourapplication server. An application server cluster provides workload management(WLM) and failover for the applications that are deployed on the cluster.
Decision Server provides “managed” templates for Rule Execution Server to createand augment a WebSphere Application Server cluster.
You can either augment the default deployment manager profile or create a newdesignated profile. You then run the .bat or .sh with the parameters that arenecessary to configure the cluster. If the cluster name does not exist in the targetnode, the script creates it, so that you can configure clusters for any topology.
Augmenting a deployment manager profile with Rule Execution Server:
For high availability and scalability of your applications, you can configure RuleExecution Server on a WebSphere Application Server cluster by running aconfiguration script. You must first augment a management profile.
Before you begin
Before you start the script to augment the profile, you must install Decision Server,create a deployment manager profile, and make sure that a node exists:1. Install Decision Server, which includes WebSphere Application Server and its
profile templates.2. Create a deployment manager profile by running the Profile Management Tool,
unless one exists already. For more information, see the WebSphere ApplicationServer Information Center. This step creates a new directory, for exampleprofiles/Dmgr01/bin.
3. Create a node. A target node is mandatory. The node receives the baseconfiguration, that is, the first cluster member and a server for the RuleExecution Server console. The node must be started and visible by thedeployment manager. You can create a default node on another computer, usean existing node, or use the -createNode option to create the target node on thecomputer where the configuration is run.
About this task
You augment the deployment manager profile so that you can create additionalnodes using the provided template.
Procedure
Launch the manageprofiles file with the -augment options.v On Windows: <WAS_InstallDir>\bin\manageprofiles.bat -augment
-profileName Dmgr01 -templatePath <WAS_InstallDir>\profileTemplates\rules\management\ds
v In UNIX environments: <WAS_InstallDir>/bin/manageprofiles.sh -augment-profileName Dmgr01 -templatePath <WAS_InstallDir>/profileTemplates/rules/management/ds
wherev <WAS_InstallDir> is the directory where you installed WebSphere Application
Server.v Dmgr01 is the name of the profile deployment manager that you created as a
prerequisite.
84 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Results
The manageprofiles[.bat|.sh] command has the following effects:1. It creates the users resAdmin, resMonitor, and resDeployers.2. It copies the configureDSCluster.bat script for Windows or the
configureDSCluster.sh script for UNIX platforms to the deployment managertarget directory, for example profiles/Dmgr01/bin.
Related concepts:“Configuring Rule Execution Server for high availability and scalability” on page83To achieve high availability and scalability, you can configure a cluster on yourapplication server. An application server cluster provides workload management(WLM) and failover for the applications that are deployed on the cluster.“Rule Execution Server profile templates” on page 78When you install Decision Server, the installer copies files for cluster configurationto the directory for shared profiles and to the WebSphere Application Serverdirectory for profile templates.
Running the configureDSCluster script to create a cluster:
After you have augmented the default management profile, you can run the scriptthat configures Rule Execution Server as a WebSphere Application Server cluster.
Before you begin
Before you start the script to augment the profile, you must set the WODM_HOMEenvironment variable. The configuration script that you run in step 2 on page 86uses that variable.
About this task
After you have augmented the management profile, you set the clusterconfiguration properties, and run the configuration script.
Note: You cannot use the configuration script to initialize the cluster nor to add anode to an existing cluster.
Procedure
1. Edit the configureDSCluster.properties file to set the cluster name anddatabase values.You can find this file in the dmgr/bin/rules/ directory. The configurationproperties must contain values for the following keys:
wodm.dsrules.clusterNameThe value can be the name of an existing cluster. If no cluster exists already,a cluster is created. For example: DecisionCluster
wodm.dsrules.rulesMgrServerNameThe name of the server that hosts the Rule Execution Server console. Forexample: RulesMgrSrv
wodm.dsrules.db.typeThe database type: DB2, Oracle, or MSQL
wodm.dsrules.db.jdbcDriverPathThe path to the JDBC drivers. Separate the driver names with a colon (;).
Configuring Decision Server Rules 85
For example: D:/software/IBM/WODM80/drivers/db2jcc.jar;D:/software/IBM/WODM80/drivers/db2jcc_license_cu.jar;
wodm.dsrules.db.nameThe name of the database. For example: MyDB
wodm.dsrules.db.hostnameThe name of the host where the database is hosted: For example:MyDB_server
wodm.dsrules.db.portThe port number to establish the connection to the database
wodm.dsrules.db.userThe user name to connect to the database. For example: db_user1
wodm.dsrules.db.passwordThe password for the user to connect to the database. For example:db_user1_pwd
2. Navigate to the <profile_name>/bin directory and start the configureDSClusterscript with the required parameters.The general command line syntax is: configureDSCluster[.sh|.bat]-ParameterName1 parameterValue1 -ParameterName2 parameterValue2 ... . Ifyou make a mistake, such as a missing parameter or a wrong node name, youcan execute the script again.v On Windows:
WAS_InstallDir\profiles\Dmgr01\bin\configureDSCluster.bat -dmgrAdminUsername websphere -dmgrAdminPassword websphere -clusterPropertiesFile WAS_Ins
v On UNIX:WAS_InstallDir/profiles/Dmgr01/bin/configureDSCluster.sh -dmgrAdminUsername websphere -dmgrAdminPassword websphere -clusterPropertiesFile WAS_Inst
Table 3. Cluster configuration parameters
Parametername Required Description
-dmgrAdminUsernameMandatory The WebSphere Application Server administrator’s useridentifier
-dmgrAdminPasswordMandatory The WebSphere Application Server administrator’spassword.
-clusterPropertiesFileMandatory The path to the properties file.
-uninstall Optional Removes all the applications and resources from thecluster. The cluster itself is not removed because itmight contain other applications. See “UninstallingRule Execution Server from a cluster” on page 88.
-createNode Optional If you specify this parameter, the script creates adefault node profile with the name set in the-targetNodeName parameter.
-targetNodeNameOptional By default, the name of the target installation node isset to RulesNode01.
-dmgrHostNameOptional Use this parameter to specify the name of the host onwhich the deployment manager is located. Thisparameter is mandatory if you create the target nodeby setting the -targetNodeName parameter.
-dmgrPort Optional The SOAP TCP port of the deployment manager. Bydefault, 8879.
86 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Results
The script performs the following actions:v Installs the JDBC provider, JCA connector, and data source at node level.v Installs the non-clusterized Rule Execution Server console.v Deploys the hosted transparent decision services and Scenario Service Provider
(SSP) to the cluster member. Users are mapped to application groups when anapplication is deployed.
v Starts the deployment manager server if it is not already started.v Configures security.v Creates the resAdmin, resDeployer, resMonitor users. These users belong to the
WebSphere Application Server monitor so that JMX notifications work on allcluster nodes.
v Configure users and groups.v Installs the Execution Unit (XU).v Maps users and groups to roles.v Starts the cluster, servers, and applications.
When the script completes, the cluster is up and running. The user should thenconfigure the load balancing system, such as IBM HTTP Server.
Unaugmenting Rule Execution Server from existing profiles:
You can unaugment Decision Server from existing profiles without deleting thecluster.
About this task
Use the manageprofiles command to unaugment Decision Server from existingprofiles in a cluster.
Procedure
Launch the manageprofiles file with the following -unaugment options:v On Windows: <WAS_InstallDir>\bin\manageprofiles.bat -unaugment
-profileName Dmgr01 -templatePath <WAS_InstallDir>\profileTemplates\rules\management\ds -nodeName DecisionNode -cellName DecisionCell-targetNodeName DecisionServerNode01
v In UNIX environments: <WAS_InstallDir>/bin/manageprofiles.sh -unaugment-profileName Dmgr01 -templatePath <WAS_InstallDir>/profileTemplates/rules/management/ds -nodeName DecisionNode -cellName DecisionCell-targetNodeName DecisionServerNode01
wherev <WAS_InstallDir> is the directory where you installed WebSphere Application
Server.v Dmgr01 is the name of the profile deployment manager that you created as a
prerequisite to configuring the cluster.v ds is the abbreviation of Decision Server.v -nodeName and -cellName are the names of the node and cell that you defined
when you created the deployment manager profile.v -targetNodeName is the name of the node to which you installed Decision Server.
Configuring Decision Server Rules 87
Results
When the process completes, a message similar to the following one is displayed:INSTCONFSUCCESS: Profile unaugmentation succeeded
The command removes the resAdmin, resDeployer, and resMonitor users. Thecluster is kept as is to prevent any risk of deleting previously existingconfigurations.Related concepts:“Configuring Rule Execution Server for high availability and scalability” on page83To achieve high availability and scalability, you can configure a cluster on yourapplication server. An application server cluster provides workload management(WLM) and failover for the applications that are deployed on the cluster.“Rule Execution Server profile templates” on page 78When you install Decision Server, the installer copies files for cluster configurationto the directory for shared profiles and to the WebSphere Application Serverdirectory for profile templates.
Uninstalling Rule Execution Server from a cluster:
You can uninstall Rule Execution Server from an existing cluster.
About this task
To uninstall Rule Execution Server from a cluster, you use the same configurationscript that you use to configure the cluster.
Procedure
1. Navigate to the <profile_name>/bin directory.2. Launch the configureDSCluster[.sh|.bat] script with the -uninstall
argument.The general command line is:configureDSCluster[.sh|.bat] -dmgrAdminUsername username -dmgrAdminPassword password -clusterPropertiesFile filePath -uninstall
v On Windows:<WAS_InstallDir\profiles\Dmgr01\bin\configureDSCluster.bat -dmgrAdminUsername websphere -dmgrAdminPassword websphere -clusterPropertiesFile <WAS_I
v On UNIX:<WAS_InstallDir/profiles/Dmgr01/bin/configureDSCluster.sh -dmgrAdminUsername websphere -dmgrAdminPassword websphere -clusterPropertiesFile <WAS_In
Table 4. Cluster configuration parameters
Parametername
Mandatory/Optional Description
-dmgrAdminUsernameMandatory The WebSphere Application Server administrator’s useridentifier that you defined when you installed DecisionServer
-dmgrAdminPasswordMandatory The WebSphere Application Server administrator’spassword that you defined when you installed DecisionServer.
-clusterPropertiesFileMandatory The full path to the properties file.
-uninstall Mandatory Removes all the applications and resources from thecluster. The cluster itself is not removed because itmight contain other applications.
88 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Table 4. Cluster configuration parameters (continued)
Parametername
Mandatory/Optional Description
-createNode Optional If you specify this parameter, the script creates adefault node profile with the name set in the-targetNodeName parameter.
-targetNodeNameOptional By default, the name of the target installation node isset to RulesNode01.
-dmgrHostNameOptional Use this parameter to specify the name of the host onwhich the deployment manager is located. Thisparameter is mandatory if you create the target nodeby setting the -targetNodeName parameter.
-dmgrPort Optional The SOAP TCP port of the deployment manager. Bydefault, 8879.
Results
This command has the following results:v Uninstalls hosted transparent decision services and Scenario Service Provider
(SSP).v Uninstalls the Rule Execution Server console.v Removes the Rule Execution Server console server.v Uninstalls the Execution Unit (XU).v Uninstalls the data source.v Removes the administrative and applicative groups.Related concepts:“Configuring Rule Execution Server for high availability and scalability” on page83To achieve high availability and scalability, you can configure a cluster on yourapplication server. An application server cluster provides workload management(WLM) and failover for the applications that are deployed on the cluster.“Rule Execution Server profile templates” on page 78When you install Decision Server, the installer copies files for cluster configurationto the directory for shared profiles and to the WebSphere Application Serverdirectory for profile templates.
Configuring Rule Execution Server on Tomcat 7.0To use Rule Execution Server on a new instance of Tomcat, you must deploy theprovided archives for this server and perform a number of configuration tasks.
Before you startTo configure Rule Execution Server on Tomcat, you must follow specific steps.Some are mandatory, while others are optional.
The Rule Execution Server console includes an Installation Settings wizard. If youlog on as the administrator, you can use it to create resources in an empty databaseschema and run SQL drop statements that clear an existing Rule Execution Serverdatabase. See “Populating a database by using the Rule Execution Server Console”on page 94 for more information.
Configuring Decision Server Rules 89
You can also run Ant commands for some tasks, including repackaging themanagement archive.
Prerequisites: environment variables
You must set an environment variable named JRE_HOME to the directory in whichyou installed the Java runtime environment (JRE). Alternatively, you can use theJava developer kit (JDK) instead of the JRE. In this case, you must set anenvironment variable named JAVA_HOME to the directory in which you installed theJDK.
Set TOMCAT_HOME as an environment variable.
What steps to follow
The following table shows the steps that you must follow to install Rule ExecutionServer on Tomcat 7.0, depending on the type of persistence that you choose.
Installation StepsPersistence
File Data source JDBC
“Step 1: Selecting and applying thepersistence type”
Defaultpersistencemode
“Step 2: Enforcing database userpermissions” on page 91
Not applicable
“Step 3: Creating an emptydatabase schema” on page 92
Not applicable
“Step 4: Deploying themanagement Rule Execution ServerWAR” on page 93
“Step 5:Populating aRule ExecutionServer database”on page 94
“Populating adatabase byusing the RuleExecution ServerConsole” onpage 94
Not applicable
“Populating adatabase byrunning SQLscripts” on page98
Not applicable
“Step 6: Deploying the hostedtransparent decision service” onpage 100
Optional Optional Optional
“Step 7: Verifying theconfiguration” on page 102
Recommended Recommended Recommended
Step 1: Selecting and applying the persistence typeYou can change the default datasource RuleApp and Java XOM persistencesettings by running an Ant script that generates a new Rule Execution Servermanagement archive.
90 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
By default, persistence is set to datasource for both RuleApps and managed JavaXOMs in the deployment descriptor of the Rule Execution Server managementarchive.
To change the persistence settings, the distribution provides an Ant script in the<WODM_InstallDir>/executionserver/bin/ressetup.xml file. Use it to create a newinstance of the Rule Execution Server management archive and, in the case of aJava EE application server, the Execution Unit (XU).
Note:
v If you use file-based persistence on Solaris, your file system must support allcharacters used in directory and file names that are present in the ruleset path(RuleApp name and ruleset name). Set the LANG system property with theencoding that is compatible with your package and rule names, for exampleen_US.UTF-8.
v If you select the file persistence type for RuleApps, you cannot use DecisionWarehouse.
v MySQL persistence: If you choose to use MySQL as a persistence back end, addor set the following properties in the MySQL configuration file my.ini (onWindows) or my.cnf (on UNIX operating systems):sql-mode=STRICT_ALL_TABLESmax_allowed_packet=1073741824
For more information about these settings, see the MySQL 5.0 reference manual:5.1.6. Server SQL Modes and 5.1.3 Server System Variables.
Step 2: Enforcing database user permissionsIf Rule Execution Server data is stored in a database, you can restrict the type ofoperations that a user can perform on a database by defining access privileges.
The data source that contains the Rule Execution Server data is always mapped toa database user.
Note:
The database privilege types differ across the supported databases. Defining andassigning privileges is performed by a database administrator.
Any privilege listed in the table as Not required denotes that it is not required bythe Rule Execution Server data source.
The following table highlights the database permissions that you must enforce fordatabase users, with attention given to the type of operation that you want them toperform:
Database permission
Operation
Browse and editrulesets/ruleApps(resAdmin)
Create the Rule ExecutionServer schema
CREATE ANY INDEX Not required Required
DROP ANY INDEX Not required Required
CREATE ANY SEQUENCE Not required Required
DROP ANY SEQUENCE Not required Required
SELECT ANY SEQUENCE Required Not required
Configuring Decision Server Rules 91
Database permission
Operation
Browse and editrulesets/ruleApps(resAdmin)
Create the Rule ExecutionServer schema
CREATE ANY TABLE Not required Required
DROP ANY TABLE Not required Required
INSERT ANY TABLE Required Not required
SELECT ANY TABLE Required Not required
UPDATE ANY TABLE Required Not required
DELETE ANY TABLE Required Not required
CREATE ANY TRIGGER Not required Required
CREATE ANY VIEW Not required Required
DROP ANY VIEW Not required Required
Step 3: Creating an empty database schemaUse SQL scripts to create a dedicated schema in the database if you are usingdatabase persistence.
Before you begin
If you set persistence to file in “Step 2: Enforcing database user permissions” onpage 7, you can skip all the database-related tasks, and proceed to “Step 4:Deploying the management Rule Execution Server WAR” on page 93.
About this task
The following procedure assumes that the Tomcat installation home directory isC:\Program Files\Apache Software Foundation\Tomcat 7.0, and the database isDerby. If your configuration is different, use the procedure as an example, andmodify it as necessary.
If you use the default persistence (data source) or you set persistence to JDBC, youmust create an empty dedicated database schema, and then populate the database.v To create an empty database schema, follow the procedure below, which goes
through the steps for a Derby database.v After creating a database schema, you must populate the database with tables
and views. Continue to “Step 4: Deploying the management Rule ExecutionServer WAR” on page 93, and then to “Step 5: Populating a Rule ExecutionServer database” on page 94.
v On Tomcat, you use the Execution Unit (XU) as a Java SE component (no notionof node).
Procedure1. Stop the application server.2. Launch <TomcatInstallDir>/derby/bin/embedded/ij.bat or ij.sh.3. Create the database and connect to it.
For example, to create the new database resdb as the user resAdmin andconnect to it, use the command:ij>connect 'jdbc:derby: <TomcatInstallDir>/derby/databases/resdb;user=resAdmin;password=resAdmin;create=true';
92 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
4. Close the ij utility.ij> quit;
What to do next
You can also create the schema by defining the createDatabase property in thedeployment descriptor. If you set the property to create, as in the followingexample, the database is created when the application connects to it:<xa-datasource-property name="CreateDatabase">create</xa-datasource-property>
Step 4: Deploying the management Rule Execution Server WARDeploy the WAR file to use the Rule Execution Server console on Tomcat.
About this task
To use the Rule Execution Server console on Tomcat 7.0, you must deploy theprovided WAR file.
Use the following procedure to set up and run the Rule Execution Server consolemanagement WAR.
Note: For more information about how to set the JNDI name of the data source,see JNDI Datasource HOW-TO.
Procedure1. Copy the file <InstallDir>/executionserver/applicationservers/tomcat7/
res.war to {TOMCAT_HOME}/webapps.2. Open the {TOMCAT_HOME}/conf/tomcat-users.xml file.3. In the file, add the following code after the <tomcat-users>:
<role rolename="resAdministrators"/><role rolename="resDeployers"/><role rolename="resMonitors"/><user username="resAdmin" password="resAdmin" roles="resAdministrators,resDeployers,resMonitors"/><user username="resDeployer" password="resDeployer"roles="resDeployers,resMonitors"/><user username="resMonitor" password="resMonitor" roles="resMonitors"/>
4. Save the file.5. Copy your database driver to the {TOMCAT_HOME}/lib directory.6. Open the {TOMCAT_HOME}/conf/server.xml file.7. In the file, declare the database just before the tag closing the global resources
definitions: </GlobalNamingResources>. For example, if you are using Derby,and the name of your database is resdb, add the following lines:<Resource name="jdbc/resdatasource" type="javax.sql.DataSource"
auth="Container"username="MyResAdmin" password="MyResAdminPassword"driverClassName="org.apache.derby.jdbc.EmbeddedDriver"url="jdbc:derby:{TOMCAT_HOME}/bin/resdb;create=true"/>
Note: To declare the database, you log on to a different account than the oneused when you defined the users and roles in the previous step. The username and password are, therefore, likely to be different for each account.
8. In the same file, add the link to your database for res.war just before the tagclosing the localhost definition: </Host>:
Configuring Decision Server Rules 93
<Context path="/res"docBase="res.war"debug="0"reloadable="true"crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"prefix="localhost_res_log."suffix=".txt" timestamp="true"/>
<ResourceLink name="jdbc/resdatasource"global="jdbc/resdatasource"type="javax.sql.DataSource"/>
</Context>
9. Start Tomcat:v Open Apache Tomcat 7.0 Tomcat Properties on your Windows taskbar, or
click Tomcat7w.exe in {TOMCAT_HOME}/bin.v Click Start in the General tab.
10. Open the Rule Execution Server console in your browser by entering res withthe root URL on the host machine: http://localhost:8080/resIf your browser is not running on the same host as the application server,replace localhost with the address of the machine. If the web application ismapped to a host with a different port number, change the port number from8080 to the host port number.The log for the Rule Execution Server console is written to the{TOMCAT_HOME}/logs/res-console.log file.
Step 5: Populating a Rule Execution Server databaseAfter you have created an empty database schema, you can populate the RuleExecution Server database by running SQL scripts from either the Rule ExecutionServer Console or the SQL tool with your database.
Populating a database by using the Rule Execution Server Console:
To populate a Rule Execution Server database, you can run the database scriptsfrom the Rule Execution Server Console and use the Installation Settings wizard ifyou work on Windows and other supported distributed platforms.
Installation Settings wizard overview:
On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.
The Rule Execution Server Console contains an Installation Settings wizard. If youare configuring your Rule Execution Server with database persistence and want topopulate your database, you can use the wizard for the following purposes:v Select the type of schema database resources that you want to create.v Create the required resources, in an empty database schema, to use Rule
Execution Server.
Important:
– You must create the empty database schema on your application server beforeyou use the Installation Settings wizard. For more information, see “Step 3:Creating an empty database schema” on page 92.
– To open the Installation Settings wizard, you must log in to the RuleExecution Server Console with the administrator rights resAdmin.
94 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
The Installation Settings wizard creates all the required tables for Rule ExecutionServer and Decision Warehouse.
Note:
If you are using file persistence or have an existing data schema, the InstallationSettings wizard does not open when you log in to the Rule Execution ServerConsole. If you want to modify the database schema after having created thedatabase tables already, you must run the SQL scripts in the database client.
The combination of persistence settings for RuleApps and managed Java XOMsaffects the way in which you use the Installation Settings wizard.v If the RuleApp persistence and the Java XOM persistence are both set to file,
no wizard is presented.v If the RuleApp persistence and the Java XOM persistence are both set to
datasource or jdbc, the RuleApp persistence details part of the InstallationSettings wizard opens for you to create the schema for RuleApps and theDecision Warehouse trace when you sign in to the Rule Execution ServerConsole. After you have completed this step, the Java XOMs persistence detailspart of the wizard opens for you to configure the database for Java XOMpersistence.
v If the RuleApp persistence is set to file and the Java XOM is set to datasourceor jdbc, you see only Java XOMs persistence details, and you cannot use theDecision Warehouse.
v If the RuleApp persistence is set to datasource and the Java XOM is set to fileor is not defined, only RuleApp persistence details opens for you to create theschema for RuleApps when you sign in to the Rule Execution Server Console.The wizard does not show Java XOMs persistence details.
The following table summarizes the cases.
Persistence
RuleApps
file datasource or jdbc
Java XOMs file No InstallationSettings wizard
RuleAppspersistence detailsonly
datasource or jdbc Java XOMspersistence detailsonly
No DecisionWarehouse
Complete InstallationSettings wizard
Opening the Rule Execution Server Console:
To open the Rule Execution Server Console and the Installation Settings wizard,you must sign in with administration rights.
Before you begin
Read “Installation Settings wizard overview” on page 94.
Configuring Decision Server Rules 95
About this task
To access the Installation Settings wizard, you must first open the Rule ExecutionServer Console and log in.
Procedure
1. Start your database if you are using data source persistence or you setpersistence to JDBC.
2. Open the Rule Execution Server Console in a web browser by typing res at theroot URL on the host machine:http://localhost:8080/res
If your browser is not running on the same host as the application server,replace localhost with the address of the machine. If the web application ismapped to a host with a different port number, change the port number from8080 to the host port number.
3. Log in to the Rule Execution Server Console as the administrator.For example:
User ID
resAdmin
Password
resAdmin
Results
If you are using database persistence, and the database schema is empty, theInstallation Settings wizard opens and you can use it to complete the installation.Related information:“Installation Settings wizard overview” on page 94On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.
Step 1: Welcome to the Installation Settings wizard:
The Installation Settings wizard opens with the Rule Execution Server Console.
If you open the Rule Execution Server Console with an empty database schema,and datasource or jdbc as the persistence setting, the Installation Settings wizardopens.
The wizard can display the following parts:v RuleApp persistence details: This part opens if you set datasource persistence
for RuleApps, whatever the persistence type for managed Java XOMs.v Java XOMs persistence details: This part opens after RuleApp persistence
details if you have set datasource or jdbc persistence for both RuleApps andJava XOMs. In this case, you go through the same steps twice.The wizard starts with Java XOMs persistence details if you have set thepersistence type to file for RuleApps, and to datasource or jdbc for managedJava XOMs.
Both parts of the wizard are similar, and you use them in the same way:
96 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
1.
The Welcome page provides the following information:v Persistence details about the type of database used. This includes information
about the driver and JDBC URL.v A brief description of the purpose of the Installation Settings wizard.v A diagnostic report that provides information about why the persistence
check failed (because you have not created the database tables).2. Click Next to proceed.
Step 2: Choose the database schema:
Select a schema for your database. The wizard includes settings for DB2, andoptionally, you can select a customized SQL script.
Before you begin
To use the Installation Settings wizard, you must create a database schema.
About this task
After reading the Welcome page, you select an available Rule Execution Serverdatabase schema or you upload a custom schema.
Procedure
1. In the Database schema selected field, select an available type of databaseschema.By default, the wizard selects a type that corresponds to the type of databasethat you are using. However, you can choose another type from the drop-downlist.If you select a db2 or db2_os390 schema, an extra field opens so that you canenter the name of the buffer pool, which is used to create the DecisionWarehouse tablespace. This buffer pool must have a page size of 32K. Checkthe DB2 documentation for information about how to create a 32K buffer pool.
Note:
The scripts for creating the Decision Warehouse database on DB2 are writtenfor databases that use automatic storage. When you use the Installation Settingswizard, you create both the Rule Execution Server and the Decision Warehousedatabase, so your database must use automatic storage.
If you have not configured your DB2 database to use automatic storage, youcannot use the Rule Execution Server Console to create the Rule ExecutionServer tables.
To create database tables, see “Populating a database by running SQL scripts”on page 98.
2. Optional: Select custom if you want to use a customized SQL script, and thenclick Browse to select the location of the custom script.
3. Click Next to review the database schema.
Step 3: Review the database schema:
After you have selected a database schema, you can choose options for the schema.
Configuring Decision Server Rules 97
Before you begin
Before using this option, ensure that you have a backup of your databaseresources.
About this task
After you have selected a database schema, you confirm the creation of a schemafor Rule Execution Server. You can also use SQL drop statements that flush datafrom an existing table, and view the SQL statements. Use the following procedureto confirm the creation of a schema.
Procedure
1. Select from the following options:
Create SQL schema “MyResAdmin”
Select this option to run the SQL statement for the schema type selectedin the previous step.
Keep drop SQL statements
Select this option to flush data from an existing Rule Execution Serverdatabase.
Show SQL statements
Click this option to display the SQL statements. Click Hide SQLstatements to close the list.
2. Click Execute to start the options that you have selected.
Step 4: The Installation Settings wizard report:
After you have selected and confirmed the schema, the Installation Settings wizardreports the status of the schema creation.
About this task
After you have confirmed the database schema, the Installation Settings wizardcreates the schema. A report shows the status of the schema creation.
Procedure
1. Click Show execution details to view the list of executed SQL statements.2. Click Finish to open the Explorer tab in the Rule Execution Server Console.
What to do next
If you have just worked in RuleApps persistence details and the persistencesetting for managed Java XOMs is datasource or jdbc, the Java XOMs persistencedetails part of the wizard opens for you to repeat this procedure.
Populating a database by running SQL scripts:
After you have created an empty database schema, you populate the RuleExecution Server database. One way to do this is to run SQL scripts.
98 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
The name of the script that creates the database schema isrepository_<DatabaseName>.sql. By default, the script is in <InstallDir>/executionserver/databases.
Note:
If you want to use Decision Warehouse, you can also create the required databasetable by running the script trace_<DatabaseName>.sql. If you have set Java XOMpersistence to a database, you must create these tables by running thexomrepository_<DatabaseName>.sql script.
If you use Command Editor to run the scripts, you must log in with the credentialsthat you use for the data source for Rule Execution Server.
Use any tool that can handle SQL to import and run the SQL scripts. The followingtable lists the tools that are provided for each database.
Table 5. Database scripting tools
Database Database tool
IBM DB2 DB2 command line processor
Derby ij command line processor
H2 H2 console
HSQL HSQL database manager
MySQL mysql command line processor
Oracle sqlplus command line processor
SQL Server Query Tool
Sybase isql command line processor
To access the database, the database user must secure the following credentials andprivileges.v
A user ID and a passwordv
Complete privileges on the tables, and a view of the schema (create, insert,delete)
v
Create index privilegesv
On Oracle, create trigger and create sequence privileges
Install a database client for the database that you use, and refer to thedocumentation of your database system for more information. The followingexample assumes that you have installed the Derby database.
Example: Running the Derby SQL scripts
A sample Derby data schema is used in describing the installation of RuleExecution Server. You must copy the derby.jar and derbytools.jar files to the
Configuring Decision Server Rules 99
<TOMCAT_HOME>/lib directory. (You can download the Derby database from TheApache DB Project.) You must add the <TOMCAT_HOME>/lib directory to theclasspath.
Note: The following steps are optional if you are going to use a JDBC data source.After you have defined the Derby data source, you can modify the createDatabasecustom property and set it to create. The database is created by the first databaseconnection.
To create a schema in Derby on Windows:1.
Stop Tomcat:v Open Apache Tomcat 7.0 Tomcat Properties on your Windows taskbar, or
click Tomcat7w.exe in {TOMCAT_HOME}/bin.v Click Stop in the General tab.
2.
Launch <DERBY_HOME>/bin/ij.bat.3.
Create and connect to the database. For example, to create and connect to thenew database resdb as the user resAdmin, use the command:ij> connect ’jdbc:derby:resdb;user=resAdmin;password=resAdmin;create=true’;
4.
Run the script that creates the database schema:ij> run '<InstallDir>/executionserver/databases/repository_derby.sql';
If the script is being run for the first time, some errors related to the dropstatements might occur.
Note:
If you have installed Decision Validation Services, you must also create therequired database schema by running the script trace_derby.sql. SeeAdditional steps to configure Decision Validation Services for moreinformation.
5.
Close the ij utility:ij> quit;
6.
Start Tomcat:v Open Apache Tomcat 7.0 Tomcat Properties on your Windows taskbar, or
click Tomcat7w.exe in {TOMCAT_HOME}/bin.v Click Start in the General tab.
Step 6: Deploying the hosted transparent decision serviceYou can optionally deploy the WAR file for hosted transparent decision services.
About this task
On Tomcat, you use the Execution Unit (XU) as a Java SE component (no notion ofnode). Use the following procedure to deploy the hosted transparent decisionservice WAR on Tomcat 7.0:
100 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Procedure1. Copy the file <InstallDir>/executionserver/applicationservers/tomcat7/
DecisionService.war to {TOMCAT_HOME}/webapps.2. Open the {TOMCAT_HOME}/conf/server.xml file.3. In the file, add the following code just before the </Host> tag closing the local
host definition:<Context path="/DecisionService" docBase="DecisionService.war" debug="0"reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"prefix="localhost_htds_log." suffix=".txt" timestamp="true"/>
<ResourceLink name="jdbc/resdatasource" global="jdbc/resdatasource"type="javax.sql.DataSource"/></Context>
4. Save the file.5. Optionally, you can configure the hosted transparent decision service
application in the WEB-INF/web.xml of the Rule Execution Server Console byusing the parameter name ilog.rules.res.SSP_CONTEXT. Change the<param-value>/testing</param-value> in the following <context-param>section:<context-param><description>Hosted Transparent Decision Services context-root.Can be modified.</description><param-name>ilog.rules.res.HTDS_CONTEXT</param-name><param-value>/DecisionService</param-value></context-param>
For example, you could change <param-value>/DecisionService</param-value>to <param-value>/myservice</param-value>.
6. You might have to restart Tomcat and the Rule Execution Server Console forthe hosted transparent decision service to function correctly.
7. By default, the ruleset.xmlDocumentDriverPool.maxSize ruleset property valueis set to 1. This value could cause a bottleneck if you have several clientsexecuting a hosted transparent decision service at the same time. Increasing thevalue of this property could significantly improve performance. The valueshould depend on the number of concurrent executions of the ruleset. Forexample, if you have five concurrent clients, five might be a good value.Set this value using the Ruleset Panel in the Rule Execution Server Console asfollows:a. Click the Explorer tab.b. Click RuleApps in the Navigator panel to display the RuleApps View.c. Click the name of the RuleApp that contains the ruleset in the RuleApps
View.d. In the RuleApp View, click the relevant ruleset.e. In the Ruleset View, click Add Property. A New Ruleset Property form
opens.f. Select the predefined property ruleset.xmlDocumentDriverPool.maxSize in
the dropdown list.g. Set the required value.h. Click Add.
Configuring Decision Server Rules 101
What to do next
For information on checking whether you have deployed the hosted transparentdecision service successfully, refer to the Rule Execution Server Console onlinehelp.
Step 7: Verifying the configurationYou can run diagnostics from the console to verify that you have successfullyconfigured the Rule Execution Server .
About this task
You can verify that you have successfully configured Rule Execution Server bysigning in to the console, clicking the Diagnostics tab, and running the diagnostics.
Procedure
To run the Rule Execution Server diagnostics:1. Open the Rule Execution Server Console by typing res with the root URL on
the host machine:http://localhost:8080/res
If your browser is not running on the same host as the application server,replace localhost with the address of the machine. If the web application ismapped to a host with a different port number, change the port number from8080 to the host port number.
2. Sign in to the Rule Execution Server Console.3. In the Rule Execution Server Console, click the Diagnostics tab.4. Click Run Diagnostics.
A report shows all the diagnostic tests that have been run.5. Click Expand All to show the details for all the tests.
Results
The tests show XU Lookup and XU MBean in a warning state ( ). Thiswarning is normal because there is no JNDI name to use with the Java SEExecution Unit (XU). The diagnostics do not execute the steps RuleSessionExecution and RuleSession Second Execution because they depend on XULookup.
Note:
The XU MBean becomes visible after the first execution. More precisely, when aconnection is requested, it creates the XU connector and the XU MBean. Theconnection can be a management connection, a ruleset execution connection, or anuntyped connection to initialize the pool to a minimal number of connections, or totest the availability of the resource adapter.
Optional configuration stepsWhen configuring Rule Execution Server for the Tomcat application server, you canalso repackage the management archive file with a different persistence setting orconfigure Rule Execution Server for different environments.
Repackaging the Rule Execution Server archive using Ant:
102 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
When you need to repackage a Rule Execution Server archive to configure the RuleExecution Server, you can use an Ant task if you have set up the Ant taskenvironment.
Before you begin
Before you run the res-setup Ant task, you must set up the Ant task environment.For more information, see Setting up your environment to use Ant.
About this task
By default, the persistence is set to datasource. You can use an Ant task to changethe persistence type. An Ant script comes with the distribution for this purpose.The script creates new archives that use a specific persistence mode.
The following procedure repackages the archive to change the persistence mode tofile.
Procedure
Write the code that creates a management .war file that sets the new persistencemode:ant -Dconsole.war.in=<WODM_INSTALL>/executionserver/applicationservers/tomcat7/res.war-Dconsole.war.out=mymanagement.war-Dpersistence.type=file -f ressetup.xml setup
Configuring Rule Execution Server in different environments:
Configuration settings required to enable Rule Execution Server on differentenvironments in a single cell.
About this task
It is very likely that the development of your BRMS requires more than a singledeployment of Rule Execution Server. The development life cycle of a business ruleapplication is similar to any other software development process including stagesfor implementation, testing, deployment and maintenance. At the very least, youare likely to need an environment for your development team, one for your QAteam, and another one for in-production applications. When you configure RuleExecution Server in a single cell, it is good practice to isolate the rulesets that youuse on each server and ensure that the Execution Units (XUs) do not interfere witheach other.
To set up different environments, go through the following steps:1. Set up different data sources.2. Deploy and configure a XU for each environment.3. Deploy the Rule Execution Server console for each environment.
Note: These instructions assume that you do not configure multiple instances ofRule Execution Server in a single cell. Use the following instructions to set up yourdifferent environments in a single cell.
Configuring Decision Server Rules 103
Procedure
To configure Rule Execution Server in different environments:1. Set up different data sources.
Use a unique JNDI name. For example:jdbc/resdatasourceEnv1
jdbc/resdatasourceEnv2
2. Modify the deployment descriptor of the Rule Execution Server console EAR orWAR management archive:In the web.xml file, uncomment the JMX_XU_QUERY_PART parameter and specifyxuName=xuEnv1.
3. Deploy the Rule Execution Server console EAR or WAR file to the server.4. In the resource reference settings in the application server.
a. Set the JNDI for the data source as: jdbc/resdatasourceEnv1.b. Set the JNDI name for the XU as: eis/ConnectionFactoryEnv1.c. Repeat the process to deploy the Rule Execution Server console for the other
environments.5. Restart the node agents after you have completed the configuration.6. Call the XU instances to register the XU with the Rule Execution Server
console.
TroubleshootingIf you experience poor performance, you can check for database driver issues, orallocate more memory to applications.
Rule Execution Server database driver issues:
Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Oracle XA features:
If you have to use XA features with an Oracle 9i database, you must configureyour database and the server JVM.
Procedure
To configure your database and the server JVM:
Run the two scripts initjvm.sql and initxa.sql that are located in the directory:<ORACLE_HOME>/javavm/installFor more information, contact your DBA or your local Oracle support.
JDBC not bound:
A JDBC not bound error most likely indicates a missing directory, schema, orprivilege.
A JDBC not bound error message is raised when an error occurs during the creationof the data source.
Refer to the traces to locate the original cause. In the vast majority of cases, thecauses can be:
104 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
v A directory does not exist or cannot be read or written.v There is a missing schema or table.v There are missing privileges to access the database resource.
Providing more memory for applications:
In case of core dumps or Java out-of-memory errors when running a WebSphereOperational Decision Management module, you can increase the memory availableto the Tomcat application server.
About this task
You can make more memory available to the Tomcat application server byincreasing the maximum heap size for the Java Virtual Machine (JVM) in thecatalina script.
Procedure
To increase the memory settings for Tomcat:1. Stop your application server.2. Increase the maximum heap size option for the Java Virtual Machine (JVM) in
the catalina script.For example, you can override the default heap size by using the -Xms and -Xmxswitches to specify the initial and maximum sizes respectively:%JAVA_HOME%\bin \java -Xms128m -Xmx512m -XX:MaxPermSize=128m
This example also sets the permanent generation heap to a maximum value of128 MB.To determine the appropriate heap size for the environment, submit yourapplications to stress tests.
3. Save the file and restart the application server.
Configuring Rule Execution Server on JBoss 5 and 6.1To use Rule Execution Server on a new instance of JBoss, you must deploy theprovided archives for this server and perform a number of configuration tasks.
Before you startTo configure Rule Execution Server on JBoss you must follow specific steps. Somesteps are mandatory, while others apply in certain cases only.
Before you start, make sure to clean up your environment.
To clean up your environment:
1. Delete the /work and /tmp directories from the folder in which you deploy RuleExecution Server: <JBOSS_HOME>/server/default. This ensures that JSP pagesare recompiled during the installation.
2. If not already done, set JBOSS_HOME as an environment variable.
Once you have cleaned up your environment, see “What steps to follow” on page106 to understand the tasks you must complete to configure Rule Execution Serverfor your application server.
The Rule Execution Server console contains an Installation Settings wizard. If youlog on as the administrator, you can use it to create resources in an empty database
Configuring Decision Server Rules 105
schema and run SQL drop statements to clear an existing database. See“Populating a database by using the Rule Execution Server console” on page 112for more information.
Alternatively, you can use Ant tasks to install Rule Execution Server on JBoss. Formore information, see “Populating a database by running SQL scripts” on page 117
What steps to follow
The following table summarizes the installation steps that you follow to installRule Execution Server on JBoss depending on the persistence type that you choose.
Installation stepsPersistence
File Data source JDBC
“Step 1: Selecting and applying thepersistence type” on page 107
Defaultpersistencemode
“Step 2: Enforcing database userpermissions” on page 107
Not applicable
“Step 3: Creating an emptydatabase schema” on page 108
Not applicable
“Step 4: Creating a data source andconnection pool” on page 108
Not applicable Not applicable
“Step 5: Configuring security” onpage 110
“Step 6: Deploying the RuleExecution Server managementEAR” on page 111
“Step 7:Populating aRule ExecutionServer database”on page 112
“Populating adatabase byusing the RuleExecution Serverconsole” on page112
Not applicable
“Populating adatabase byrunning SQLscripts” on page117
Not applicable
“Step 8: Deploying the ExecutionUnit (XU) RAR file” on page 118
“Step 9: Deploying the hostedtransparent decision service” onpage 119
Optional Optional Optional
“Step 10: Verifying theconfiguration” on page 120
Recommended Recommended Recommended
106 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Step 1: Selecting and applying the persistence typeYou can change the default datasource RuleApp and Java XOM persistencesettings by running an Ant script that generates a new Rule Execution Servermanagement archive.
By default, persistence is set to datasource for both RuleApps and managed JavaXOMs in the deployment descriptor of the Rule Execution Server managementarchive.
To change the persistence settings, the distribution provides an Ant script in the<WODM_InstallDir>/executionserver/bin/ressetup.xml file. Use it to create a newinstance of the Rule Execution Server management archive and, in the case of aJava EE application server, the Execution Unit (XU).
Note:
v If you use file-based persistence on Solaris, your file system must support allcharacters used in directory and file names that are present in the ruleset path(RuleApp name and ruleset name). Set the LANG system property with theencoding that is compatible with your package and rule names, for exampleen_US.UTF-8.
v If you select the file persistence type for RuleApps, you cannot use DecisionWarehouse.
v MySQL persistence: If you choose to use MySQL as a persistence back end, addor set the following properties in the MySQL configuration file my.ini (onWindows) or my.cnf (on UNIX operating systems):sql-mode=STRICT_ALL_TABLESmax_allowed_packet=1073741824
For more information about these settings, see the MySQL 5.0 reference manual:5.1.6. Server SQL Modes and 5.1.3 Server System Variables.
Step 2: Enforcing database user permissionsIf Rule Execution Server data is stored in a database, you can restrict the type ofoperations that a user can perform on a database by defining access privileges.
The data source that contains the Rule Execution Server data is always mapped toa database user.
Note:
The database privilege types differ across the supported databases. Defining andassigning privileges is performed by a database administrator.
Any privilege listed in the table as Not required denotes that it is not required bythe Rule Execution Server data source.
The following table highlights the database permissions that you must enforce fordatabase users, with attention given to the type of operation that you want them toperform:
Database permission
Operation
Browse and editrulesets/ruleApps(resAdmin)
Create the Rule ExecutionServer schema
CREATE ANY INDEX Not required Required
Configuring Decision Server Rules 107
Database permission
Operation
Browse and editrulesets/ruleApps(resAdmin)
Create the Rule ExecutionServer schema
DROP ANY INDEX Not required Required
CREATE ANY SEQUENCE Not required Required
DROP ANY SEQUENCE Not required Required
SELECT ANY SEQUENCE Required Not required
CREATE ANY TABLE Not required Required
DROP ANY TABLE Not required Required
INSERT ANY TABLE Required Not required
SELECT ANY TABLE Required Not required
UPDATE ANY TABLE Required Not required
DELETE ANY TABLE Required Not required
CREATE ANY TRIGGER Not required Required
CREATE ANY VIEW Not required Required
DROP ANY VIEW Not required Required
Step 3: Creating an empty database schemaCreate an empty database schema with an XA data source.v If you set persistence to file, you can skip all the database-related tasks and
proceed directly to “Step 6: Deploying the Rule Execution Server managementEAR” on page 111.
v If you use the default persistence (datasource) or you set persistence to JDBC,you must create a dedicated database schema before populating the database.For example, if you use an XA data source, you can create an empty databaseschema with an XA data source. Add the following property to your deploymentdescriptor file (*-ds.xml):<xa-datasource-property name="CreateDatabase">create</xa-datasource-property>
After the database is created, you can then use the Installation Settings wizard inthe Rule Execution Server console or you can run the provided SQL scripts topopulate the database with tables and views.
Step 4: Creating a data source and connection poolIf you use data source persistence, you must create a data source and a connectionpool.
About this task
This step is not required if you use file persistence or JDBC. You create a descriptorfile and add the necessary properties for your data source.
Procedure
To create a data source and a connection pool:1. In the <JBOSS_HOME>/server/default/deploy directory, create a data source
descriptor file that ends with -ds.xml.
108 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Note:
You can find data source examples in the directory <JBOSS_HOME>/docs/examples/jca.Below is an example of an XA data source for use with the Derby database.This example is based on the file derby-xa-ds.xml provided in the directory<JBOSS_HOME>/docs/examples/jca.
res-derby-xa-ds.xml<?xml version="1.0" encoding="UTF-8"?><datasources>
<xa-datasource><jndi-name>jdbc/resdatasource</jndi-name><xa-datasource-class>
org.apache.derby.jdbc.EmbeddedXADataSource</xa-datasource-class><xa-datasource-property name="User">RES</xa-datasource-property><xa-datasource-property name="Password">RES
</xa-datasource-property><xa-datasource-property name="DatabaseName">${jboss.server.data.dir}/derby/resdb</xa-datasource-property><xa-datasource-property name="CreateDatabase">create
</xa-datasource-property><min-pool-size>5</min-pool-size><max-pool-size>20</max-pool-size><idle-timeout-minutes>5</idle-timeout-minutes><check-valid-connection-sql>
select count(*) from RULEAPPS</check-valid-connection-sql><metadata>
<type-mapping>Derby</type-mapping></metadata><depends>jboss:service=Derby</depends>
</xa-datasource><mbean code="org.jboss.jdbc.DerbyDatabase"
name="jboss:service=Derby"></mbean>
</datasources>
2. Set the values of the properties in this file.The properties to set depend on the type of data source you create and thedatabase you want to connect to. In the above example, these properties appearbetween the tags <xa-datasource> ... </xa-datasource>, which identify theXA data source. They are described below.a. Common properties
JNDI name
This property is independent from the type of data source anddatabase and must be set to this value:
<jndi-name>jdbc/resdatasource</jndi-name>
Data source class
This property is specific to an XA data source. It defines the classthat handles the connections to the database. For example:
<xa-datasource-class>org.apache.derby.jdbc.EmbeddedXADataSource</xa-datasource-class>
Connection properties
Configuring Decision Server Rules 109
These properties are specific to an XA data source and are requiredfor the data source to get a connection to the database. Theseproperties depend on the database you want to connect to. Forexample:
<xa-datasource-property name="DatabaseName">myDB</xa-datasource-property>
<xa-datasource-property name="User">RES</xa-datasource-property>
<xa-datasource-property name="Password">RES</xa-datasource-property>
Note:
Be careful with the names of the properties because they are used toidentify the method to be called to get or set the given value. For example,if the name is “User” then the method that is called is setUser or getUser.
b. Custom properties. To be operational, data sources might require additionalproperties or services. For example, in the case of embedded databases(such as Derby), you must start the database first. Databases are startedusing a service. In the XML descriptor, this dependency is translated usingthe tags <depends> ... </depends>.
Results
If your JBoss instance is running, it automatically detects and deploys the newdescriptor.
Note:
v If you want to use the embedded Derby database, copy the file derby.jar fromthe directory <Derby_InstallDir>/lib to the directory <JBOSS_HOME>/server/default/lib. Also, copy the file derby-plugin.jar from the directory<JBOSS_HOME>docs/examples/varia to the directory<JBOSS_HOME>/server/default/lib.
v The DatabaseName property is the directory in which the database is created andits name. In the sample, the real database name is “default”.
v The MBean org.jboss.jdbc.DerbyDatabase is provided in a plug-in package inderby-plugin.jar.
Related information:“Step 1: Selecting and applying the persistence type” on page 7You can change the default datasource RuleApp and Java XOM persistencesettings by running an Ant script that generates a new Rule Execution Servermanagement archive.
Step 5: Configuring securityYou control access to Rule Execution Server and enforce security by defining usergroups and associated roles.
The main groups and their associated default user and password are summarizedin the following table.
110 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Group Use Default user/password
resAdministrators Gives a user fulladministrator rights to:
v Access and use the RuleExecution Server consoleto populate the databaseschema
v Deploy, browse, andmodify RuleApps
v Monitor the decisionhistory, purge and back upthe history
v Run diagnostics and viewserver information
resAdmin/resAdmin
resDeployers Gives a user the rights to:
v Deploy, browse, andmodify RuleApps
v Test Rulesets
resDeployer/resDeployer
resMonitors Gives a user the rights to:
v View RuleApps
v Monitor decision historyand access Decision Centerreports
resMonitor/resMonitor
You declare groups and users in the files roles.properties and users.properties.You must then copy these files to the directory <JBOSS_HOME>/server/default/conf.
Below are examples of these property files:
roles.propertiesresAdmin=resAdministrators,resDeployers,resMonitorsresDeployer=resDeployers,resMonitorsresMonitor=resMonitors
rtsUser1=rtsUserrtsConfig=rtsConfigManager,rtsUserrtsAdmin=rtsAdministrator,rtsInstaller,rtsUser
Eli=Eligibility,rtsUserVal=Validator,Eligibility,rtsUser
users.propertiesresAdmin=resAdminresDeployer=resDeployerresMonitor=resMonitor
rtsUser1=rtsUser1rtsConfig=rtsConfigrtsAdmin=rtsAdmin
Eli=EliVal=Val
Step 6: Deploying the Rule Execution Server management EARTo deploy the Rule Execution Server management EAR archive, you must copy itto the deployment directory of your application server.
Configuring Decision Server Rules 111
Procedure1. Depending on the version of JBoss you are using (5 or 6.1), locate one of the
following EAR files:v <WODM_InstallDir>/executionserver/applicationservers/JBoss5/jrules-
res-management-JBOSS5.ear
v <WODM_InstallDir>/executionserver/applicationservers/JBoss6/jrules-res-management-JBOSS6.ear
2. Copy the file to the following directory:<JBOSS_HOME>/server/default/deploy
Step 7: Populating a Rule Execution Server databaseYou can populate the Rule Execution Server database from the Rule ExecutionServer console or from the Command Editor.
Populating a database by using the Rule Execution Server console:
To populate a Rule Execution Server database, you can use the Installation Settingswizard if you work on Windows and other supported distributed platforms.
Installation Settings wizard overview:
On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.
If you are configuring your Rule Execution Server with database persistence andwant to populate your database, you can use the wizard for the followingpurposes:v Select the database schema type that you want to create.v Create the required resources, in an empty database schema, to use Rule
Execution Server.
Important:
Mind the following points:– Only the users who configure Rule Execution Server from a distributed
platform and Windows can work from the Installation Settings wizard.– You must create the empty database schema on your application server before
you use the Installation Settings wizard. See “Step 3: Creating an emptydatabase schema” on page 108 for more information.
– To open the Installation Settings wizard, you must log in to the RuleExecution Server Console with administrator rights. The default user withthese rights is resAdmin. For more information about setting passwords andthe permission required to access the Installation Settings wizard, see “Step 5:Configuring security” on page 110.
– To configure the database to store managed Java XOMs, you follow theprocedure twice, with a different target database each time.
The Installation Settings wizard creates all the required tables for Rule ExecutionServer and for Decision Validation Services, even if you do not have a license forDecision Validation Services.
Note:
112 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
If you use file persistence or have an existing data schema, the Installation Settingswizard does not open when you log in to the Rule Execution Server Console. Inthis case, follow the procedure described in “Populating a database by runningSQL scripts” on page 117 to create the database tables.
The combination of persistence settings for RuleApps and managed Java XOMsaffects the way in which you use the Installation Settings wizard.v If the RuleApp persistence and the Java XOM persistence are both set to file:
No wizard is presented.v If the RuleApp persistence and the Java XOM persistence are both set to
datasource or JDBC: When you sign in to the Rule Execution Server Console,the RuleApp persistence details part of the Installation Settings wizard appearsfor you to create the schema for RuleApps and the Decision Warehouse trace.After you have completed this step, the Java XOMs persistence details part ofthe wizard is displayed for you to configure the database for Java XOMpersistence.
v If the RuleApp persistence is set to file and the Java XOM is set to datasourceor JDBC: You see only Java XOMs persistence details and you cannot use theDecision Warehouse.
v If the RuleApp persistence is set to datasource or JDBC and the Java XOM is setto file or is not defined: When you sign in to the Rule Execution ServerConsole, only RuleApp persistence details appears for you to create the schemafor RuleApps. The Java XOMs persistence details part of the wizard is notshown.
The following table summarizes the cases.
Persistence
RuleApps
file datasource/JDBC
Java XOMs file No InstallationSettings wizard
RuleAppspersistence detailsonly
datasource Java XOMspersistence detailsonly
No DecisionWarehouse
Complete InstallationSettings wizard
Opening the Rule Execution Server console:
To open the Rule Execution Server console and the Installation Settings wizard,you must sign in with the administrator’s rights.
Before you begin
If the JBoss server is not running, you must first start it:1. In <JBOSS_HOME>/bin, double-click run.bat.
Wait until the server is started.2. Open the JBoss Admin Console in a web browser by typing admin-console at
the root URL on the host machine:http://localhost:8080/admin-console
3. Sign in to the JBoss Admin Console as the administrator:
Configuring Decision Server Rules 113
Username: adminPasswork: admin
Important:
Read “Installation Settings wizard overview” on page 112.
About this task
To access the Installation Settings wizard, you must first open and sign in to theRule Execution Server Console.
Procedure
1. Open the Rule Execution Server Console in a web browser by typing res at theroot URL on the host machine:http://localhost:8080/res
v If your browser is not running on the same host as the application server,replace localhost with the address of the machine.
v If the web application is mapped to a host which is defined on a port that isdifferent from the default of the server, change the port number to the hostport number.
2. Sign in to the Rule Execution Server Console as the administrator.
User ID
resAdmin
Password
resAdmin
Results
If you use database persistence and the database schema is empty, the InstallationSettings wizard opens and you can use it to complete the installation.Related information:“Installation Settings wizard overview” on page 112On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.
Step 1: Welcome to the Installation Settings wizard:
If you open the Rule Execution Server Console with datasource as the persistencesetting and an empty database schema, the Installation Settings wizard opens.
The wizard can display two parts:v It starts with RuleApp persistence details if you set datasource persistence for
RuleApps, whatever the persistence type for managed Java XOMs.v Java XOMs persistence details is shown after RuleApp persistence details if
you have set datasource persistence for both RuleApps and Java XOMs. In thiscase, you go through the same steps twice.The wizard starts with Java XOMs persistence details if you have set thepersistence type to file for RuleApps and to datasource for managed JavaXOMs.
114 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Both parts of the wizard are similar and you use them in the same way:1.
The Welcome page provides the following information:v Persistence details about the type of database used. This includes information
about the driver and JDBC URL.v A brief description of the purpose of the Installation Settings wizard.v A diagnostic report that provides information about why the persistence
check failed (because you have not yet created the database tables).Click Next to proceed.
2. “Step 2: Choose the database schema.”3. “Step 3: Review the database schema” on page 1164. “Step 4: The Installation Settings wizard report” on page 116
Step 2: Choose the database schema:
After you have read the Welcome page, you choose the database schema. Specificsettings are available for DB2. Optionally, you can select a customized SQL script.
Before you begin
You must have created the empty database schema before you use the InstallationSettings wizard.
About this task
Select an available Rule Execution Server database schema or upload a customschema.
Procedure
1. In the Database schema selected field, select an available database schematype.A type that corresponds to the type of database you are using is selected bydefault, but you can choose another type from the drop-down list.If you select a db2 or db2_os390 schema, an extra field displays so that you canenter the name of the buffer pool, which is used to create the DecisionWarehouse tablespace. This buffer pool must have a page size of 32K. Checkthe DB2 documentation for information about how to create a 32K buffer pool.
Note:
The scripts for creating the Decision Warehouse database on DB2 are writtenfor databases that use automatic storage. When you use the Installation Settingswizard, you create both the Rule Execution Server and the Decision Warehousedatabase, so your database must use automatic storage.
If you have not configured your DB2 database to use automatic storage, youcannot use the Rule Execution Server Console to create the Rule ExecutionServer tables.
To create database tables, see “Populating a database by running SQL scripts”on page 117.
Configuring Decision Server Rules 115
Decision Warehouse table spaces are always created, even if you have notinstalled Decision Validation Services.
2. Optional: Select custom if you want to use a customized SQL script, then clickBrowse to select the location of the custom script.
3. Click Next to review the database schema.Related information:“Step 3: Creating an empty database schema” on page 108Create an empty database schema with an XA data source.
Step 3: Review the database schema:
After you have selected a database schema, you have access to a choice of optionsfor the schema.
Before you begin
Before using this option, ensure that you have a backup of database resources.
About this task
After you have selected a database schema, you confirm the creation of a schemafor Rule Execution Server. You can also use SQL drop statements that flush datafrom an existing table and view the SQL statements.
Procedure
1. Select from the following options:
Create SQL schema “RES”
Select this option to run the SQL statement for the schema type selectedin the previous step.
Keep drop SQL statements
Select this option to flush data from an existing Rule Execution Serverdatabase.
Show SQL statements
Select this option to display the SQL statements.2. Click Execute to start the options that you have selected.
Step 4: The Installation Settings wizard report:
Finally, after you have selected and confirmed the schema, the Installation Settingswizard reports the status.
About this task
After you have confirmed the database schema, the Installation Settings wizardcreates the schema. A report shows the status of the schema creation.
Procedure
1. Click Show execution details to view the list of SQL statements executed.2. Click Finish.
116 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
If you have just worked in RuleApps persistence details and the persistencesetting for managed Java XOMs is datasource, the Java XOMs persistencedetails part of the wizard displays now for you to repeat the procedure.
Populating a database by running SQL scripts:
If you have an existing database schema, use the SQL scripts to create the databasetables.
The SQL scripts can be found in this directory: <WODM_InstallDir>/executionserver/databases. This directory also contains a readme file where youcan find additional information about the scripts.
The script that creates the database schema is namedrepository_<DatabaseName>.sql.
Note:
If you want to use Decision Warehouse, you can also create the required databasetable by running the script trace_<DatabaseName>.sql. If you are also persistingthe Java XOM in a database, you must create these tables by running thexomrepository_<DatabaseName>.sql script.
If you use Command Editor to run the scripts, you must log in with the credentialsyou use for the data source for Rule Execution Server.
Use any tool that can handle SQL to import and run the SQL scripts. The toolsprovided for each database include:
Database Database tool
IBM DB2 DB2 command line processor
Derby ij command line processor
H2 H2 console
HSQL HSQL database manager
MySQL mysql command line processor
Oracle sqlplus command line processor
SQL Server Query Tool
Sybase isql command line processor
To access the database, the database user must have a user ID and a password. Thedatabase user must also have:v complete privileges on the tables and view of the schema (create, insert, delete)v create index privileges
On Oracle, the database user must also have create trigger and create sequenceprivileges.
When using an Oracle database, run all the scripts in the SQL Plus client.
When using DB2, the scripts that create the Rule Execution Server database tablesare written for databases that use automatic storage. The following conditionsapply:
Configuring Decision Server Rules 117
v BP32K is the buffer pool that is expected in SYSCAT.BUFFERPOOLS. If BP32K is notthere, you can use the existing buffer pool or create a new buffer pool namedBP32K. Use the following command to query SYSCAT.BUFFERPOOLS for the existingbuffer pool:Select * from SYSCAT.BUFFERPOOLS
Otherwise, use the following command to create a buffer pool named BP32K:CREATE BUFFERPOOL BP32K SIZE 2000 PAGESIZE 32K
v You must update the trace_db2.sql script and select the custom option in theInstallation Settings wizard to run it. Modify the following line in the script tospecify storage for the tablespace:CREATE TABLESPACE RESDWTS PAGESIZE 32K BUFFERPOOL BP32K;
The following line gives an example of the tablespace specification in the script:CREATE TABLESPACE RESDWTS PAGESIZE 32K MANAGED BY DatabaseUSING [ FILE ’C:\DB2\Container.file’ 640 ] BUFFERPOOL BP32K;
v You might have to further modify the script based on your database settings.
Step 8: Deploying the Execution Unit (XU) RAR fileDeploy the Execution Unit (XU) to your application server.
About this task
The Execution Unit (XU) is a resource adapter for Java EE application servers. It issupplied as a RAR archive that you must deploy on your application server.Deploy the XU by copying the XU RAR and XML files to the deployment directoryof your application server.
In addition to the procedure described here, you also have the option to deploy theXU inside the application (embed the XU into the EAR). There might be someinstances where, due to your application constraints, you have to deploy the XUinside the application. It is your decision to choose the appropriate deploymentmode of the XU (either embed into the EAR or deploy as a global connector). Referto the application server documentation for instructions on packaging a connectorinto an EAR.
Note:
v When the XU is deployed as a global connector, its third-party libraries (such asASM) might be used by the deployed J2EE applications instead of the librariesdeployed in the application server.
v When the XU is deployed as a global connector, use a parent last setting for itsJ2EE application if your J2EE application does not support the version of thethird-party libraries distributed with Decision Server. If this is not possible, youmight have to embed the XU into the EAR that is executing the rules.
v When using an embedded XU packaging, use a parent last setting for the codelibrary if the third-party libraries version deployed at the application server codelibrary level is not compatible with the XU.
When deployed to JBoss 6.1, the XU uses the JDK logging API. The loggingconfiguration is handled by the JBoss configuration file jboss-logging.xml. Thisfile is located in your JBoss server deployment directory:<JBOSS_HOME>/server/default/deploy. For more information on this file, refer to the JBossdocumentation.
118 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
The XU uses the logger name com.ibm.rules.res.execution. To write onlywarnings and errors to the JBoss log, add the following line in thejboss-logging.xml file:<logger category="com.ibm.rules.res.execution">
<level name="WARNING"/></logger>
Procedure
To deploy the XU RAR:1. In your JBoss deploy directory, <JBOSS_HOME>/server/default/deploy, locate the
file jca-jboss-beans.xml.2. Open the file in an editor and search for the text Whether to track unclosed
connections and close them. Set the debug attribute as follows:<property name="debug">false</property>
Save the file.3. Depending on the version of JBoss you are running, perform one of the
following taks:
Option Description
In JBoss 5 Copy the files jrules-res-xu-JBOSS5.rarand jrules-res-xu-JBOSS5-ds.xml from<WODM_InstallDir>/executionserver/applicationservers/JBoss5 into the<JBOSS_HOME>/server/default/deploydirectory.
In JBoss 6.1 Copy the files jrules-res-xu-JBOSS6.rarand jrules-res-xu-JBOSS6-ds.xml from<WODM_InstallDir>/executionserver/applicationservers/JBoss6 into the<JBOSS_HOME>/server/default/deploydirectory.
Step 9: Deploying the hosted transparent decision serviceYou can deploy the hosted transparent decision service on your application server.This step is optional.
About this task
The hosted transparent decision service must be deployed on the same node as theExecution Unit (XU).
Procedure1. Depending on the version of JBoss you are running, copy one of the following
files to the deploy directory of your JBoss server:
Option Description
In JBoss 5 <WODM_InstallDir>/executionserver/applicationservers/JBoss5/jrules-res-htds-JBOSS5.ear
In JBoss 6.1 <WODM_InstallDir>/executionserver/applicationservers/JBoss6/jrules-res-htds-JBOSS6.ear
Configuring Decision Server Rules 119
2. By default the ruleset.xmlDocumentDriverPool.maxSize ruleset property valueis set to 1. This value could cause a bottleneck if you have several clientsexecuting a hosted transparent decision service concurrently. To optimizeperformance, the value should depend on the number of concurrent executionsof the ruleset. For example, if you have 5 concurrent clients, 5 may be a goodvalue. Set this value using the Ruleset Panel in the Rule Execution ServerConsole as follows:a. Click the Explorer tab.b. Click RuleApps in the Navigator panel to display the RuleApps View.c. Click the name of the RuleApp that contains the ruleset in the RuleApps
View.d. In the RuleApp View, click the relevant ruleset.e. In the Ruleset View, click Add Property.
A New Ruleset Property form opens.
What to do next
For more information about checking that the hosted transparent decision servicehas been deployed successfully, refer to the Rule Execution Server Console onlinehelp.
Step 10: Verifying the configurationAlthough this step is optional, it is good practice to verify that Rule ExecutionServer has been successfully configured.
About this task
You can verify that Rule Execution Server has been successfully configured byrunning Rule Execution Server diagnostics.
Note:
v To let a scalable number of users access resources through the Java components,JCA assigns the task of implementing connection pooling to application servervendors.
v If the diagnostics are performed before any XUs have been started, the test ispassed and a message displays to verify that no XU(s) have been initialized.
Procedure1. Open the Rule Execution Server Console by typing res at the root URL on the
host machine:http://localhost:8080/res
If your browser is not running on the same host as the application server,replace localhost with the address of the machine. If the web application ismapped to a host that is defined on a different port to 8080, change the portnumber from 8080 to the host port number.
2. Sign in to the Rule Execution Server Console.3. In the Rule Execution Server Console, click the Diagnostics tab.4. Click Run Diagnostics.
You see a report showing all the diagnostic tests that have just been run. Acheck mark is shown next to each check. Click Expand All to show detailsabout all checks.
120 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Optional configuration stepsYou can enhance your configuration with additional options, such as multiserverconfiguration, or deploying onto a server cluster.
Repackaging the Rule Execution Server archive using Ant:
When you need to repackage a Rule Execution Server archive to configure the RuleExecution Server, you can use an Ant task, provided that you have set up the Anttask environment.
Before you begin
Before you run the res-setup Ant task, you must set up the Ant task environmentcorrectly. For more information, see Setting up your environment to use Ant.
About this task
By default, persistence is set to datasource. To change the persistence type, youcan use an Ant task. An Ant script is provided with the distribution for thispurpose. The script creates new archives that use a specific persistence mode.
The following procedure repackages the archives to change the persistence mode tofile.
Procedure
To repackage an archive file using Ant:
Write the code that creates a new XU (Execution Unit) RAR file and a newmanagement EAR file that set file persistence:In JBoss 5:ant -Dxu.in=../applicationservers/JBoss5/jrules-res-xu-JBOSS5.rar-Dxu.out=myxu.rar-Dconsole.ear.in=../applicationservers/JBoss5/jrules-res-management-JBOSS5.ear-Dconsole.ear.out=mymanagement.ear-Dpersistence.type=file -f ressetup.xml setup
In JBoss 6.1:ant -Dxu.in=../applicationservers/JBoss6/jrules-res-xu-JBOSS6.rar-Dxu.out=myxu.rar-Dconsole.ear.in=../applicationservers/JBoss6/jrules-res-management-JBOSS6.ear-Dconsole.ear.out=mymanagement.ear-Dpersistence.type=file -f ressetup.xml setup
Configuring Rule Execution Server in different environments:
It is very likely that the development of your BRMS requires more than a singledeployment of Rule Execution Server.
The development life cycle of a business rule application is similar to any othersoftware development process including stages for implementation, testing,deployment and maintenance. At the very least, you are likely to need anenvironment for your development team, one for your QA team, and another onefor in-production applications. In cases where you configure Rule Execution Serverin a single cell, it is good practice to isolate the rulesets that you use on eachserver, and ensure that the Execution Units (XUs) do not interfere with each other.
Configuring Decision Server Rules 121
These instructions assume that you do not configure multiple instances of RuleExecution Server in a single cell. Use the following instructions to set up yourdifferent environments in a single cell.
To set up a data source for each environment:
1. Use a unique JNDI name. For example:jdbc/resdatasourceEnv1
jdbc/resdatasourceEnv2
To configure an XU for each environment and define a J2C connection factory:
1. Depending on the version of JBoss you are running, edit the filejrules-res-xu-JBOSS5-ds.xml (JBoss 5) or jrules-res-xu-JBOSS6-ds.xml (JBoss6.1). Either use the already deployed file (in the <JBOSS_HOME>/server/default/deploy directory), or edit the file in the <WODM_InstallDir>executionserver/applicationservers/JBoss5 or <WODM_InstallDir>executionserver/applicationservers/JBoss6 directory.
2. Change the JNDI name to eis/XUConnectionFactoryEnv1. Note that executioncomponents that invoke this XU must be modified and use this JNDI instead ofthe default.
3. Save the file.4. Repeat the same process for XUs in other environments.
To deploy the Rule Execution Server console for each environment:
1. Modify the deployment descriptor of the Rule Execution Server console EAR.In the web.xml, uncomment the JMX_XU_QUERY_PART parameter and specifyxuName=xuEnv1.
2. Deploy the Rule Execution Server console EAR on the server.3. In the resource reference settings in the application server:
a. Set the JNDI name for the data source as: jdbc/resdatasourceEnv1.b. Set the JNDI name for the XU as: eis/ConnectionFactoryEnv1.
4. Repeat the process to deploy the Rule Execution Server console for the otherenvironments.
Restart the node agents after you complete the configuration.
Invoke the XU instances to register the XU with the Rule Execution Server console.
Rule Execution Server deployment for high availability and scalability:
Use Rule Execution Server in a cluster or other multi-server environments.
Cluster configuration and topology:
When you deploy Rule Execution Server onto server clusters, each node hosts oneExecution Unit (XU) which is used only by a local rule session. The clustertopology significantly affects the notification mechanism.
Within the Java EE framework, clusters provide mission-critical services to ensureminimal downtime and maximum scalability. A cluster is a group of applicationservers that transparently run your Java EE application as if it were a single entity.
122 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Cluster implementations on Java EE application servers come with their own set ofterminology. Each of the following terms are important to understand how yourcluster performs:v Cluster and component failover servicesv HTTP session failoverv Single points of failure in a cluster topology
On a cluster configuration, deploy an Execution Unit (XU) on each node. There isone XU for each node of a cluster. Use the administration console of applicationservers to handle cluster deployment. A XU instance can be used only by a local(same node) rule session. The rule session and the XU communicate using directJava method calls, so the XU does not require serialization.
A cluster that uses Rule Execution Server involves a collaboration between theRule Execution Server MBeans. The topology of the cluster has significantinfluence on the management of the notification mechanism when a resource ischanged.
The management model is likely to use several times a basic scenario of adistributed notification mechanism within a cluster to interact with the variousExecution Unit (XU) instances. A XU MBean is deployed with the XU tocollaborate with the Rule Execution Server JMX infrastructure.
The following sequence applies:1. A management client sets a resource on a ruleset MBean.2. The ruleset makes a query to the MBean Server to retrieve all the XU instances
in the cluster (this operation requires a specific implementation for eachapplication server).
3. A notification is sent to each instance.
JBoss clusters:
Configuring Decision Server Rules 123
When you deploy the different Rule Execution Server components on a JBossapplication server, it is important to activate a single instance of the managementconsole in a JBoss cluster.
There is no synchronization between deployed management consoles. Themanagement console must be in the cluster to find the Execution Unit (XU)MBeans of the cluster.
Contrary to WebSphere, the XU MBean on JBoss is activated when the RAR isdeployed. Consequently, the management console automatically discovers all theXUs deployed in the cluster before any ruleset has been executed.
The notification mechanism works by transmitting messages to all the XUinstances on cluster members. The management model finds the list of members ina cluster with the local MBean server, then uses the JMX remote connection oneach cluster member to notify all XU instances.
To implement failover for the management console, deploy the EAR for JBoss ineach <JBOSS_HOME>/server/all/deploy-hasingleton in the cluster. This allows youto have the management console run on a single server in the cluster. You mustalso specify the dependency of the high-availability singleton on the RuleExecution Server data source, by editing the file <JBOSS_HOME>/server/all/deploy/deploy-hasingleton-service.xml, and adding the following line:<depends>jboss.jdbc:datasource=jdbc/resdatasource,service=metadata</depends>
to the HASingletonController mbean descriptor:<mbean code="org.jboss.ha.singleton.HASingletonController"name="jboss.ha:service=HASingletonDeployer">...</mbean>
In this case, the management console is accessible only on the master node serverin the cluster. If the master node fails, another server in the cluster is automaticallyselected as the master node, and the management console is activated on theserver.
Use the following command to launch a server instance in a cluster:
$JBOSS_HOME/bin/run.bat -c all -b <server_address>
Where <server_address> is an IP address that can be reached by the other serversin the cluster.
For more information, refer to http://www.onjava.com/pub/a/onjava/2003/08/20/jboss_clustering.html
TroubleshootingVarious paths are available for you in case of poor performance. You can configurethe XU memory profiler, explore database driver issues, or allocate more memoryfor applications.
Configuring the XU memory profiler:
You use the Execution Unit (XU) memory profiler to provide information about thememory usage of the XU.
124 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
The XU memory profiler provides information about the memory usage of theExecution Unit. The XU memory profiler is a Java Agent.
Important:
When the memory profiler is enabled, performance can be poorer. Use it when youneed to investigate memory issues. Do not use the memory profiler on aproduction server.
When the XU memory profiler is enabled, you can use it to retrieve usageinformation:v In the XU Dump: If you have memory issues, enable the memory profiler before
you send the XU memory dump to IBM Support.v By using the IlrRulesetUsageInformation#.getEstimatedMemorySize method:
The method gives a size estimation of the memory usage of a ruleset. You canretrieve information on how a ruleset is used from the instance of the class.Retrieve the instance in one of the following ways:– From the XU plug-in, when the method is called.– From the XU custom ruleset cache: the instance is passed as a parameter of
the IlrRulesetCache. method.
To configure the XU memory profiler:
1. Set the XU configuration parameter rulesetUsageMonitorEnabled to true in thera.xml deployment descriptor file of the XU RAR.
2. Edit the launch script .sh or .cmd and add the following line:JAVA_OPTIONS="-javaagent:<InstallDir>/executionserver/lib/jrules-res-memory-agentclient.jar"
3. Restart the application server to apply the changes.
Rule Execution Server database driver issues:
Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Oracle XA features:
If you have to use XA features with an Oracle 9i database, you must configureyour database and the server JVM.
Procedure
To configure your database and the server JVM:
Run the two scripts initjvm.sql and initxa.sql that are located in the directory:<ORACLE_HOME>/javavm/installFor more information, contact your DBA or your local Oracle support.
JDBC not bound:
A JDBC not bound error most likely indicates a missing directory, schema, orprivilege.
A JDBC not bound error message is raised when an error occurs during the creationof the data source.
Configuring Decision Server Rules 125
Refer to the traces to locate the original cause. In the vast majority of cases, thecauses can be:v A directory does not exist or cannot be read or written.v There is a missing schema or table.v There are missing privileges to access the database resource.
Providing more memory for applications:
If you experience core dumps or Java out-of-memory errors when running RuleExecution Server, you can make more memory available to your application server.
Procedure
To increase the JBoss application server memory settings:1. Stop your application server.2. Open the file <JBOSS_HOME>/bin/run.conf.bat if you are on Windows, or the
script <JBOSS_HOME>\bin\run.conf if you are on Linux or UNIX.3. Find the following line and alter the values to suit your server usage: set
JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m -XX:MaxPermSize=256m
Configuring Rule Execution Server on WebLogic 10.3.2To be able to use Rule Execution Server on a new instance of WebLogic, you mustdeploy the provided archives for this server and perform a number ofconfiguration tasks.
Before you startTo configure Rule Execution Server on WebLogic Server, you must follow specificsteps. Some steps are mandatory, while others apply in certain cases only.
These steps are summarized in the table below.
To understand the tasks you must complete to configure Rule Execution Server foryour application server, see “What steps to follow”
The Rule Execution Server console contains an Installation Settings wizard that youcan use to create resources in an empty database schema and run SQL dropstatements to clear an existing database.
To use the Installation Settings wizard, you must first sign in to the Rule ExecutionServer console as the administrator. See “Populating a database using the RuleExecution Server console” on page 135 for more information.
Alternatively, you can use Ant tasks to install Rule Execution Server on WebLogicServer, see “Populating a database using the SQL scripts” on page 139 for moreinformation.
What steps to follow
The installation steps you follow to install Rule Execution Server on WebLogicServer depend on the type of persistence you use, as summarized below. For moreinformation about persistence, see “Step 1: Selecting and applying the persistencetype” on page 128.
126 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Installation StepsPersistence
File Data source JDBC
“Step 1: Selecting and applying thepersistence type” on page 128
Defaultpersistencemode
“Step 2: Enforcing database userpermissions” on page 128
“Step 3: Creating an emptydatabase schema” on page 129
Not applicable
“Step 4: Creating a data source andconnection pool” on page 129
Not applicable
“Step 5:Configuringsecurity” onpage 131
“Adding a newgroup” on page131
“Adding a newuser” on page131
“DenyingWebLogic Serveradministratorrights to theresAdmin user”on page 133
Optional Optional Optional
“Step 6: Deploying the RuleExecution Server ManagementEAR” on page 134
“Step 7:Populating aRule ExecutionServer database”on page 135
“Populating adatabase usingthe RuleExecution Serverconsole” on page135
Not applicable
“Populating adatabase usingthe SQL scripts”on page 139
Not applicable
“Step 8: Enabling AnonymousAdmin Server Lookup for MBeans”on page 140
“Step 9: Deploying the XU(Execution Unit) RAR” on page 141
“Step 10: Deploying the hostedtransparent decision service EAR”on page 142
Optional Optional Optional
“Step 11: Verifying theconfiguration” on page 143
Optional Optional Optional
Configuring Decision Server Rules 127
Step 1: Selecting and applying the persistence typeYou can change the default datasource RuleApp and Java XOM persistencesettings by running an Ant script that generates a new Rule Execution Servermanagement archive.
By default, persistence is set to datasource for both RuleApps and managed JavaXOMs in the deployment descriptor of the Rule Execution Server managementarchive.
To change the persistence settings, the distribution provides an Ant script in the<WODM_InstallDir>/executionserver/bin/ressetup.xml file. Use it to create a newinstance of the Rule Execution Server management archive and, in the case of aJava EE application server, the Execution Unit (XU).
Note:
v If you use file-based persistence on Solaris, your file system must support allcharacters used in directory and file names that are present in the ruleset path(RuleApp name and ruleset name). Set the LANG system property with theencoding that is compatible with your package and rule names, for exampleen_US.UTF-8.
v If you select the file persistence type for RuleApps, you cannot use DecisionWarehouse.
v MySQL persistence: If you choose to use MySQL as a persistence back end, addor set the following properties in the MySQL configuration file my.ini (onWindows) or my.cnf (on UNIX operating systems):sql-mode=STRICT_ALL_TABLESmax_allowed_packet=1073741824
For more information about these settings, see the MySQL 5.0 reference manual:5.1.6. Server SQL Modes and 5.1.3 Server System Variables.
Step 2: Enforcing database user permissionsIf Rule Execution Server data is stored in a database, you can restrict the type ofoperations that a user can perform on a database by defining access privileges.
The data source that contains the Rule Execution Server data is always mapped toa database user.
Note:
The database privilege types differ across the supported databases. Defining andassigning privileges is performed by a database administrator.
Any privilege listed in the table as Not required denotes that it is not required bythe Rule Execution Server data source.
The following table highlights the database permissions that you must enforce fordatabase users, with attention given to the type of operation that you want them toperform:
Database permission
Operation
Browse and editrulesets/ruleApps(resAdmin)
Create the Rule ExecutionServer schema
CREATE ANY INDEX Not required Required
128 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Database permission
Operation
Browse and editrulesets/ruleApps(resAdmin)
Create the Rule ExecutionServer schema
DROP ANY INDEX Not required Required
CREATE ANY SEQUENCE Not required Required
DROP ANY SEQUENCE Not required Required
SELECT ANY SEQUENCE Required Not required
CREATE ANY TABLE Not required Required
DROP ANY TABLE Not required Required
INSERT ANY TABLE Required Not required
SELECT ANY TABLE Required Not required
UPDATE ANY TABLE Required Not required
DELETE ANY TABLE Required Not required
CREATE ANY TRIGGER Not required Required
CREATE ANY VIEW Not required Required
DROP ANY VIEW Not required Required
Step 3: Creating an empty database schemaIf you set the persistence mode to datasource or JDBC, you have to create adatabase schema before creating a data source, or use the Installation Settingswizard.
If you set persistence to file, you can skip all the database-related tasks andproceed directly to “Step 5: Configuring security” on page 131.
For more information about persistence, see “Step 1: Selecting and applying thepersistence type” on page 7.
If you use the default persistence (datasource) or you set persistence to JDBC, youmust create a dedicated schema.
Once your database is created, go to “Step 7: Populating a Rule Execution Serverdatabase” on page 135 to learn how to populate it with tables, views, and so on.To populate the database, you can either use the Installation Settings wizard, oryou can run the provided SQL scripts. These scripts are located in<InstallDir>/executionserver/databases. A readme file in this directory providesadditional information about the scripts.
Step 4: Creating a data source and connection poolCreate a JDBC data source and connection pool.
About this task
The data source is based on the database schema created as described in “Step 3:Creating an empty database schema.”
Note:
Configuring Decision Server Rules 129
If you choose to use the Rule Execution Server console to create the databaseschema, you must create an empty database.
Procedure1. Ensure that your database is running.2. In the WebLogic Server administration console, in Domain Structure click
Services > JDBC and click Data Sources.3. In the Summary of JDBC Data Sources page under Data Sources, click New.4. In the Create a New JDBC Data Source page, name your data source (for
example, Rule Execution Server data source) and type jdbc/resdatasourcefor the JNDI name. Select a Database Type.Click Next.
5. Select the Database Driver that to connect to the database. Use the XAdatabase driver.Click Next.
6. You are provided with information on Transaction Options and the driveryou have selected.If you created a connection pool with a non-XA driver and you want to allowyour data source to be involved in XA transactions, select Emulate Two-PhaseCommit. You must also select Supports Global Transactions.Click Next.
7. Define the Connection Properties.
Database name
Enter resdb.
Host name
Enter localhost.
Port
Enter the port (for example, 0 for the embedded Derby database).
Database User Name
Enter RES.
Password
Use RES and confirm it.Click Next.
8. In the Test Database Connection page, click Test Configuration to ensure thatthe connection pool is operational. If the console displays the followingmessage, your connection pool is ready to be used.Connection test succeeded.
Click Next.9. In the Create a New JDBC Data Source page, under Select Targets and
Servers select the check box next to AdminServer and click Finish.10. Click Activate Changes.
Results
After you have created the JDBC data source and connection pool, you can viewthe data pool properties for the selected data source.
130 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
To view the properties:
1. In the Domain Structure open Services > JDBC and click Data Sources.2. In the Summary of JDBC Data Sources page, click the data source name.3. In the Settings page for the data source, click the Connection Pool tab. The
page displays the data pool properties for the selected data source.
Step 5: Configuring securityYou control access to Rule Execution Server and enforce security by defining usergroups and associated roles.
Adding a new group:
Create the group of users that will be granted access to Rule Execution Server.
About this task
There are three mandatory user groups that you must create in the security realm:v resMonitors
v resDeployers
v resAdministrators
Procedure
1. In the WebLogic Server administration console, in Domain Structure clickSecurity Realms.
2. In the Summary of Security Realms page, under Realms click myrealm.3. In the Settings for myrealm page, click the Users and Groups tab and then
click Groups.4. In the Groups page, click New.5. In the Create a New Group page enter the group name resAdministrators and
Rule Execution Server administrator for the description. Click OK.The console displays the following message:Group created successfully
6. Create the resMonitors and the resDeployers groups in the same way.The definitions are shown in the Groups page.
Adding a new user:
Once the user groups created, you must create the users and then add them to thegroups.
About this task
To add new users to WebLogic Server, you must create the users first and then addthem to the groups.
Procedure
1. In the WebLogic Server administration console, in Domain Structure clickSecurity Realms.
2. In the Summary of Security Realms page, under Realms click myrealm.3. In the Settings for myrealm page, click the Users and Groups tab and then
click Users.4. In the Users page click New.
Configuring Decision Server Rules 131
5. In the Create a New User page enter resAdmin for the name and a passwordwith a minimum of eight characters (such as resAdmin1).
Note:
The user names must be an exact match of the strings resAdmin, resDeployer,and resMonitor. This is because the weblogic.xml file (jrules-res-management-WL10.ear/jrules-res-management.war/WEB-INF/weblogic.xml)defines these strings in the security role assignments:<weblogic-web-app .......>
<security-role-assignment><role-name>resAdministrators</role-name><principal-name>resAdmin</principal-name>
</security-role-assignment><security-role-assignment>
<role-name>resDeployers</role-name><principal-name>resDeployer</principal-name><principal-name>resAdmin</principal-name>
</security-role-assignment><security-role-assignment>
<role-name>resMonitors</role-name><principal-name>resMonitor</principal-name><principal-name>resDeployer</principal-name><principal-name>resAdmin</principal-name>
</security-role-assignment>
...</weblogic-web-app>
If you want to change the user name, you can change the principal-name inthe weblogic.xml file.
If you do not want to change the deployment descriptor, when deploying theRule Execution Server management console application, you can selectCustom Roles as the security model.
6. Click OK.The user resAdmin is shown in the Users page.
7. In the Name column click resAdmin to open the Settings for resAdmin page.Click the Groups tab to open the Parent Groups pane.
8. Select resAdministrators in the Available column and click the arrow tomove resAdministrators to the Chosen column. Now add resDeployers andresMonitors to the Chosen column.
Note:
To add members to the resAdministrators group, you must add the group tothe user definition.
9. Add the resAdmin user to the Administrators group by addingAdministrators to the Chosen column and click Save.If you do not want to give the resAdmin user administrator’s rights to theWebLogic Server, see “Denying WebLogic Server administrator rights to theresAdmin user” on page 133 for instructions on how to proceed.
Note:
132 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
The user name for the Rule Execution Server console in WebLogic Server canbe reassigned by editing the weblogic.xml file in the jrules-res-management-WL10.war file, and creating a new user with the same name in the WebLogicServer administration console.
10. Using Steps 4 through to 10 of the procedure described for adding theresAdmin user, create the users shown in the following table and add the usersto the groups.
User Password Groups
resMonitor resMonitor1 resMonitors
resDeployer resDeployer1 resDeployers, resMonitors
resAdmin resAdmin1 resAdministrators,resDeployers, resMonitors,Administrators
Denying WebLogic Server administrator rights to the resAdmin user:
You might want to prevent the resAdmin user from logging on to the WebLogicServer administration console.
About this task
If you do not want to grant WebLogic Server administrator rights to the resAdminuser, or in other words, if you do not want the resAdmin user to be able to modifythe WebLogic Server configuration, follow the instructions below:
Note:
This section does not apply if you are deploying Rule Execution Server on aWebLogic Server cluster and you have enabled the administration port on yourmanagement server. In this case, it is not possible to remove the link between theresAdmin user and the Administrators group.
Procedure
1. In the Summary of Security Realms page, under Realms click myrealm.2. In the Configuration tab, on the General page, select Use Authorization
Providers to Protect JMX Access.3. Click Save.4. Restart the server.5. Open the Summary of Security Realms page, then under Realms click
myrealm. Click the Roles and Policies tab, then open the Realm Policiespage.
6. Under Policies, click JMX Policy Editor.7. On the JMX Policy Editor page, check that GLOBAL SCOPE is selected. Click
Next. Check that ALL MBEAN TYPES is selected, then click Next.8. Under Attributes and Operations, select the check box next to Operations:
Permission to Invoke.Click Create Policy.
9. Click Add Conditions, select Role from the Predicate List, and click Next.Type Admin in the Role Argument Name field and click Add, then clickFinish.
Configuring Decision Server Rules 133
10. Click Add Conditions, select Group from the Predicate List, and click Next.Type resAdministrators in the Group Argument Name field and click Add.Type resDeployers in the Group Argument Name field and click Add. TyperesMonitors in the Group Argument Name field and click Add. Click Finish.The policy conditions are as shown below:Group: resAdministrators or resDeployers or resMonitorsOrRole: Admin
Click Save.11. Repeat steps 7 to 10, but this time, in step 10, select the check box next to
Unregister instances of this MBean using MBean server methods.12. Restart WebLogic Server.
Step 6: Deploying the Rule Execution Server Management EAROnce you have defined security settings, you can deploy the Rule Execution ServerManagement EAR on WebLogic Server.
Procedure1. Open the WebLogic Server administration console.2. In Domain Structure click Deployments.3. In the Summary of Deployments page under Deployments, click Install.4. In the Install Application Assistant click the upload your file(s) link.5. Click Browse next to Deployment Archive and upload the following file:
<InstallDir>/executionserver/applicationservers/WebLogic10/jrules-res-management-WL10.ear
Click Next.6. Select the check box next to the jrules-res-management-WL10.ear file and click
Next.7. Select Install this deployment as an application and click Next.8. In the Security section, select DD Only: Use only roles and policies that are
defined in the deployment descriptors when you want to use the defaultusers specified in the deployment descriptor of the Rule Execution Servermanagement console application. Otherwise, select Custom Roles: Use rolesthat are defined in the Administration Console; use policies that are definedin the deployment descriptor for defining other users in the AdministrativeConsole.
9. If you selected Custom Roles: Use roles that are defined in theAdministration Console; use policies that are defined in the deploymentdescriptor. in step 9, you must perform the following steps:a. Click jrules-res-management-WL10 then in the Settings for
jrules-res-management-WL10 page, click the Security tab.b. Under Enterprise Application Scoped Roles, click New. Enter
resAdministrators as the name of the new role. Click OK.c. Create two other roles, resDeployers and resMonitors.d. Click resAdministrators in the Enterprise Application Scoped Roles table.e. Click Add Conditions, select Group in the Predicate List and click Next.f. Enter resAdministrators for the Group Argument Name. Click Add, then
click Finish and then click Save.g. Go back to the Roles page (use the breadcrumbs at the top of the page for
easy navigation). Repeat steps d to f to add the resDeployers and then theresMonitors groups as the role condition.
134 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
10. Accept the other default settings and click Finish.
Results
The state of the EAR file is now Active.
Step 7: Populating a Rule Execution Server databaseAfter you have created an empty database schema, you can populate the RuleExecution Server database from the Command Editor or from the Rule ExecutionServer console.
Populating a database using the Rule Execution Server console:
To populate a Rule Execution Server database, you can run the database scriptsfrom the Rule Execution Server and use the Installation Settings wizard if youwork on Windows and other supported distributed platforms.
Installation Settings wizard overview:
On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.
If you are configuring your Rule Execution Server with database persistence andwant to populate your database, you can use the wizard for the followingpurposes:v Select the type of schema database resources that you want to create.v Create the required resources, in an empty database schema, to use Rule
Execution Server.
Important:
Mind the following points:1. Only the users who configure Rule Execution Server from a distributed
platform and Windows can work from the Installation Settings wizard.2. You must create the empty database schema on your application server
before you use the Installation Settings wizard. Refer to the configurationstep about creating an empty database schema for more information.
3. To open the Installation Settings wizard, you must log in to the RuleExecution Server Console with administrator rights. The default user withthese rights is resAdmin. For more information about setting passwords andthe permission required to access the Installation Settings wizard, see “Step5: Configuring security” on page 131.
4. To configure the database to store managed Java XOM, you follow theprocedure twice, with a different target database each time.
The Installation Settings wizard creates all the required tables for Rule ExecutionServer and for Decision Validation Services, even if you do not have a license forDecision Validation Services.
Note:
If you are using file persistence or have an existing data schema, the InstallationSettings wizard does not open when you log in to the Rule Execution Server
Configuring Decision Server Rules 135
console. In this case, follow the procedure described in “Populating a databaseusing the SQL scripts” on page 139 to create the database tables.
The combination of persistence settings for RuleApps and managed Java XOMsaffects the way in which you use the Installation Settings wizard.v If the RuleApp persistence and the Java XOM persistence are both set to file:
No wizard is presented.v If the RuleApp persistence and the Java XOM persistence are both set to
datasource or JDBC: When you sign in to the Rule Execution Server Console,the RuleApp persistence details part of the Installation Settings wizard appearsfor you to create the schema for RuleApps and the Decision Warehouse trace.After you have completed this step, the Java XOMs persistence details part ofthe wizard is displayed for you to configure the database for Java XOMpersistence.
v If the RuleApp persistence is set to file and the Java XOM is set to datasourceor JDBC: You see only Java XOMs persistence details and you cannot use theDecision Warehouse.
v If the RuleApp persistence is set to datasource and the Java XOM is set to fileor is not defined: When you sign in to the Rule Execution Server Console, onlyRuleApp persistence details appears for you to create the schema for RuleApps.The Java XOMs persistence details part of the wizard is not shown.
The following table summarizes the cases.
Persistence
RuleApps
file datasource/JDBC
Java XOMs file No InstallationSettings wizard
RuleAppspersistence detailsonly
datasource Java XOMspersistence detailsonly
No DecisionWarehouse
Complete InstallationSettings wizard
Opening the Rule Execution Server console:
To open the Rule Execution Server console and the Installation Settings wizard,you must sign in with resAdministrators rights.
Before you begin
Read “Installation Settings wizard overview” on page 135.
About this task
To access the Installation Settings wizard, you must first open and sign in to theRule Execution Server console.
Procedure
1. Open the Rule Execution Server console in a Web browser by typing res at theroot URL on the host machine:http://<hostname>:<port>/res
136 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
v If your browser is not running on the same host as the application server,replace localhost with the address of the machine.
v If the Web application is mapped to a host which is defined on a port that isdifferent from the default of the server, change the port number to the hostport number.
2. Sign in to the Rule Execution Server console as the administrator.For example:
User ID
resAdmin
Password
resAdmin1
Results
If you are using database persistence and the database schema is empty, theInstallation Settings wizard opens and you can use it to complete the installation.Related information:“Installation Settings wizard overview” on page 135On Windows and distributed platforms only, you can use the Installation Settingswizard of the Rule Execution Server Console to choose a database schema andcreate the necessary database tables and views.
Step 1: Welcome to the Installation Settings wizard:
If you open the Rule Execution Server Console with datasource or JDBC as thepersistence setting and an empty database schema, the Installation Settings wizardopens.
The wizard can display two parts:v It starts with RuleApp persistence details if you set datasource or JDBC
persistence for RuleApps, whatever the persistence type for managed JavaXOMs.
v Java XOMs persistence details is shown after RuleApp persistence details ifyou have set datasource persistence for both RuleApps and Java XOMs. In thiscase, you go through the same steps twice.The wizard starts with Java XOMs persistence details if you have set thepersistence type to file for RuleApps and to datasource for managed JavaXOMs.
Both parts of the wizard are similar and you use them in the same way:1.
The Welcome page provides the following information:v Persistence details about the type of database used. This includes information
about the driver and JDBC URL.v A brief description of the purpose of the Installation Settings wizard.v A diagnostic report that provides information about why the persistence
check failed (because you have not yet created the database tables).Click Next to proceed.
2. “Step 2: Choose the database schema” on page 138.3. “Step 3: Review the database schema” on page 138
Configuring Decision Server Rules 137
4. “Step 4: The Installation Settings wizard report” on page 139
Step 2: Choose the database schema:
Choose the database schema. Specific settings are available for DB2. Optionally,you can select a customized SQL script.
Before you begin
You must have created the empty database schema before you use the InstallationSettings wizard.
About this task
After you have read the Welcome page, you select an available Rule ExecutionServer database schema or you upload a custom schema.
Procedure
1. In the Database schema selected field, select an available database schematype.A type that corresponds to the type of database you are using is selected bydefault, but you can choose another type from the drop-down list.If you select a db2 or db2_os390 schema, an extra field displays so that you canenter the name of the buffer pool, which is used to create the DecisionWarehouse tablespace. This buffer pool must have a page size of 32K. Checkthe DB2 documentation for information about how to create a 32K buffer pool.
Note: The scripts for creating the Decision Warehouse database on DB2 arewritten for databases that use automatic storage. When you use the InstallationSettings wizard, you create both the Rule Execution Server and the DecisionWarehouse database, so your database must use automatic storage.
If you have not configured your DB2 database to use automatic storage, youcannot use the Rule Execution Server Console to create the Rule ExecutionServer tables.
To create database tables, see “Populating a database using the SQL scripts” onpage 139.
Decision Warehouse tablespaces are always created, even if you have notinstalled Decision Validation Services.
2. Optional: Select custom if you want to use a customized SQL script, then clickBrowse to select the location of the custom script.
3. Click Next to review the database schema.Related information:“Step 3: Creating an empty database schema” on page 129If you set the persistence mode to datasource or JDBC, you have to create adatabase schema before creating a data source, or use the Installation Settingswizard.
Step 3: Review the database schema:
After you have selected a database schema, you have access to a choice of optionsfor the schema.
138 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Before you begin
Before using this option, ensure that you have a backup of database resources.
About this task
After you have selected a database schema, you confirm the creation of a schemafor Rule Execution Server. You can also use SQL drop statements that flush datafrom an existing table and view the SQL statements.
Procedure
1. Select from the following options:
Create SQL schema “resAdmin”
Select this option to run the SQL statement for the schema type selectedin the previous step.
Keep drop SQL statements
Select this option to flush data from an existing Rule Execution Serverdatabase.
Show SQL statements
Select this option to display the SQL statements.2. Click Execute to start the options that you have selected.
Step 4: The Installation Settings wizard report:
Finally, after you have selected and confirmed the schema, the Installation Settingswizard reports the status.
About this task
After you have confirmed the database schema, the Installation Settings wizardcreates the schema. A report shows the status of the schema creation.
Procedure
1. Click Show execution details to view the list of SQL statements executed.2. Click Finish.
If you have just worked in RuleApps persistence details and the persistencesetting for managed Java XOMs is datasource, the Java XOMs persistencedetails part of the wizard displays now for you to repeat the procedure.
Populating a database using the SQL scripts:
Use SQL scripts to create a dedicated schema if you are using a database as yourpersistence layer.
The script that creates the database schema is namedrepository_<DatabaseName>.sql. SQL scripts can be found in this directory<InstallDir>/executionserver/databases
Note:
If you want to use Decision Warehouse, you can also create the required databasetable by running the script trace_<DatabaseName>.sql. If you are also persisting
Configuring Decision Server Rules 139
the Java XOM in a database, you must create these tables by running thexomrepository_<DatabaseName>.sql script.
If you use Command Editor to run the scripts, you must log in with the credentialsyou use for the data source for Rule Execution Server.
Use any tool that can handle SQL to import and run the SQL scripts. The toolsprovided for each database include:
Database Database tool
IBM DB2 DB2 command line processor
Derby ij command line processor
H2 H2 console
HSQL HSQL database manager
MySQL mysql command line processor
Oracle sqlplus command line processor
SQL Server Query Tool
Sybase isql command line processor
To access the database, the database user must have a user ID and a password. Thedatabase user must also have:v complete privileges on the tables and view of the schema (create, insert, delete)v create index privileges
On Oracle, the database user must also have create trigger and create sequenceprivileges.
When using an Oracle database, run all the scripts in the SQL Plus client.
Install a database client for the database that you use. Refer to the documentationof the database you are using for more information.
Step 8: Enabling Anonymous Admin Server Lookup for MBeansEnable Anonymous Admin Server Lookup.
About this task
To use Rule Execution Server with WebLogic Server, the option AnonymousAdmin Lookup Enabled must be set to true. This option provides the MBean APIwith read-only access to WebLogic Server MBeans. Registration of full RuleExecution Server management and XU MBeans requires this access.
You can modify the option as shown below or using the following procedure.:-Dweblogic.management.anonymousAdminLookupEnabled=true
Procedure
To enable Anonymous Admin Server Lookup from the server administrationconsole:1. Open the WebLogic server administration console.2. In the Domain Structure click the name of your domain.
140 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
3. In the Settings for <domain > page click the Security tab.4. In the Security page under General, select Anonymous Admin Lookup
Enabled and click Save.5. Restart the WebLogic Server.
Results
If the Anonymous Admin Lookup Enabled option is disabled, when startingdeployment of the management console (EAR file) the following exception isthrown:
javax.naming.NoPermissionException: User <anonymous> does not havepermission on weblogic.management.adminhome to perform lookup operation.
If the Anonymous Admin Lookup Enabled option is disabled, when startingdeployment of the XU RAR an exception is also thrown.
To verify the setting of the Anonymous Admin Lookup Enabled option throughthe WebLogic server administration console, see the Domain: Security: Generalpage in the WebLogic server administration console or the attribute:SecurityConfigurationMBean.AnonymousAdminLookupEnabled
Step 9: Deploying the XU (Execution Unit) RARThe XU (Execution Unit) is a resource adapter for Java EE-based applicationservers. It is supplied as a RAR archive that you must deploy on your applicationserver.
About this task
You can use the upload directory of WebLogic Server to deploy the modules atstart up. The upload directory depends on the server configuration; by default it isnamed /autodeploy. The directory is in the list of directories presented in theWebLogic server administration console.
Note: In addition to the procedure described here, you also have the option todeploy the XU inside the application (embed the XU into the EAR).
Note also the following:v There might be some instances where, due to your application constraints, you
have to deploy the XU inside the application. It is your decision to choose theappropriate deployment mode of the XU (either embed into the EAR or deployas a global connector). Refer to the application server documentation forinstructions on packaging a connector into an EAR.
v Be aware that when the XU is deployed as a global connector its third-partylibraries (such as ASM) might be used by the deployed J2EE applications insteadof the libraries deployed in the application server.
v When the XU is deployed as a global connector, use a parent last setting for itsJ2EE application if your J2EE application does not support the version of thethird-party libraries distributed with Decision Server. If this is not possible, youmight have to embed the XU into the EAR which is executing the rules.
v When using an embedded XU packaging, use a parent last setting for the codelibrary if the third-party libraries version deployed at the application server codelibrary level is not compatible with the XU.
Configuring Decision Server Rules 141
You can find the name of your server by opening Environment in the DomainStructure and clicking Servers.
Procedure1. Open the WebLogic Server administration console.2. In the Domain Structure click Deployments.3. In the Summary of Deployments page under Deployments, click Install.4. In the Install Application Assistant click the link upload your file(s).5. Click Browse next to Deployment Archive and upload the following file:
<InstallDir>/executionserver/applicationservers/WebLogic10/jrules-res-xu-WL10.rar
Click Next.6. Select the check box next to the jrules-res-xu-WL10.rar file and click Next.7. Select Install this deployment as an application and click Next.8. Select Use the defaults defined by the deployment's targets and click Finish.9. The resource adapter is shown in the Deployments table.
Step 10: Deploying the hosted transparent decision service EARYou can optionally deploy the hosted transparent decision service on yourapplication server.
About this task
The hosted transparent decision service must be deployed on the same node as theXU.
Procedure1. Open the WebLogic server administration console.2. In Domain Structure click Deployments.3. In the Summary of Deployments page under Deployments, click Install.4. In the Install Application Assistant click the upload your file(s) link.5. Click Browse next to Deployment Archive and upload the file
<InstallDir>/executionserver/applicationservers/WebLogic10/jrules-res-htds-WL10.ear.Click Next.
6. Select the check box next to the jrules-res-htds-WL10.ear file and click Next.7. Select Install this deployment as an application and click Next.8. Accept the default settings and click Finish.9. Click Deployments and in the Summary of Deployments, select the
jrules-res-htds-WL10 file and select Start > Servicing all requests.10. Verify that the archives have been deployed (the State is shown as Active).
Note:
By default the ruleset.xmlDocumentDriverPool.maxSize ruleset property valueis set to 1. This value could cause a bottleneck if you have several clientsexecuting a hosted transparent decision service concurrently. Increasing thevalue of this property could significantly increase the performance. Tooptimize performance, the value should depend on the number of concurrentexecutions of the ruleset. For example, if you have 5 concurrent clients, 5 maybe a good value.
142 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Set the value of the ruleset property using the Ruleset Panel in the RuleExecution Server console as follows:a. Click the Explorer tab.b. Click RuleApps in the Navigator panel to display the RuleApps View.c. Click the name of the RuleApp that contains the ruleset in the RuleApps
View.d. In the RuleApp View, click the relevant ruleset.e. In the Ruleset View, click Add Property.
A New Ruleset Property form opens.f. Select the predefined property ruleset.xmlDocumentDriverPool.maxSize in
the drop down list.g. Set the required value.h. Click Add.
What to do next
For more information about checking that the hosted transparent decision servicehas been deployed successfully, refer to the Rule Execution Server console onlinehelp.
Step 11: Verifying the configurationAlthough this step is optional, it is good practice to verify that Rule ExecutionServer has been successfully configured.
About this task
You can verify that Rule Execution Server has been successfully configured bylaunching the Rule Execution Server diagnostics.
Important:
v To let a scalable number of users access resources through the Java components,JCA assigns the task of implementing connection pooling to application servervendors.
v If the diagnostics are performed before any XUs have been started, the test ispassed and a message displays verifying that no XUs have been initialized.
Procedure1. Open the Rule Execution Server Console by typing res at the root URL on the
host machine:http://localhost:7001/res
If your browser is not running on the same host as the application server,replace localhost with the address of the machine. If the Web application ismapped to a host that is defined on a different port to 7001, change the portnumber from 7001 to the host port number.
2. Sign in to the Rule Execution Server Console.3. In the Rule Execution Server Console, click the Diagnostics tab.4. Click Run Diagnostics.
You see a report showing all the diagnostic tests that have just been run. Acheck mark is shown next to each check. Click Expand All to show detailsabout all checks.
Configuring Decision Server Rules 143
Optional configuration stepsYou can enhance your configuration with additional options, such as multiserverconfiguration, or deploying onto a server cluster.
Repackaging the Rule Execution Server archive using Ant:
When you need to repackage an Rule Execution Server archive to configure theRule Execution Server, you can use an Ant task, provided that you have set up theAnt task environment.
Before you begin
Before you run the res-setup Ant task, you must set up the Ant task environmentcorrectly. For more information, see Setting up your environment to use Ant.
About this task
By default, persistence is set to datasource. To change the persistence type, youcan use an Ant task. An Ant script is provided with the distribution for thispurpose. The script creates new archives that use a specific persistence mode.
The following procedure uses Ant to repackage the archives to change thepersistence mode to file.
Procedure
Write the code that creates a new XU .RAR file and management .EAR file that setfile persistence:ant -Dxu.in=../applicationservers/WebLogic10/jrules-res-xu-WL10.rar-Dxu.out=myxu.rar-Dconsole.ear.in=../applicationservers/WebLogic10/jrules-res-management-WL10.ear-Dconsole.ear.out=mymanagement.ear-Dpersistence.type=file -f ressetup.xml setup
Configuring Rule Execution Server in different environments:
General configurations required to enable Rule Execution Server on differentenvironments in a single cell.
It is very likely that the development of your BRMS requires more than a singledeployment of Rule Execution Server. The development life cycle of a business ruleapplication is similar to any other software development process including stagesfor implementation, testing, deployment and maintenance. At the very least, youare likely to need an environment for your development team, one for your QAteam, and another one for in-production applications. When you configure RuleExecution Server in a single cell, it is good practice to isolate the rulesets that youuse on each server and ensure that the Execution Units (XUs) do not interfere witheach other.
These instructions assume that you do not configure multiple instances of RuleExecution Server in a single cell. Use the following instructions to set up yourdifferent environments in a single cell.
To set up different environments, go through the following steps:1. Set up different data sources.2. Deploy and configure a XU for each environment.
144 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
3. Deploy the Rule Execution Server Console for each environment.
To set up a data source for each environment:
1. Use a unique JNDI name. For example:jdbc/resdatasourceEnv1
jdbc/resdatasourceEnv2
To deploy the Rule Execution Server Console for each environment:
1. Modify the deployment descriptor of the Rule Execution Server Console EARor WAR management archive: in the web.xml, uncomment theJMX_XU_QUERY_PART parameter and specify xuName=xuEnv1.
2. Deploy the Rule Execution Server Console EAR or WAR file to the server.In the resource, reference settings in the application server:a. Set the JNDI for the data source as: jdbc/resdatasourceEnv1.b. Set the JNDI name for the XU as: eis/ConnectionFactoryEnv1.
3. Repeat the process to deploy the Rule Execution Server Console for the otherenvironments.
Restart the node agents after you complete the configuration.
Invoke the XU instances to register the XU with the Rule Execution ServerConsole.
Rule Execution Server deployment on cluster environments:
Use Rule Execution Server in a cluster or other multi-server environments.
Cluster configuration and topology:
When you deploy Rule Execution Server onto server clusters, each node hosts oneExecution Unit (XU) which is used only by a local rule session. The clustertopology significantly affects the notification mechanism.
Within the Java EE framework, clusters provide mission-critical services to ensureminimal downtime and maximum scalability. A cluster is a group of applicationservers that transparently run your Java EE application as if it were a single entity.
Cluster implementations on Java EE application servers come with their own set ofterminology. Each of the following terms are important to understand how yourcluster performs:v Cluster and component failover servicesv HTTP session failoverv Single points of failure in a cluster topology
On a cluster configuration, deploy an Execution Unit (XU) on each node. There isone XU for each node of a cluster. Use the administration console of applicationservers to handle cluster deployment. A XU instance can be used only by a local(same node) rule session. The rule session and the XU communicate using directJava method calls, so the XU does not require serialization.
Configuring Decision Server Rules 145
A cluster that uses Rule Execution Server involves a collaboration between theRule Execution Server MBeans. The topology of the cluster has significantinfluence on the management of the notification mechanism when a resource ischanged.
The management model is likely to use several times a basic scenario of adistributed notification mechanism within a cluster to interact with the variousExecution Unit (XU) instances. A XU MBean is deployed with the XU tocollaborate with the Rule Execution Server JMX infrastructure.
The following sequence applies:1. A management client sets a resource on a ruleset MBean.2. The ruleset makes a query to the MBean Server to retrieve all the XU instances
in the cluster (this operation requires a specific implementation for eachapplication server).
3. A notification is sent to each instance.
WebLogic clusters:
If you are considering deploying Rule Execution Server on a WebLogic cluster,review the following information.
When you deploy the different Rule Execution Server components on a WebLogicapplication server, it is important to deploy the management module on a singleserver in the WebLogic domain. You can deploy the Execution Unit (XU) and themanagement module on the same server, but only a single management module isnecessary to manage the deployment of an XU on each server in the cluster.
The following guidelines must be adhered to:v Define the cluster as the target for the data source and the XU.v Define one of the servers in the cluster as the target for the management module
(jrules-res-management-WL10.ear).
146 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
v Enable anonymous lookup in the security options in the WebLogicadministration console (restart all servers afterward).
The default location for the logs of the managed servers is: <WL_HOME>/common/nodemanager/NodeManagerLogs. You can use these logs to resolve any JNDI namingissue of the data source.
The notification mechanism works by transmitting messages to all the instances ofan XU on the managed servers. The management model queries the administrationserver to determine the list of managed servers, it then queries the local MBeanserver on each managed server to notify all the XU instances.
The WebLogic administration console does not have to be installed on theadministration server. It must be installed only once in the domain to keep theintegrity of the information displayed. Notification of updates is only propagatedto the XUs and not to other consoles therefore multiple consoles deployed in thatdomain are not synchronized. For further information about WebLogic clusters, seeUnderstanding WebLogic Server Clustering .
Configuring Decision Server Rules 147
For more information, refer to:v WebLogic JNDIv Cluster-Wide JNDI Naming Service
TroubleshootingVarious paths are available for you in case of poor performance. You can configurethe XU memory profiler, explore database driver issues, or allocate more memoryfor applications.
Configuring the XU memory profiler:
You use the Execution Unit (XU) memory profiler to provide information about thememory usage of the XU.
The XU memory profiler provides information about the memory usage of theExecution Unit. The XU memory profiler is a Java Agent.
Important:
When the memory profiler is enabled, performance can be poorer. Use it when youneed to investigate memory issues. Do not use the memory profiler on aproduction server.
When the XU memory profiler is enabled, you can use it to retrieve usageinformation:v In the XU Dump: If you have memory issues, enable the memory profiler before
you send the XU memory dump to IBM Support.v By using the IlrRulesetUsageInformation#.getEstimatedMemorySize method:
The method gives a size estimation of the memory usage of a ruleset. You canretrieve information on how a ruleset is used from the instance of the class.
148 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Retrieve the instance in one of the following ways:– From the XU plug-in, when the method is called.– From the XU custom ruleset cache: the instance is passed as a parameter of
the IlrRulesetCache. method.
To configure the XU memory profiler:
1. Set the XU configuration parameter rulesetUsageMonitorEnabled to true in thera.xml deployment descriptor file of the XU RAR.
2. Edit the launch script .sh or .cmd and add the following line:JAVA_OPTIONS="-javaagent:<InstallDir>/executionserver/lib/jrules-res-memory-agentclient.jar"
3. Restart the application server to apply the changes.
Rule Execution Server database driver issues:
Oracle with XA features and a JDBC not bound error are known as potentialdatabase driver issues.
Oracle XA features:
If you have to use XA features with an Oracle 9i database, you must configureyour database and the server JVM.
Procedure
To configure your database and the server JVM:
Run the two scripts initjvm.sql and initxa.sql that are located in the directory:<ORACLE_HOME>/javavm/installFor more information, contact your DBA or your local Oracle support.
JDBC not bound:
A JDBC not bound error most likely indicates a missing directory, schema, orprivilege.
A JDBC not bound error message is raised when an error occurs during the creationof the data source.
Refer to the traces to locate the original cause. In the vast majority of cases, thecauses can be:v A directory does not exist or cannot be read or written.v There is a missing schema or table.v There are missing privileges to access the database resource.
Providing more memory for applications:
If you experience core dumps, or Java out-of-memory errors when running aDecision Server module, this procedure shows how to make more memoryavailable to your application server.
Configuring Decision Server Rules 149
Procedure
To increase the WebLogic application server memory settings:1. Stop your application server.2. Increase the maximum heap size option for the Java Virtual Machine (JVM) in
the startWebLogic script. For example, the default heap size can be overriddenby using the -Xms and -Xmx switches to specify the initial and maximum sizesrespectively:This example also sets the permanent generation heap to a maximum value of128 MB.Consult the Oracle WebLogic product documentation for the heap size, basedon application architecture and the number of memory-intensive processesrunning on the host system. Stress-test applications to determine theappropriate heap size for the environment.%JAVA_HOME%\bin java -Xms128m -Xmx512m -XX:MaxPermSize=128m
3. Save the file and restart the application server.
Configuring Rule Execution Server in shared modeYou can configure Rule Execution Server so that client applications can share thesame deployed Execution Unit (XU) resource.
About this task
Note:
v The Execution Object Model (XOM) in the database contains only dynamicclasses, that is, classes that do not necessarily map to Java classes on aone-to-one basis.
v Both Java and EJB rule sessions work with XOMs that contain EJBs, that is, rulesthat use EJB objects.
Procedure1. Configure the application for the operational environment by modifying the
deployment descriptor.2. Change or redirect the bindings used in the execution components to the real
JNDI names of your application servers.For more information see the http://java.sun.com/products/ejb/docs.html#specs Sun Developer Network web site.Java EE applications use JNDI as the “switchboard” for making connectionsbetween loosely coupled components. Java EE components use JNDI to findother components that they want to use, such as EJB components, and to findresources, such as JDBC and JMS connections. You define interconnectionsbetween Java EE components by declaring them in the deployment descriptorof the component. The container automatically binds the objects at the specifiedplace in the namespace and ensures that all resource dependencies betweencomponents are satisfied before deploying the components.
Note:
You can map the names used inside the execution components to real JNDInames.
3. Verify that the contents of the Java EE application EAR or WAR file are wellformed and comply with the Java EE specification.
150 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
For more information, see the http://java.sun.com/j2ee/1.3/download.html#platformspec Sun Developer Network web site.
4. Deploy the EAR file or WAR file onto the Java EE server.
What to do next
In the following figure, the components shown in green are not provided byWebSphere Operational Decision Management. Therefore, you need to developthose components. The Java EE rule session types are available and you mustconfigure these components so that they integrate with the Execution Unit (XU).
The XU is deployed on the application server and shared by all the applicationsdeployed to the server. It works in a similar way to installing a device driver on anoperating system, in that the application server is globally enhanced with rulesetexecution capabilities. You can easily upgrade, start, stop, and monitor the XU byusing the application server management console or other tools. You must deploythe XU onto all the nodes of a cluster.
Configuring Rule Execution Server in scoped modeYou can configure Rule Execution Server so that it is scoped to a single Java EEapplication.
Configuring Decision Server Rules 151
About this task
In this use case, Rule Execution Server is scoped exclusively to a single application.The Execution Unit (XU) is deployed within a single application. With thisdeployment option, you can deploy multiple applications to the same server.
Note:
If you package the Rule Execution Server XU resource archive (RAR) file in yourenterprise application (EAR), applications that use a previous version ofWebSphere Operational Decision Management or multiple applications that use thecurrent version of WebSphere Operational Decision Management, or both, cancoexist in the same Java Virtual Machine (JVM).
Procedure1. Write and compile the source code, including the basic tasks of the client, and
your business logic.2. Specify the deployment descriptors.3. Package the .class, .jsp, and .html files, deployment descriptors, and the Rule
Execution Server .rar file into a Java EE application EAR file. Do not modifythe RAR.
4. Declare the RAR module inside the application.xml file, as follows:<application>
....<module>
<connector>jrules-res-xu-<appserver>.rar</connector></module>....
</application>
You can use the class as you do to deploy the XU to a server.It is also possible to package the rule session JAR in the same Java EEapplication EAR file. In this case, the application uses the local EJB binding andyou do not have to define the JNDI name in the application server EJBdescriptor file (ejb-jar.xml). The global JNDI tree is used to resolve externalreferences, but it is not necessary to resolve a JNDI name relative to thecomponent environment java:comp/env.If your descriptor contains <ejb-local-ref>, the JNDI lookup uses the valuedefined in the <ejb-link> attribute to find the EJB. There is no confusion withother EJBs deployed in other EAR files and no issue with mixed class loaders.
Important:
In the deployment phase of the EAR file, you must create a Java 2 connectionfactory (J2C). This step is necessary to add the JNDI name of the resourceadapter.
Tip:
If you package a rule session factory inside an application EAR, you canremove the JNDI definitions from the rule session JAR.
152 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document inother countries. Consult your local IBM representative for information on theproducts and services currently available in your area. Any reference to an IBMproduct, program, or service is not intended to state or imply that only that IBMproduct, program, or service may be used. Any functionally equivalent product,program, or service that does not infringe any IBM intellectual property right maybe used instead. However, it is the user's responsibility to evaluate and verify theoperation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matterdescribed in this document. The furnishing of this document does not grant youany license to these patents. You can send license inquiries, in writing, to:
IBM United Kingdom Laboratories,Mail Point 151,Hursley Park,Winchester,Hampshire,England SO21 2JN
For license inquiries regarding double-byte character set (DBCS) information,contact the IBM Intellectual Property Department in your country or sendinquiries, in writing, to:
Intellectual Property LicensingLegal and Intellectual Property LawIBM Japan Ltd.1623-14, Shimotsuruma, Yamato-shiKanagawa 242-8502 Japan
The following paragraph does not apply to the United Kingdom or any othercountry where such provisions are inconsistent with local law:INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THISPUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHEREXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESSFOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express orimplied warranties in certain transactions, therefore, this statement may not applyto you.
This information could include technical inaccuracies or typographical errors.Changes are periodically made to the information herein; these changes will beincorporated in new editions of the publication. IBM may make improvementsand/or changes in the product(s) and/or the program(s) described in thispublication at any time without notice.
Any references in this information to non-IBM Web sites are provided forconvenience only and do not in any manner serve as an endorsement of those
© Copyright IBM Corp. 2008, 2012 153
websites. The materials at those websites are not part of the materials for this IBMproduct and use of those websites is at your own risk.
IBM may use or distribute any of the information you supply in any way itbelieves appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purposeof enabling: (i) the exchange of information between independently createdprograms and other programs (including this one) and (ii) the mutual use of theinformation which has been exchanged, should contact:
IBM United Kingdom Laboratories,Mail Point 151,Hursley Park,Winchester,Hampshire,England SO21 2JN
Such information may be available, subject to appropriate terms and conditions,including in some cases, payment of a fee.
The licensed program described in this document and all licensed materialavailable for it are provided by IBM under terms of the IBM Customer Agreement,IBM International Program License Agreement or any equivalent agreementbetween us.
Any performance data contained herein was determined in a controlledenvironment. Therefore, the results obtained in other operating environments mayvary significantly. Some measurements may have been made on development-levelsystems and there is no guarantee that these measurements will be the same ongenerally available systems. Furthermore, some measurements may have beenestimated through extrapolation. Actual results may vary. Users of this documentshould verify the applicable data for their specific environment.
Information concerning non-IBM products was obtained from the suppliers ofthose products, their published announcements or other publicly available sources.IBM has not tested those products and cannot confirm the accuracy ofperformance, compatibility or any other claims related to non-IBM products.Questions on the capabilities of non-IBM products should be addressed to thesuppliers of those products.
This information contains examples of data and reports used in daily businessoperations. To illustrate them as completely as possible, the examples include thenames of individuals, companies, brands, and products. All of these names arefictitious and any similarity to the names and addresses used by an actual businessenterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, whichillustrate programming techniques on various operating platforms. You may copy,modify, and distribute these sample programs in any form without payment toIBM, for the purposes of developing, using, marketing or distributing applicationprograms conforming to the application programming interface for the operatingplatform for which the sample programs are written. These examples have notbeen thoroughly tested under all conditions. IBM, therefore, cannot guarantee or
154 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
imply reliability, serviceability, or function of these programs. The sampleprograms are provided "AS IS", without warranty of any kind. IBM shall not beliable for any damages arising out of your use of the sample programs.
Each copy or any portion of these sample programs or any derivative work, mustinclude a copyright notice as follows:
© (your company name) (year). Portions of this code are derived from IBM Corp.Sample Programs. © Copyright IBM Corp. _enter the year or years_.
TrademarksIBM, the IBM logo, and ibm.com are trademarks or registered trademarks ofInternational Business Machines Corp., registered in many jurisdictions worldwide.Other product and service names might be trademarks of IBM or other companies.A current list of IBM trademarks is available on the Web at “Copyright andtrademark information” at www.ibm.com/legal/copytrade.shtml.
Linux is a registered trademark of Linus Torvalds in the United States, othercountries, or both.
Microsoft, Windows, and the Windows logo are trademarks of MicrosoftCorporation in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and othercountries.
Java and all Java-based trademarks and logos are trademarks or registeredtrademarks of Oracle and/or its affiliates.
Notices 155
156 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
Index
Aaccess rights
for MBean descriptors 25, 58Anonymous Admin Server Lookup
enabling 140Ant tasks
to repackage an EAR file 121, 144to repackage an WAR file 103
asynchronous executionsupport in Decision Server 30, 63
Bbusiness rule applications
providing more memory for 105
Ccatalina script
heap size 105cells
Rule Execution Server configuration ina cluster environment 38, 70, 103,121, 144
clustersconfiguring on WebSphere Application
Server 78, 84, 85JBoss 124removing Decision Server Rules
from 88WebLogic Server 146WebSphere 74
configuration parametersfor WebSphere Application Server
clusters 84, 85, 87configuring Rule Execution Server
as a scoped Java EE application 152as a shared Java EE application 150before you start, WebSphere
Application Server 45class path, setting for Java SE 4connecting to database 57creating a connection pool 48creating a data source 48creating a Derby schema 8
on Tomcat 92creating a JDBC provider 47creating database resources 8, 92, 139database driver issues 104, 125, 149database, connecting to 57deploying the hosted transparent
decision service EAR 60deploying the management EAR 51deploying the XU RAR 59diagnostics 29, 62, 102environments 38, 70, 103, 121, 144execution stack, on Java SE 4federated repository, using 49Java SE 3JDBC not bound 104, 125, 149
configuring Rule Execution Server(continued)
on Rule Execution Serversetting custom properties 12
on Tomcatdeploying the hosted transparent
decision service 100deploying the management
stack 93overview 89
on WebSphere Application Server 5,45
creating connection pools 10creating data sources 10deploying the hosted transparent
decision service EAR 27deploying the management
EAR 17federated repository 15J2C authentication data 11JDBC providers 9mapping the admin group to the
Monitor role 16security 14
on WebSphere Application Server onLinux
J2C authentication data 48Oracle XA features 104, 125, 149populating a database
by running SQL scripts 23, 99from the Installation Settings
wizard 18, 52, 94resgroup to the Monitor role,
mapping 51using WebSphere in cluster mode 74WebSphere Application Server
security policies 17connection factories
for WebSphere MQ input and outputqueues 31, 64
for WebSphere MQ input and outputtopics 33, 66
connection pool, creatingRule Execution Server 48
connection poolscreating 108, 129Rule Execution Server
WebSphere Application Server 10custom properties
setting for data sources on WebSphereApplication Server 12
Ddata source, creating
Rule Execution Server 48data sources
creating 108, 129JDBC 129on WebSphere
creating 10
data sources (continued)setting custom properties on
WebSphere Application Server 12database resources
creating 139creating an empty database schema
on Tomcat 92on WebSphere 8
database schemacreating 108, 129for Rule Execution Server
choosing, using InstallationSettings wizard 21, 55, 97, 115,138
reviewing, using InstallationSettings wizard 22, 56, 98, 116,139
database, connectingRule Execution Server 57
databases 129Derby schema 8, 92driver issues
JDBC not bound 5, 44, 77, 104,125, 149
Oracle XA features 104, 125, 149populating
by running SQL scripts 23, 99from the Installation Settings
wizard 18, 52, 94populating from the console 112, 135populating with SQL scripts 117testing the connection
WebSphere Application Server 13user permissions 8, 91, 107, 128
Decision Server RulesWebSphere Application Server clusters
removing 88Decision Warehouse
persistence setting for executiontrace 7, 91, 107, 128
deployinghosted transparent decision service
EARon WebSphere Application
Server 27hosted transparent decision services
on Tomcat 100management EAR
on WebSphere ApplicationServer 17
Rule Execution Server managementEAR 51
XU RARon WebSphere Application
Server 26deploying, hosted transparent decision
service EARRule Execution Server 60
deploying, management EARRule Execution Server 51
© Copyright IBM Corp. 2008, 2012 157
deploying, XU RAR,Rule Execution Server 59
deployment descriptor 108Derby databases
creating a schema 8, 92diagnostics
in the Rule Execution Server consolerunning 29, 62
in the Rule Execution Server Consolerunning 102
running 120, 143
EEAR archives
repackaging using Ant 121, 144environment variables
to configure Rule Execution Server forTomcat 89
environmentsRule Execution Server
configuration 38, 70, 103, 121, 144execution stack
configuring on Java SE 4Execution Unit (XU)
memory profiler 43, 76, 125, 148WebSphere log and trace 42, 75
Ffederated repositories
Rule Execution Serveron WebSphere Application
Server 15federated repository, using
Rule Execution Server 49
Ggroups
adding in JBoss 110adding in WebLogic Server 131Rule Execution Server
on WebSphere ApplicationServer 15
Hheap size
setting for Tomcat 105hosted transparent decision service
deploying on JBoss 119hosted transparent decision service EAR,
deployingRule Execution Server 60
hosted transparent decision servicesdeploying EAR
on WebSphere ApplicationServer 27
deploying on Tomcat 100deploying on WebLogic Server 142
Iinput/output queues
creating the connection factory inWebSphere MQ 31, 64
input/output queues, WebSphere MQactivation specification 34, 67
input/output topics, WebSphere MQactivation specification 35, 68creating the connection factory 33, 66
Installation Settings wizard 89, 112, 135choosing the database schema 21, 55,
97, 115, 138report 23, 56, 98, 116, 139reviewing the database schema 22,
56, 98, 116, 139Rule Execution Server on WebSphere
Application Server 5to populate a Rule Execution Server
database 18, 52, 94installing Rule Execution Server
configuring the persistence modeJava SE 5
database driver issues 44, 77JDBC not bound 5, 44, 77on WebSphere Application Server
testing the databaseconnection 13
JJ2C authentication data
Rule Execution Serveron WebSphere Application
Server 11on WebSphere Application Server
on Linux 48Java
out-of-memory error 105Java EE
configuring Rule ExecutionServer 152
configuring Rule Execution Server asa shared Java EE application 150
Java SEconfiguring Rule Execution Server 3configuring the execution stack 4configuring the Rule Execution Server
persistence mode 5JBoss application server
adding groups 110adding users 110clusters 124configuring for Rule Execution
Server 105configuring security 110creating a data source 108deploying Rule Execution Server 112deploying the XU RAR 118hosted transparent decision
service 119populating a database 112
JDBCcreating providers
WebSphere Application Server 9not bound, Rule Execution Server 5,
44, 77, 104, 125, 149
JDBC provider, creatingRule Execution Server 47
JVMchanging in Rule Studio 3
LLast Participant Support (LPS)
enabling in WebSphere MQ 37, 70logging
XU log in WebSphere 42, 75
Mmanagement EAR, deploying
on WebSphere Application Server 17Rule Execution Server 51
management stackdeploying
on Tomcat 93mapping
the admin group to the Monitor role,in WebSphere ApplicationServer 16
mapping, resgroup to the Monitor roleRule Execution Server 51
MBeansand WebSphere MQ 30, 63descriptors for WebSphere Application
Server 7.0 25, 58security policy for the Rule Execution
Server console 17memory consumption
inspecting 43, 76, 125, 148providing more memory for
applications 105message-driven rule beans
and WebSphere MQinstallation 36, 69queue activation specification 34,
67topic activation specification 35,
68MQ
Integrating WebSphere MQ inWebSphere Application Server 30,63
Oopening
Rule Execution Server console 113,136
Rule Execution Server Console 20,54, 95
OracleXA features for Rule Execution
Server 104, 125, 149
Ppackaging
Rule Execution Server archives usingAnt 103, 121, 144
158 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
parametersSee configuration parameters
permissionsdatabase access 8, 91, 107, 128for MBean descriptors 25, 58
persistenceand Installation Settings wizard 18,
52configuring in Rule Execution
Server 7, 91, 107, 128in Rule Execution Server
configuring on Java SE 5Profile Management Tools 84, 85profile templates
installation 78to configure Rule Execution Server on
WebSphere Application Server 78properties
custom, setting 12
Qqueues, WebSphere MQ
for request messages 32, 65for response messages 32, 65
RR)Execution Unit (XU)
deploying the XU RAR 26resgroup to the Monitor role, mapping
Rule Execution Server 51roles
in WebSphere Application Server 16Rule Execution Server
See also configuring Rule ExecutionServer
configuringas a shared Java EE
application 150using Ant tasks 103, 121, 144
configuring as a scoped Java EEapplication 152
configuring for JBoss 105configuring for WebLogic Server 126configuring security 110, 131deploying on cluster
environments 122deploying on JBoss 112deploying on WebLogic Server 134deploying the hosted transparent
decision service 119deploying the XU RAR 118, 141diagnostics 29, 62, 102hosted transparent decision
service 142on WebSphere Application Server
deploying the XU RAR 26populating a database 112, 117, 135running diagnostics 120, 143setting up the persistence mode 7,
91, 107, 128Rule Execution Server console
deploying the management WAR onTomcat 93
opening 113, 136
Rule Execution Server console (continued)security policies
WebSphere Application Server 17Rule Execution Server Console
opening 20, 54, 95rule sessions
and WebSphere MQ integration 30,63
Rule Studiochanging the JVM 3
Ssecurity
J2C authentication data 11, 48policies for the Rule Execution Server
ConsoleWebSphere Application Server 17
Rule Execution Serveron WebSphere Application
Server 14security settings
configuring 110, 131SQL scripts
to populate a database 23, 99
TTomcat application server
database schema, empty 92topics, WebSphere MQ
for request messages 34, 66for response messages 34, 67
tracingXU log in WebSphere 42, 75
transaction managementin WebSphere Application Server, Last
Participant Support 37, 70
Uuser permissions 8, 91, 107, 128users
adding in JBoss 110adding in WebLogic Server 131Rule Execution Server
on WebSphere ApplicationServer 15
WWAR archives
repackaging using Ant 103WebLogic Server application server
adding groups 131adding users 131Anonymous Admin Server Lookup
option 140clusters 146configuring for Rule Execution
Server 126configuring security 131creating a data source 129denying administrator’s rights 133deploying Rule Execution Server 134
WebLogic Server application server(continued)
deploying the XU RAR 141hosted transparent decision
service 142populating a database 135
WebSphereclusters 74XU log 42, 75
WebSphere Application Servercluster configuration 84, 85
removing applications 87clusters, configuring 78, 84, 85, 87Rule Execution Server cell
deployment 40, 73security, Rule Execution Server 14
WebSphere Application Server (WAS)database schema, empty 8
WebSphere MQinput queue, creating 32, 65input topic, creating 34, 66integrating in WebSphere Application
Server 30, 63Last Participant Support,
enabling 37, 70message-driven rule bean,
installing 36, 69output queue, creating 32, 65output topic, creating 34, 67queue activation specification,
creating 34, 67queue connection factory,
creating 31, 64topic activation specification,
creating 35, 68topic connection factory, creating 33,
66
XXA
Oracle features 104, 125, 149WebSphere in cluster mode 74
XU RARdeploying on JBoss 118deploying on WebLogic Server 141
XU RAR, deployingon WebSphere Application Server 26Rule Execution Server 59
XUConnectionFactorydefault JNDI name 26, 38, 70, 103,
121, 144
Index 159
160 IBM WebSphere Operational Decision Management: Configuring Decision Server Rules
����
Printed in USA