0

I am working on making a CEP using Drools Fusion. I have two classes of events ExpectedEvent and ActualEvent. I need to make sure ActualEvent objects occur before ExpectedEvent objects. However, I cannot get the before key word to work. This is in stream mode.

import hellodrools.ExpectedEvent
import hellodrools.ActualEvent

dialect "java"

rule "On Time"

when
    ExpectedEvent($expectedtime : getStart_time()) from entry-point entry one
    $actual:ActualEvent( this after[ 1m ] $expected ) from entry-point entryone

then

    System.out.println("ON TIME expected time: " + $expectedtime + " actual time " + $actualtime);

end

In IntelliJ I keep getting errors on $actual saying '$actual' unexpected. I cannot solve this syntax error.

1 Answers1

0

I don't think this is related to IntelliJ, although IntelliJ here appears not be reporting the correct error.

I believe the actual problem here is that from entry-point expects a String literal or a valid identifier, which will be used for the entry point ID (which is a String)

In your rule the "entry one" is not a valid identifier because it contains a space, and it's not a String literal because it's not enclosed in double-quotes characters (").

You can try replacing from entry-point entry one

with from entry-point "entry one"

tarilabs
  • 2,178
  • 2
  • 15
  • 23