[jboss-jira] [JBoss JIRA] (JBRULES-3279) Error message when using 2 patterns inside a single accumulate is not clear: Parser returned a null Package
Ansgar Konermann (JIRA)
jira-events at lists.jboss.org
Tue Nov 20 06:58:22 EST 2012
[ https://issues.jboss.org/browse/JBRULES-3279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735666#comment-12735666 ]
Ansgar Konermann edited comment on JBRULES-3279 at 11/20/12 6:58 AM:
---------------------------------------------------------------------
Workaround which works for the particular code above ("most_recent_commission_income"):
Replace:
{code}
not (exists (FYearlyIncome(ownedBy == $ownedBy, type == $type , year.index < $year.index, sustainable == $sustainable)))
{code}
by the following code snippet:
{code}
not FYearlyIncome(ownedBy == $ownedBy, type == $type , year.index < $year.index, sustainable == $sustainable)
{code}
Tested with Drools 5.4.0.Final.
was (Author: akonermann):
Workaround which works for the particular code above ("most_recent_commission_income"):
Replace:
{code}
not (exists (FYearlyIncome(ownedBy == $ownedBy, type == $type , year.index < $year.index, sustainable == $sustainable)))
{code}
by the following code snippet:
{code}
not FYearlyIncome(ownedBy == $ownedBy, type == $type , year.index < $year.index, sustainable == $sustainable)
{code}
> Error message when using 2 patterns inside a single accumulate is not clear: Parser returned a null Package
> -----------------------------------------------------------------------------------------------------------
>
> Key: JBRULES-3279
> URL: https://issues.jboss.org/browse/JBRULES-3279
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 5.3.0.Final
> Reporter: Geoffrey De Smet
> Assignee: Edson Tirelli
>
> I am trying to parse this rule:
> {code}
> 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
> {code}
> And I get this error message:
> {code}
> 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
> {code}
> For this line:
> {code}
> MrProcessAssignment(machine == $machine, process == $process),
> {code}
> 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:
> {code}
> 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
> {code}
> I get:
> {code}
> Exception in thread "main" org.drools.RuntimeDroolsException: BUG: Can't build a rete network with an inner OR group element
> {code}
> Don't really see the OR in there.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list