[jboss-jira] [JBoss JIRA] (DROOLS-645) Accumulate returned fact causing NPE

Roger Lefebvre (JIRA) issues at jboss.org
Wed Nov 12 14:02:29 EST 2014


    [ https://issues.jboss.org/browse/DROOLS-645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019520#comment-13019520 ] 

Roger Lefebvre commented on DROOLS-645:
---------------------------------------

Concerning the bug in the accumulator class, you are correct. The version I had working with the list was cast as you have shown. 
Based on the rule you have defined, it should have worked. That said, I have yet to test it on my platform. I will report back once that is done.
Regardless of the outcome, I will use the approach you suggested to eliminate the accumulator. In writing the rule, I kept saying to myself there had to be a simpler way. Still a bit green with formulating rules. It would be nice to have a drools page with practical rule suggestions that an audience can add to.

> Accumulate returned fact causing NPE
> ------------------------------------
>
>                 Key: DROOLS-645
>                 URL: https://issues.jboss.org/browse/DROOLS-645
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 6.2.0.Beta2
>         Environment: Mac OSX (maverick)
>            Reporter: Roger Lefebvre
>            Assignee: Mario Fusco
>         Attachments: RetryOldestCallTimeAccumulateFunction.java, RetryOldestCallTimeAccumulateFunction.java
>
>
> The issue is discussed in https://groups.google.com/forum/?hl=en-GB#!topic/drools-usage/aZU5mXSgHMI.
> Here is the gist of it....
> I changed the accumulator to the following and it worked:
> accumulate($sm:StatusMessage(campaignName==$campaign.campaignName, status==ManagerCallState.CALLER_FAILURE, attempts<3, sent==true), $message:oldestRetry( $sm ))  
> The previous approach was this:
> $message:StatusMessage() from accumulate($sm:StatusMessage(campaignName==$campaign.campaignName, status==ManagerCallState.CALLER_FAILURE, attempts<3, sent==true), oldestRetry( $sm ))
> which I thought was the correct or acceptable syntax option. Is there something I have overlooked in the second one ("from"??). It does give me a StatusMessage object but it lacks the underlying properties to allow the subsequent modify to work.



--
This message was sent by Atlassian JIRA
(v6.3.8#6338)


More information about the jboss-jira mailing list