Skip to main content
Skip table of contents

RulesEngine.xml

Location<tomcat_home>\webapps\webapi\WEB-INF\data\.repository\RulesEngine.xml

This file defines rules that control table creation. For example, you can use the rules to restrict the maximum number of cells in a table, or to specify mandatory fields that must be included in all tables.

If you make any changes to the rules, you will need to restart Tomcat or the SuperWEB2 service to see the changes in the browser.

TableCellsNumberRule

The TableCellsNumberRule rule defines the maximum number of cells permitted in a table. For example:

XML
<rules:EditRule name="TableCellsNumberRule"
            applicableOperation="add"
            implClassName="au.com.str.webapi.services.database.manager.rules.impl.TableCellsNumberRule">
  <rules:impl-class-init>
    <rules:init-param name="maxElementCount" value="40000000"/>
    <rules:init-param name="disableMaxElementCount" value="false"/>
  </rules:impl-class-init>
</rules:EditRule>

The maximum number of cells permitted in a table.

The default setting is 40,000,000.

We do not recommended increasing this limit.

Please contact Space-Time Research if you have a requirement to process a table larger than the default limit.

DutyOfCareRule

When the database contains multiple fact tables, it is important to know which one is being counted. The "duty of care" settings are designed to prevent users from creating potentially erroneous tables, and to ensure that they will always know what is being counted in the cross tabulation.

For example, the sample Retail Banking database has two fact tables: customers and accounts. Users need to understand whether the table is counting the number of customers or the number of accounts (which will be a different value, because a customer could have more than one account).

The duty of care rule controls how the default summation option is determined.

The duty of care rule does not apply if the user manually adds a summation option to the table. In this case the user's choice will be used instead.

The following is the default duty of care rule:

XML
<rules:EditRule name="DutyOfCareRule"
       applicableOperation="all"
       implClassName="au.com.str.webapi.services.database.manager.rules.impl.DutyOfCareRule">
  <rules:impl-class-init>
    <rules:init-param name="Fields selected from a single fact table" value="default"/>
    <rules:init-param name="Fields selected from multiple fact tables" value="default"/>
  </rules:impl-class-init>
</rules:EditRule>

There are two parameters, each of which can have two possible values:

ParameterPossible ValuesDescription
Fields selected from a single fact table
default
When all the fields in the table come from a single fact table, the default summation for the database will be used.
use fact table
When all the fields in the table come from a single fact table, the default summation will be a count of the fact table that the fields come from.
Fields selected from multiple fact tables
default
When the fields in the table come from multiple fact tables, the default summation for the database will be used.
user selects fact table
When the fields in the table come from multiple fact tables, the user will be prompted to select which fact table they want to count.

GuestUserCellLimitRule

This rule can be used to prevent guest users from creating large tables. The rule is disabled by default (meaning that there is no restriction on the size of tables that can be created by guest users).

For more details on enabling this rule, see Prevent Guest Users from Creating Large Tables - SuperWEB2.

DBSummationOptionsRule

The DBSummationOptionsRule rule can be used to restrict users to a single summation option per table.

By default, this rule is commented out, and users can add multiple summation options to a table.

To restrict users to a single summation option per table:

  1. Uncomment the following section of RulesEngine.xml:

    XML
    <rules:EditRule name="DBSummationOptionsRule"
           applicableOperation="add"
           implClassName="au.com.str.webapi.services.database.manager.rules.impl.DatabaseSummationOptionsRule">
      <rules:impl-class-init>
        <rules:init-param name="dbid" value="*"/>
      </rules:impl-class-init>
    </rules:EditRule>
  2. If you only want to apply the summation options rule to a subset of the databases, change the value of the dbid parameter to a comma separated list of database IDs. For example:

    XML
    <rules:init-param name="dbid" value="bank,people,census"/>

    If you want to apply the rule to all databases then you can leave this set to *

  3. Locate the following section:

    XML
    <rules:RulesPipe name="CDataOnlineEditRules">
      <!-- <rules:rule-name name="OverrideDefaultSummationRule"/>    -->
      <!-- <rules:rule-name name="MandatoryFieldsRule"/> -->
      <!-- <rules:rule-name name="DBSummationOptionsRule"/> -->
      <!-- <rules:rule-name name="GuestUserCellLimitRule"/> -->
  4. Remove the comments from the DBSummationOptionsRule:

    XML
    <rules:RulesPipe name="CDataOnlineEditRules">
      <!-- <rules:rule-name name="OverrideDefaultSummationRule"/>    -->
      <!-- <rules:rule-name name="MandatoryFieldsRule"/> -->
      <rules:rule-name name="DBSummationOptionsRule"/>
      <!-- <rules:rule-name name="GuestUserCellLimitRule"/> -->
  5. Save your changes and restart Tomcat or the SuperWEB2 service.

QuantileFilterRules / FieldExclusionRule

You can use these rules to configure field exclusion rules for quantile ranges. For more information, see Configure Quantiles and Ranges - SuperWEB2.

OverrideDefaultSummationRule

You can use this rule to change the default summation options for your databases. For more information, see Change Default Summation Option - SuperWEB2.

MandatoryFieldsRule

This rule allows you to specify that certain fields are mandatory (they must be included in all tables). For more information, see Configure Mandatory Fields - SuperWEB2.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.