[jboss-jira] [JBoss JIRA] (DROOLS-586) Drools doesn't calculate maximum expiration time properly

kairat kushaev (JIRA) issues at jboss.org
Fri Aug 29 06:16:01 EDT 2014


kairat kushaev created DROOLS-586:
-------------------------------------

             Summary: Drools doesn't calculate maximum expiration time properly
                 Key: DROOLS-586
                 URL: https://issues.jboss.org/browse/DROOLS-586
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
         Environment: Linux, Java SE 1.7
            Reporter: kairat kushaev
            Assignee: Mark Proctor
             Fix For: 6.1.0.Final


Hello guys,
we found some contradiction between actual Drools behaviour,
We use the following Rule:
import com.opensoft.mom.domain.Event;
import java.util.List;
import java.util.ArrayList;
import com.opensoft.mom.domain.MessageModelMap;
global com.opensoft.mom.service.actions.Actions actions;
dialect  "mvel"
declare Event
@role(event)
@expires(10m)
end
rule "ExampleRule"
when
((($Time_delay_order:Event((this.isBelongToEventFormat(38)) && (this.getComparableStringValue("XXXXX") == Event.getDecodedString("ok")))))and(($Time_delay_submit:Event((this.isBelongToEventFormat(39)) && (this.getComparableStringValue("XXXXXX") == Event.getDecodedString("ok")) && (this after[1ms,0h15m20s] $Time_delay_order)))))
then
 List recipients0 = new ArrayList();
recipients0.add(Event.getDecodedString("XXXXXXXXXX at gmail.com"));
MessageModelMap template0 = new MessageModelMap();
template0.setValue("XXXXXXXXXX", $Time_delay_order.getComparableStringValue("XXXXX"));
template0.setValue("XXXXXXXXXX", $Time_delay_order.getComparableStringValue("XXXXX"));
String subject0 =  Event.getDecodedString("");
actions.sendMail(recipients0, subject0, 14, template0);

end
In the code above Drools should wait for the second rule when the first rule has fired. But it turns out that Drools doesn't wait for the second Rule because of @expires tag. The value in this tag is less than this after value.
According to documentation
"The engine will make this analysis for the whole rulebase and find the offset for every event type. Whenever an implicit expiration offset clashes with the explicit expiration offset, then engine will use the greater of the two."
but it is not calculating maximal expiration offset.
Also we turned on STREAM mode.
Could you please clarify the situation?



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jboss-jira mailing list