Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1905

Arithmetic operation with String coercion in constraint fails in executable-model

    XMLWordPrintable

Details

    • False
    • None
    • False
    • CR1
    • +
    • +
    • 2022 Week 17-19 (from Apr 25), 2022 Week 20-22 (from May 16), 2022 Week 26-28 (from Jun 27), 2022 Week 29-31 (from Jul 18)

    Description

      rule R1
      dialect "mvel"
      when
        StrBdHolder($str: str, bd == $str * -1)
      then
      end
      

      Fails with

      The operator * is undefined for the argument type(s) String, int
      

      generated code

      public enum LambdaExtractorA01091D610A021769F6F9F5A86246BC8 implements org.drools.model.functions.Function1<java.lang.String, java.lang.Object>, org.drools.model.functions.HashedExpression {
         ...
          @Override()
          public java.lang.Object apply(java.lang.String $str) {
              return $str * -1;
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-hmiura Hiroko Miura
              Daniel Rosa Daniel Rosa
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: