Skip to main content
Skip table of contents

Change Default Summation Option - SuperWEB2

In SuperWEB2 you must have at least one summation option in the table at all times. When you first add a field to the table, SuperWEB2 automatically adds a summation option.

For example, for the Retail Banking database, the default summation option is a count of customers:

You can change the default summation option by modifying <tomcat_home>\webapps\webapi\WEB-INF\data\repository\RulesEngine.xml

Make a backup copy of this file before making any changes.

To change the default summation, you need to make two changes to the rules:

Step 1 - Define the Default Summation Rule

Locate the following section of code and remove the comments from the start and end (i.e. remove the <!-- and -->):

HTML/XML
<!--
	<rules:EditRule name="OverrideDefaultSummationRule" 
		    applicableOperation="add" 
		    implClassName="au.com.str.webapi.services.database.manager.rules.impl.OverrideDefaultSummationRule">    
		<rules:impl-class-init>
		<rules:init-param name="Retail Banking" value="Customer Profit:MEAN"/>
		</rules:impl-class-init>
	</rules:EditRule>
-->

This is just an example: it sets the default summation option for a database called Retail Banking as the statistical function Mean of the Customer Profit.

Step 2 - Uncomment the Rule from CDataOnlineEditRules

Locate the following section:

HTML/XML
    <rules:RulesPipe name="CDataOnlineEditRules">
        <!-- <rules:rule-name name="OverrideDefaultSummationRule"/>    -->

Remove the comments from the OverrideDefaultSummationRule:

HTML/XML
    <rules:RulesPipe name="CDataOnlineEditRules">
        <rules:rule-name name="OverrideDefaultSummationRule"/>

Once you have completed these changes, you will need to restart SuperWEB2 or the Tomcat service in order for the changes to take effect.

JavaScript errors detected

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

If this problem persists, please contact our support.