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

    • CR2
    • Hide

      See Description

      Show
      See 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.

        1. error01.png
          112 kB
          Toshiya Kobayashi
        2. guidedrule01.png
          122 kB
          Toshiya Kobayashi
        3. guidedrule02.png
          126 kB
          Toshiya Kobayashi
        4. guidedrule03.png
          120 kB
          Toshiya Kobayashi

            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

              Created:
              Updated:
              Resolved: