Specifying filters on a ruleset

To optimize Decision Warehouse, you can specify what is stored within a trace when you execute a ruleset.

About this task

When the trace is enabled, Decision Warehouse captures all execution trace data. The trace includes a count of the number of rules executed, a list of ruleflow tasks executed, and a list of the objects in the working memory.

To reduce the information stored in an execution trace in Decision Warehouse, you apply the monitoring.filters property to the ruleset and you set filters on the property to refine the stored data. You can set the monitoring.filters property filter values in Rule Designer or Decision Center before you deploy the ruleset.

Note:

You can also enable ruleset execution monitoring in the Rule Execution Server console after you have deployed the ruleset by Setting ruleset monitoring options.

Procedure

To specify a list of filters to use on a ruleset:

  1. Add the following ruleset properties to the ruleset that you want to monitor and set the values to a string that includes the list of filters that you want to apply:
    • monitoring.filters
    • monitoring.inout.filters
  2. Set the filters to true according to the data that you want to see in the trace.

    In the query results, you see only the trace data for which you have set the filter to true.

Results

The filters work as follows:
  • If you do not set the monitoring.filters property, the Decision Warehouse stores all traces.
  • If you set the monitoring.filters property, the Decision Warehouse stores only the trace information as enabled by the filters that you have set to true. By default, all the filters that are controlled by the monitoring.filters property are set to false when you define the property.
  • If you set one filter to true, the Decision Warehouse excludes any other execution information from the trace. Only the information for which you have set a filter to true is included in the trace.
The following table lists the filters you can apply to the ruleset to specify the information that you want to monitor.
Table 1. Ruleset filters
Filter Default Purpose
INFO_EXECUTION_DATE false Provides the execution start date.
INFO_EXECUTION_DURATION false Indicates how much time the engine took to execute the ruleset.
INFO_EXECUTION_OUTPUT    
INFO_TOTAL_TASKS_EXECUTED false Provides the number of task instances that the engine executed.
INFO_TOTAL_TASKS_NOT_EXECUTED false Provides a count of the number of ruleflow tasks that the engine did not execute.
INFO_TOTAL_RULES_FIRED false Provides the number of rule instances that the engine executed.
INFO_TOTAL_RULES_NOT_FIRED false Provides a count of the number of rules that the engine did not execute.
INFO_EXECUTION_EVENTS false Provides the full execution tree for the executed ruleset. The tree is composed of executed task instances and executed rules instances.
INFO_RULESET_PROPERTIES    
INFO_TASKS false Lists the ruleflow tasks in the ruleset.
INFO_TASKS_NOT_EXECUTED false Lists the ruleflow tasks that the engine did not execute. To get the list of rule instances that were executed, use INFO_EXECUTION_EVENTS.
INFO_RULES false Lists all the rules in the ruleset.
INFO_RULES_NOT_FIRED false Lists all the rules that the engine did not execute. To get the list of task instances that were executed, use INFO_EXECUTION_EVENTS.
INFO_BOUND_OBJECT_BY_RULE false Use in conjunction with INFO_EXECUTION_EVENTS. When set, the rules that are executed in the execution tree are bound to the objects to which they were applied.
INFO_SYSTEM_PROPERTIES false Lists the JRE system properties that Rule Execution Server uses. For example, JAVA_HOME.
INFO_WORKING_MEMORY false Lists the contents of the working memory.
WORKING_MEMORY_FILTER None.

The filter is defined by the user.

Filters the contents of the working memory. Use the optional filter to define specific classes that you want to record.

To use this filter, make sure the INFO_WORKING_MEMORY filter is set to true.

For example, to return only objects of class MyClass, use:

INFO_WORKING_MEMORY=true
WORKING_MEMORY_FILTER=com.xyz.MyClass

You can specify more than one class in the string, and separate each one with a comma. For example:

WORKING_MEMORY_FILTER=com.xyz.MyClass,com.xyz.MyOtherClass

Examples

Number of executed rules and working memory
The following ruleset property is set to monitor the number of rules executed and the working memory. A class is also used to define an additional filter on the working memory:
monitoring.filters=INFO_TOTAL_RULES_FIRED=true,INFO_WORKING_MEMORY=true,WORKING_MEMORY_FILTER=com.xyz.MyClass
BOM parameters
You can also filter the contents of serialized in/out parameters. For example, specify filters for the BOM parameters as follows:
monitoring.inout.filters=borrower.some.heavy.property,loan.longfield

This property removes information to which these two classes refer from the trace.

Restriction:

You cannot use the monitoring.inout.filters property to filter elements in the BOM representation of ruleset parameters.