Uploaded image for project: 'Guvnor'
  1. Guvnor
  2. GUVNOR-2013

Snapshot source (drl) has quotes around numeric/integer objects

    Details

      Description

      Model object vehicle.java (imported in ecd.jar) has numerous Integer objects that when the snapshot is created it is treating them as if the are string objects.

      Were are upgrading Guvnor 5.2.0, which treated the integers correctly, to 5.5.0

      Example - statedAmount is an integer yet is has been quoted as if it is a string:

      rule "BR-Motorhome Stated Amount Over $50,000 and Less Than $250,001-UND(New Business)1645"
      agenda-group "BR_NewBusiness"
      dialect "mvel"
      when
      vehicle : Vehicle( type == "VM" , statedAmount > "50000" && <= "250000" , unitAtRiskNumber : unitAtRiskNumber)
      then
      WorkItemReason fact0 = new WorkItemReason();

      ...
      Here is the declaration for statedAmount in Vehicle.java
      private IntegerHistory statedAmountHistory = new IntegerHistory();

      Here is the getter method in Vehicle.java for statedAmount

      • Getter for current StatedAmount history value
        *
      • @return Integer
        */
        public Integer getStatedAmount() { return this.getStatedAmountHistory().getValue(); }

        /**

      Here is the IntegerHistory.java object code:
      public class IntegerHistory extends FieldHistory {

      /**

      • Constructor for IntegerHistory
      • @return com.fbfs.pc.ecd.model.types.IntegerHistory
        */
        public IntegerHistory() { super(); }

        /**

      • Get the current value for this field
      • @return java.lang.Integer
        */
        public Integer getValue() { return (Integer) this.getCurrentObject(); }

        /**

      • Get the previous value for this field.
      • @return java.lang.Integer
        */
        public Integer getPreviousValue() { return (Integer) this.getPreviousObject(); }

        /**

      • Set current value for this field, by moving existing value to previous and setting new current value
      • @return java.lang.Integer
        */
        public void setValue(Integer value) { setPreviousObject(getCurrentObject()); setCurrentObject(value); }

      int getChangeAmount() {
      if (getCurrentObject() == null || getPreviousObject() == null)

      { return 0; }

      return getValue() - getPreviousValue();
      }
      boolean isDecreased()

      { return getChangeAmount() < 0; }

      boolean isIncreased()

      { return getChangeAmount() > 0; }

      }
      ....

      here is the

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nhenggeler Nancy Henggeler
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: