Storing Java SE execution traces in Decision Warehouse

You can store Java™ SE execution traces in Decision Warehouse by enabling ruleset monitoring and overriding the default settings for persistence to Decision Warehouse.

About this task

When you use Rule Execution Server in Java SE mode, you can store execution traces in a Decision Warehouse database. To do so, you must enable ruleset monitoring, override the default persistence setting for execution traces, and add the driver JAR file to the class path.

By default, the Rule Execution Server looks for a JNDI jdbc/resdatasource reference to store the execution traces. That resource is not available, unless you use Rule Execution Server in Tomcat. Therefore, you must override the jdbc/resdatasource default setting to create a direct connection to the Decision Warehouse database.

Procedure

  1. Enable ruleset monitoring by setting the monitoring.enabled ruleset property to true as explained in Enabling ruleset execution monitoring.
  2. To change the persistence settings and customize the trace factory that is used by your application, add a dvs-dw.properties file to the class path. That file must contain the following properties:
    factoryClassname=ilog.rules.res.persistence.trace.impl.jdbc.IlrDriverTraceDAOFactory
    driver-classname=<JDBC driver class name>
    driver-url=<URL to establish the JDBC connection>
    driver-user=<login to establish the JDBC connection>
    driver-password=<password to establish the JDBC connection>
    The factory class uses the driver-classname property to create a JDBC connection to the database that is defined by the driver-url, driver-user, and driver-password parameters. If you need different persistence properties, you can use your own implementation of the IlrTraceDAOFactory factory class. In the following example of a .properties file, only the factoryClassname property is mandatory. The other properties are specific to the factory implementation itself. For example:
    factoryClassname=ilog.rules.res.persistence.trace.impl.jdbc.IlrDriverTraceDAOFactory
    driver-classname=org.apache.derby.jdbc.EmbeddedDriver
    driver-url=jdbc:derby:c:/my-dw;create=true
    driver-user=RES
    driver-password=RES
  3. Add the JAR file for the driver to the class path.