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

newline within the rule cell of spreadsheet is included as a value incorrectly

    XMLWordPrintable

    Details

    • Sprint:
      2019 Week 47-49 (from Nov 18)
    • Steps to Reproduce:
      Hide

      run attached reproducer by 'mvn clean test'

      Show
      run attached reproducer by 'mvn clean test'
    • Affects:
      Compatibility/Configuration
    • Workaround Description:
      Hide

      If double quotes is set in rule cell instead of template like the following, this can be avoided.

      • template (BAD)
        map["$1"] $2,
        map["$3"],$4
      • rule cell (BAD)
        Key1, == var1,
        Key2, == var2
      • template (GOOD)
        map[$1] $2,
        map[$3],$4
      • rule cell (GOOD)
        "Key1", == var1,
        "Key2", == var2
      Show
      If double quotes is set in rule cell instead of template like the following, this can be avoided. template (BAD) map ["$1"] $2, map ["$3"] ,$4 rule cell (BAD) Key1, == var1, Key2, == var2 template (GOOD) map [$1] $2, map [$3] ,$4 rule cell (GOOD) "Key1", == var1, "Key2", == var2
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      When there is new line in rule cell with specific condition, new line('\n') is included as a value.

      Here is generated problematic DRL.

      rule "newlineInCell_11"
      when
      m:Message(map["Key1"]  == var1,
      map["\nKey2"]  == var2)                     <== HERE                   
      then
      System.out.println(m.getMessage());
      m.setMessage("Goodbye cruel world");
      m.setStatus(Message.GOODBYE);
      end
      

      This does happen with 7.26.0.Final(RHDM7.5.0), but not with 7.23.0.Final(7.4.x).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mfusco@redhat.com Mario Fusco
              Reporter:
              rhn-support-hmiura Hiroko Miura
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: