You use Rule Designer to run this sample.
The Business Rules Report provides detailed information on the ruleset parameters, rule artifacts, and ruleflows in your project.
To run the Business Rules Report:
The report template opens in the BIRT editor.
Rule Designer generates the Business Rules Report and opens it in the viewer you selected.
The Consistency Checking Report detects and troubleshoots conflicting business rules. For more information, see Consistency checking.
To run the Consistency Checking Report:
The report template opens in the BIRT editor.
To check decision trees and decision tables, select the Include decision trees and decision tables in inter-rule checks check box.
For more information about the checks available, see Consistency checking.
Rule Designer generates the Consistency Checking Report and opens it in the viewer you selected.
The Rule Completeness Report checks whether there are gaps in a set of rules. For more information, see Completeness analysis.
To run the Rule Completeness Report:
The report template opens in the BIRT editor.
Rule Designer generates the Rule Completeness Report and opens it in the viewer that you selected.
You can customize the generated reports using BIRT which is loosely coupled in format to Rule Designer.
A report library is a collection of report components that you can use in a report. You can use the elements defined in the library in several reports.
The sample_reporting.rptlibrary library in this sample contains:
A link to the library is integrated in businessrulereport.rptdsign, consistencycheckingreport.rptdesign, and rulecompletenessreport.rptdesign automatically.
The XML Source tab displays the link in the BIRT editor as follows:
<list-property name="libraries">
<structure>
<property name="fileName"> sample_reporting.rptlibrary</property>
<property name="namespace"> sample_reporting</property>
</structure>
</list-property>
To access the Rule Designer API you use JavaScript as glue code between BIRT and Rule Designer. The scripted data source in this sample is defined in the library, and can be shared by several reports.
This sample uses seven scripted data sets which are defined in the library. The data sets correspond to rule artifacts, ruleset parameters, ruleflows, rule projects, check types, checks on consistency, and extractor types. Each data set contains output columns to define which elements are retrieved from the Rule Designer API.
For example, the Ruleset Parameter data set contains five output columns:
You use report parameters to filter the data displayed in the report. For example, you use the ruleProjectName report parameter to select the project for which you want to run a report. BIRT then generates the report for this specific rule project. You define report parameters in the library which you can then use in several reports.
This sample uses JavaScript to access the Rule Designer API and populate the output columns defined in the data sets. You use JavaScript to access all the classes of the plug-ins available to the BIRT report at runtime. The definition for the JavaScript code in this sample is in a separate file named utils.js. You can share utility functions across the open and fetch events.
You must include a link to the utils.js file in the report templates by manually integrating the link into the XML Source view of the report template as follows:
<list-property name="includeScripts">
<property>/scripts/utils.js</property>
</list-property>
The following JavaScript code shows you how to call a method of a Java™ class included in an Eclipse plug-in:
modelBundle = Packages.org.eclipse.core.runtime.Platform.getBundle( "ilog.rules.studio.reporting" );
modelClass = modelBundle.loadClass( "ilog.rules.studio.model.IlrStudioModelPlugin" );
method = modelClass.getMethod( "getRuleModel", null );
ruleModel = method.invoke( null, null );
ruleProject = ruleModel.getRuleProject( ruleProjectName );
paramIterator = ruleProject.getParameters().iterator();
The explanation of the code is as follows:
For each column in a data set, the data is retrieved from the Rule Designer API using event handlers.
This sample implements two essential event handlers on each data set:
paramIterator = getRulesetParamFromProjects( params["ruleProjectName"] );
The getRulesetParamFromProjects method returns a list of ruleset parameters.
param = paramIterator.next();
row["paramName"] = param.getName();
row["paramDirection"] = param.getDirection().getLiteral().toString();
row["paramVerbalization"] = param.getVerbalization();
row["paramType"] = param.getType();
row["paramInitValue"] = param.getInitialValue();
You can access the open and fetch events by selecting a data set in the Outline view and clicking the Script tab in the report template.
This sample uses JavaScript to access the Rule Designer API and populate the output columns defined in the data sets.