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

Error message when using 2 patterns inside a single accumulate is not clear: Parser returned a null Package

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
    • None
    • 5.3.0.Final
    • None
    • None

    Description

      I am trying to parse this rule:

      rule "machineUsage"
          when
              $machineCapacity : MrMachineCapacity($machine : machine, $resource : resource)
              $usageTotal : Number() from accumulate(
                      MrProcessRequirement(resource == $resource, $process : process, $usage : usage)
                      MrProcessAssignment(machine == $machine, process == $process),
                  sum($usage)
              )
          then
              ...
      end
      

      And I get this error message:

        Exception in thread "main" java.lang.IllegalStateException: There are errors in the scoreDrl's:[47,77]: [ERR 102] Line 47:77 mismatched input ',' in rule "machineUsage"
      [0,0]: Parser returned a null Package
      

      For this line:

                      MrProcessAssignment(machine == $machine, process == $process),
      

      It clear that it's because I can't use 2 patterns inside a single accumulate, but the error message seems wrong?

      When I try this instead:

      rule "machineUsage"
          when
              $machineCapacity : MrMachineCapacity($machine : machine, $resource : resource)
              $usageTotal : Number() from accumulate(
                      (MrProcessRequirement(resource == $resource, $process : process, $usage : usage)
                      and MrProcessAssignment(machine == $machine, process == $process)),
                  sum($usage)
              )
          then
              ...
      end
      

      I get:

        Exception in thread "main" org.drools.RuntimeDroolsException: BUG: Can't build a rete network with an inner OR group element
      

      Don't really see the OR in there.

      Attachments

        Activity

          People

            etirelli@redhat.com Edson Tirelli
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              PagerDuty