Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-5007

Casting int interim varible to short causes compilation error in executable model

XMLWordPrintable

      Casting int interim variable to short causes compilation error in the executable model. In non-executable model its working fine.

      This rule works:

      rule "rule1"
      when
          $address : Address( shortNumber == null ||  shortNumber == 0) 
      then
          $address.setShortNumber((short)$address.getNumber());
          update($address);
      end
      

      but when using an interim variable, the rule fails to compile due to incompatible types: java.lang.Integer cannot be converted to short:

      rule "rule1"
      when
          $address : Address( shortNumber == null ||  shortNumber == 0, 
                                 $interimVar : number) 
      then
          $address.setShortNumber((short)$interimVar);
          update($address);
      end
      

              lmolteni@redhat.com Luca Molteni
              rhn-support-mputz Martin Weiler (Inactive)
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: