Dynamic Rules View

When the CONTROL attribute is set to DYNAMIC, this causes an expanding/contracting version of the decision to be displayed instead of a static tree. In this view the entire tree is not displayed. The view is "compressed" into multiple trees for each rules-item that has failed coupled with the "summary" flag on the item. See Behavior of Summary and Highlight-On-Failure Indicator for more details on the summary flag. This is accomplished using scalable vector graphics (SVG) content displayed in the Adobe SVG Viewer instead of HTML. Refer to the Cúram v6 Supported Prerequisites document to see the supported version of this Web Browser Plugin.

Although the dynamic view requires an extra browser plug-in, it provides the user with a much more comprehensive and interactive view of the rules data. The rules tree is more comprehensively organized with a supplementary conjunction text displayed next to the rules.

There is no need to set a HEIGHT or WIDTH as the rules window resizes itself automatically. The developer is limited to two dynamic rules windows per page.

Localization of the text to display within the viewer is accomplished through JavaScript property files as described in JavaScript Externalized Strings. The name of these JavaScript property files should be SVGText. For example, SVGText.js_es.properties would be the name of the Spanish language version of SVGText.js.properties file.

All style information related to the dynamic rules widgets is held in a separate file called curam_svg.css. For further details see Cascading Stylesheets.

The developer can configure the rules tree using an XML configuration file. For all rules widgets based on the RESULT_TEXT domain this configuration is read from RulesDecisionConfig.xml. A version of this file should be in your components directory. This XML configuration file is merged during the build process in a similar method to other XML configuration files.

The CONFIG attribute of the FIELD displaying rules is used to specify an ID matching a CONFIG element in the RulesDecisionConfig.xml file. The following is a sample of a RulesDecisionConfig.xml file:

Figure 1. Sample RulesDecisionConfig.xml File
<RULES-CONFIG DEFAULT="default-config">
  <CONFIG ID="default-config" HYPERLINK-TEXT="false">
    <TYPE NAME="PRODUCT"
          SUCCESS-ICON="Images/product-16x16.gif"
          FAILURE-ICON="Images/productFail.gif"
          EDIT-PAGE="RatesNewColumn"/>
    <TYPE NAME="ASSESSMENT"
          SUCCESS-ICON="Images/default-16x16.gif"
          FAILURE-ICON="Images/defaultFail.gif"
          EDIT-PAGE="RatesNewColumn"/>
    <TYPE NAME="SUBRULESET"
          SUCCESS-ICON="Images/default-16x16.gif"
          FAILURE-ICON="Images/defaultFail.gif"
          EDIT-PAGE="RatesNewColumn"/>
    <TYPE NAME="OBJECTIVE_GROUP"
          SUCCESS-ICON="Images/default-16x16.gif"
          FAILURE-ICON="Images/defaultFail.gif"
          EDIT-PAGE="RatesNewColumn"/>
    <TYPE NAME="OBJECTIVE_LIST_GROUP"
          SUCCESS-ICON="Images/default-16x16.gif"
          FAILURE-ICON="Images/defaultFail.gif"
          EDIT-PAGE="RatesNewColumn"/>
    <TYPE NAME="OBJECTIVE"
          SUCCESS-ICON="Images/default-16x16.gif"
          FAILURE-ICON="Images/defaultFail.gif"
          EDIT-PAGE="RatesNewColumn"/>
    <TYPE NAME="RULE_GROUP"
          SUCCESS-ICON="Images/default-16x16.gif"
          FAILURE-ICON="Images/defaultFail.gif"
          EDIT-PAGE="RatesNewColumn"/>
    <TYPE NAME="RULE_LIST_GROUP"
          SUCCESS-ICON="Images/rule-group-16x16.gif"
          FAILURE-ICON="Images/ruleGroupFail.gif"
          EDIT-PAGE="RatesNewColumn"/>
    <TYPE NAME="RULE"
          SUCCESS-ICON="Images/rule-16x16.gif"
          FAILURE-ICON="Images/ruleFail.gif"/>
  </CONFIG>
  <CONFIG ID="Rules.Config.Core"
          HYPERLINK-TEXT="true"
          OPEN-NODE-PARAM="openNode"
          DECISION-ID-SOURCE="source-Decision-ID"
          DECISION-ID-TARGET="decision-ID">
    <TYPE NAME="PRODUCT" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="ASSESSMENT" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="SUBRULESET" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="OBJECTIVE_GROUP" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="OBJECTIVE_LIST_GROUP" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="OBJECTIVE" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="RULE_GROUP" />
    <TYPE NAME="RULE_LIST_GROUP" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="RULE" EDIT-PAGE="RulesResult"/>
  </CONFIG>
</RULES-CONFIG>

Note that the RULES-CONFIG root element only contains the DEFAULT attribute. This attribute is mandatory and should match an ID attribute value on a CONFIG element in this document. The default configuration contains the icon information as well as the default nodes to link to if no configuration is required for a widget. These are covered by the SUCCESS-ICON, FAILURE-ICON, and EDIT-PAGE attributes respectively.

Each CONFIG element has a HYPERLINK-TEXT attribute which is used to specify whether the text next to a rules node in the widget is also to be used as a hyperlink to the link page set by the EDIT-PAGE for the TYPE in question.

Note that the CONFIG with the ID of value of Rules.Config.Core has the optional attribute OPEN-NODE-PARAM. This attribute is the name of a page parameter whose value is the ID of a node to open when the page is loaded. This configuration file is also used for configuration of the dynamic full tree rules view described in the next section.

The CONFIG attributes DECISION-ID-SOURCE and DECISION-ID-TARGET are used to identify a page parameter whose value will be the source for a new parameter (named by the DECISION-ID-TARGET) appended to each link on the widget. The above example will look for a page parameter called source-Decision-ID and pass on its value as a parameter to any links on the widget. This new value will be identified by a parameter named decision-ID.

The decision ID parameter may also be sourced from a field on a server bean instead of from a page parameter. This is achieved by adding DECISION-ID-SOURCE-BEAN and DECISION-ID-SOURCE-FIELD attributes to the CONFIG element instead of a DECISION-ID-SOURCE attribute. A validation error is thrown if all three are present. The DECISION-ID-SOURCE attribute should be the name of a bean on the page and the DECISION-ID-SOURCE-FIELD attribute should be the full name of a field providing the decision ID value. The following is an example of this configuration:

Figure 2. Example of Decision ID Sourced from a Bean
<CONFIG ID="Decision.ID.Bean.Source"
          HYPERLINK-TEXT="true"
          OPEN-NODE-PARAM="openNode"
          DECISION-ID-TARGET="decision-ID"
          DECISION-ID-SOURCE-BEAN="DISPLAY"
          DECISION-ID-SOURCE-FIELD="dtls$decision-ID">
    <TYPE NAME="PRODUCT" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="ASSESSMENT" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="SUBRULESET" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="OBJECTIVE_GROUP" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="OBJECTIVE_LIST_GROUP" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="OBJECTIVE" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="RULE_GROUP" EDIT-PAGE="RulesResult" />
    <TYPE NAME="RULE_LIST_GROUP" EDIT-PAGE="RulesResult"/>
    <TYPE NAME="RULE" EDIT-PAGE="RulesResult"/>
  </CONFIG>