WebSphere Commerce database table: CALRULE

Each row in this table represents a CalculationRule, defining how to arrive at a monetary amount for a set of OrderItems.

Column Descriptions
Column Name Column Type Description
CALRULE_ID INTEGER NOT NULL Generated unique identifier.
CALCODE_ID INTEGER NOT NULL The CalculationCode of which this CalculationRule is a part.
STARTDATE TIMESTAMP The time this CalculationRule begins being effective.
TAXCGRY_ID INTEGER For TaxType CalculationUsages, the TaxCategory for which this CalculationRule is effective.
ENDDATE TIMESTAMP The time this CalculationRule stops being effective.
SEQUENCE DOUBLE NOT NULL DEFAULT 0 CalculationRules for the same CalculationCode are processed in sequence from lowest to highest value.
COMBINATION INTEGER NOT NULL DEFAULT 2 Specifies the bit flag to indicate special processing to be performed by the default CalculationRuleCombineMethod implementation. Used by the default implementation of the CalculationRuleCombineMethod to determine how this CalculationRule may be combined with other CalculationRules as follows:

  • 0 = inAdditionTo - can be combined with any rules.

  • 1 = notInCombinationWith - can only be combined with "0" rules.

  • 2 = inCombinationWith - cannot be combined with "1" rules.

CALMETHOD_ID INTEGER NOT NULL The CalculationRuleCalculateMethod that calculates a monetary result for a set of OrderItems.
CALMETHOD_ID_QFY INTEGER NOT NULL The CalculationRuleQualifyMethod that determines which of a set of OrderItems should be sent to the CalculationRuleCalculateMethod.
FIELD1 DECIMAL (20,5) Customizable.
FIELD2 VARCHAR(254) Customizable.
FLAGS INTEGER NOT NULL DEFAULT 0 Used by CalculationRuleCombineMethod to determine how this CalculationRule may be combined with other CalculationRules. Contains the following bit flag indicating special processing to be performed by the default CalculationRuleCombineMethod implementation: 1 = restricted - certain conditions must be met before the CalculationRule qualifies. Calls the CalculationRuleQualifyMethod to determine if the CalculationRule qualifies. If this flag is not 1, then the CalculationRule always qualifies.
Example 1:
For discount CalculationRules, the customer must be in one of the associated MemberGroups recognized by the Store as customer groups (see CALRULEMGP and STOREMBRGP).
Example 2:
For shipping CalculationRules, the shipping address, shipping mode and fulfillment center must match one of the ShippingJurisdictionGroupCalculationRules (see SHIPJCRULE).
Example 3:
For tax CalculationRules the shipping address and fulfillment center must match one of the TaxJurisdictionGroupCalculationRules (see TAXJCRULE).
IDENTIFIER INTEGER NOT NULL DEFAULT 1 Uniquely identifies this CalculationRule, along with its CalculationCode.
OPTCOUNTER SMALLINT Reserved for IBM internal use.

Indexes
Index Name Indexed Column Names Index Type
I0000058 CALCODE_ID+IDENTIFIER Unique Index
SQL060903235135760 CALRULE_ID Primary Key
I0000504 TAXCGRY_ID Non-Unique Index
I0000505 CALMETHOD_ID Non-Unique Index
I0000506 CALMETHOD_ID_QFY Non-Unique Index

Constraints
Constraint Name Column Names Foreign Table Name Foreign Column Names Constraint Type
F_169 CALCODE_ID CALCODE CALCODE_ID Cascade
F_171 CALMETHOD_ID_QFY CALMETHOD CALMETHOD_ID Cascade
F_172 CALMETHOD_ID CALMETHOD CALMETHOD_ID Cascade
F_170 TAXCGRY_ID TAXCGRY TAXCGRY_ID Cascade

Constraint Name Referenced Column Name Foreign Table Name Foreign Column Names Constraint Type
F_174 CALRULE_ID CALRULEMGP CALRULE_ID Cascade
F_280 CALRULE_ID CRULESCALE CALRULE_ID Cascade
F_751 CALRULE_ID SHPJCRULE CALRULE_ID Cascade
F_820 CALRULE_ID TAXJCRULE CALRULE_ID Cascade
Related reference