[rules-users] before/after behavior for negative pattern

Wolfgang Laun wolfgang.laun at gmail.com
Sun Sep 2 03:39:14 EDT 2012


@Mario: Could this be something in mvel2-2.1.0.drools16.jar?

With Drools 5.3.0, this works fine:

rule "Detect it"
when
    $start : RawEvent()
    not RawEvent(this != $start, id == $start.id, $start after[0ms, 90s]
this)
then
    System.out.println("detected: " + $start);
end

Moving on to 5.4.0, you get the error "Unable to Analyse Expression this !=
$start &&...", as reported previously by Rob.

@Rob: As a workaround, use
   not $re: RawEvent(eval($re != $start),...

(And I'd recommend using new Random( 12345 ) to obtain repeatable test
outputs.)

-W

On 1 September 2012 20:23, Rob21 <rob.perrez at gmail.com> wrote:

> I tried using FireAllRules each time i inserted an object instead of
> FireUntilHalt in another thread. Unfortunately it results in the same error
> message :
>
> Unable to Analyse Expression this != $start && after0.evaluate( $start,
> this
> ):
> [Error: unable to resolve method using strict-mode:
> com.sample.RawEvent.after0()]
> [Near : {... this != $start && after0.evaluate( $start, this ....}]
>              ^ : [Rule name='Detect it']
>
> java.lang.IllegalArgumentException: Could not parse knowledge.
>         at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:106)
>         at com.sample.DroolsTest.main(DroolsTest.java:54)
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/before-after-behavior-for-negative-pattern-tp4019497p4019503.html
> Sent from the Drools: User forum 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/20120902/2b01f042/attachment-0001.html 


More information about the rules-users mailing list