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

"Unable to expand" error with acculumate in Guided Rule Editor with DSL

    XMLWordPrintable

Details

    • CR2
    • Hide

      See Description

      Show
      See Description

    Description

      In Guided Rule Editor with DSL option, you can add "From Accumulate" but "Function"/"Custom Code" gets an error "Unable to expand".

      Reproduce steps:

      • Unzip the attached reproducer-repo.zip
      • Clone the repo via business-central "Administration" > "Repositories" > "Clone Repository"
      • Go to Project Explorer, choose the repo, choose "project1"
      • Go to package org > kie > example > project1. You will find DataObject 'Person,' DSL, Test Scenario
      • Create a new Guided Rule. Check "Use Domain Specific Language (DSL)" option
      • Add conditions (See guidedrule01.png)
        • DSL "There is a person whose age is 20"
        • "From Accumulate ..."
          • Choose "Number" for the first "click to add pattern..."
          • Choose "Person" for the second "click to add pattern..."
          • Configure Variable name "$p" for "All Person with"
        • Write "count($p)" in Function
      • Save
      • Press "Validate"
      • You will get an error "Unable to expand" (See error01.png)

      This is because "count($p)" line doesn't have preceding ">".

      rule "gr1"
              dialect "mvel"
              when
                      There is a person whose age is 20
                      >Number( ) from accumulate ( $p : Person( ),
                              count($p))
              then
      end
      
      • If you add ">" at the begging of Function (See guidedrule02.png), you don't get the error.
      • But if you close the Editor and reopen the rdslr, the condition is rendered as free form DRL (See guidedrule03.png). So it cannot be a workaround.
      • "Custom Code" has the same problem as "Function". Furthermore, "Custom Code" cannot use ">" because ">" wouldn't be placed at the beginning of the line.

      Attachments

        1. error01.png
          error01.png
          112 kB
        2. guidedrule01.png
          guidedrule01.png
          122 kB
        3. guidedrule02.png
          guidedrule02.png
          126 kB
        4. guidedrule03.png
          guidedrule03.png
          120 kB
        5. reproducer-repo.zip
          88 kB

        Issue Links

          Activity

            People

              manstis@redhat.com Michael Anstis
              rhn-support-tkobayas Toshiya Kobayashi
              Jozef Marko Jozef Marko
              Jozef Marko Jozef Marko
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: