Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1632

DSL expander can't add a field constraint to a fact when a previous field constraint has parentheses

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • FUTURE
    • 4.0.7
    • drools-compiler-DSL
    • None

    Description

      I have made a little example to reproduce the problem.

      Let us assume we have a very simple Wine class...
      public class Wine {
      private int age;
      private String type;
      private String country;
      private String vineyard;
      ....

      I define the following in my DSL:

      [condition][]Il existe un vin "

      {i}"={i}

      : Wine()
      [condition][]- plus vieux que "

      {y}"=age > {y}

      [condition][]- du crû "

      {c}"=vineyard == "{c}

      "

      In the following rule, I can't add the last field constraint when the age of the prvious one is
      "($y + 10)"

      rule "Very Old Wine"

      when
      #conditions

      1. there is a wine 10 years older than a person
        > Person($y : age)
        Il existe un vin "$v"
      • plus vieux que "($y + 10)"
      1. - plus vieux que "$y"
      • du crû "Nuits-Saint-Georges"
        then
        #actions

      End

      Attachments

        Issue Links

          Activity

            People

              etirelli@redhat.com Edson Tirelli
              pdeswert Pierre De Swert (Inactive)
              Archiver:
              rhn-support-ceverson Clark Everson

              Dates

                Created:
                Updated:
                Archived:

                PagerDuty