[jboss-jira] [JBoss JIRA] (DROOLS-645) Accumulate returned fact causing NPE
Mario Fusco (JIRA)
issues at jboss.org
Thu Nov 13 18:13:29 EST 2014
[ https://issues.jboss.org/browse/DROOLS-645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019923#comment-13019923 ]
Mario Fusco commented on DROOLS-645:
------------------------------------
Yes sorry, that's normal. The rule's consequence changes the campaignName of the currently bound StatusMessage, so after 3 firings the list is empty and it thorws the exception. Of course the test is wrong, but I wrote it that way only to prove that the modify was working as expected.
> 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