[rules-users] CEP Rule Help Needed

Edson Tirelli tirelli at post.com
Tue Jul 21 15:35:29 EDT 2009


   Your rule is wrong, as you are defining 3 patterns and the second pattern
is looking for a fact in the main entry point, not your defined
"MyEntryPoint".
   Fix it doing:

$s2 : MyModel ( name != "aaa" , id != $s1.id, ip == $s1, this after [0m,5m]
$s1) from entry-point "MyEntryPoint"

   []s
   Edson

2009/7/21 nestabur <nestabur at gmail.com>

>
> Hi all,
>
> I'm getting crazy trying to create a CEP rule in droos 5.0.1 :(
>
> The rule is:
> ===============
> rule "RetractOlderFacts"
>        dialect "mvel"
>        when
>                $s1 : MyModel( name != "aaa") from entry-point
> "MyEntryPoint"
>                $s2 : MyModel ( name != "aaa" , id != $s1.id, ip == $s1)
> and MyModel (
> this after [0m,5m] $s1) from entry-point "MyEntryPoint"
>        then
>                retract($s2);
>                System.out.println(" ********* Retracting from WM");
> end
> ===============
>
> The scenario is:
> "After receiving a fact "MyModel" wich name != "aaa", if arrives another
> with same ip and different id after a period between 0 and 5 minutes the
> rule have to retract the last one and keep the first fact (the older one)"
>
> After receiving hundred and hundred of facts via JMS that may match with
> the
> rule condition, the rule never throws!
>
> is the rule correct?
> could the problem be at the rule engine implementation?
>
> Could anyone hel me please?
>
> Thanks in advance,
>
> nestabur
> --
> View this message in context:
> http://www.nabble.com/CEP-Rule-Help-Needed-tp24591289p24591289.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090721/a09cfcce/attachment.html 


More information about the rules-users mailing list