Class CalculationRuleCalculateCmdImpl

  • All Implemented Interfaces:
    BusinessPolicyCommand,, ECCommand, ECTargetableCommand, TaskCommand, CalculationCmd, CalculationRuleCalculateCmd,,,,,,

    public class CalculationRuleCalculateCmdImpl
    extends CalculationCmdImpl
    implements CalculationRuleCalculateCmd

    The default implementation of CalculationRuleCalculateCmd.

    Its behaviour is as follows:

    1. identifies the calculation scales associated with the calculation rule (see CRULESCALE).
    2. groups the calculation scales by currency (see CALSCALE.SETCCURR).
    3. if there are ones in the currency specified, discards the others.
    4. for each calculation scale, calculates its values:
      1. invokes the calculation method of type "CalculationScaleLookup" referenced by the calculation scale (see CALSCALE.CALMETHOD_ID, CalculationScaleLookupCmd) to determine the following:
        • a lookup number.
        • a base monetary value.
        • a result multiplier.
        • a mathematical weight for each item.
      2. identifies the calculation ranges of the calculation scale where (range start <= lookup number).
      3. for each calculation range, in descending order of range start:
        1. determines the applicable lookup number. It is (max(lookup number, range end) - range start) if the calculation range is cumulative (see CALRANGE.CUMULATIVE). Or max(lookup number, range end) if not.
        2. invokes the calculation method of type "CalculationRange" referenced by the calculation range (see CALRANGE.CALMETHOD_ID, CalculationRangeCmd) to calculate the resulting value.
        3. multiplies this value by the result multiplier.
        4. adds this value to a total value.
        5. breaks if the calculation range is not cumulative.
      4. distributes the total value among the items based on their mathematical weights.
      5. applies the direct attachments associated with the calculation rule.
    5. for each group of calculation scales, merges the lists of resulting values.
    6. select the merged list that has the lowest total value.

    Commands used:

    Access beans used:

    See Also:
    Serialized Form
    • Field Detail


        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CalculationRuleCalculateCmdImpl

        public CalculationRuleCalculateCmdImpl()
        Constructor for CalculationRuleCalculateCmdImpl.