[rules-users] Fusion confusion
Chris Richmond
crichmond at referentia.com
Fri Jul 22 07:47:43 EDT 2011
I have attached my program project with my main FusionMain.java and two
small classes and my rule file Sample.drl.
It's a zip file i have modified to be .piz for mail server reasons.
In the Main I set up and run as STREAM mode session and execute on a
background thread .fireUntilHalt().
Then I inject two objects(DataReading and ConfigEvent)
The Sample.drl rule has the rules:
declare DataReading
@role( event )
end
declare ConfigEvent
@role( event )
end
rule "Detect high data reading"
when
$dr: DataReading(reading > 10.0) from entry-point "My Stream"
then
System.err.println("Data reading > 10");
end
rule "Wait for follup config"
lock-on-active
when
$dr: DataReading(reading > 10.0) from entry-point "My Stream"
not($de: ConfigEvent(this after[0s,10s] $dr))
then
System.err.println("Action");
end
rule "Detect config event"
when
$ce: ConfigEvent() from entry-point "My Stream"
then
System.err.println("Config Event");
end
What I expect is that I would see the DataReading rule fire right
away(it does)
then 5 seconds later when I insert the ConfigEvent I would see it's rule
fire(it does)
But the "Wait for follup config" rule fires no matter what.
To me, that rule should wait and make sure no ConfigEvent object was
inserted within 10 seconds after the DataReading object, but no matter
what that rule fires after 10 seconds. How can I make my inserted
ConfigEvent(inserted within the 10 seconds) satisfy that condition so it
cancels that rule from firing? I am using the latest download from the
site (5.2.0 final) binaries.
Does Fusion in fact work or am I doing something wrong? The zip file
has the entire runnable program and project(have to modify lib
references to point to correct Drools 5.2 binaries).
If the zip file does not come through I will attach the files
individually next.
Thanks,
Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DroolsProject.piz
Type: application/octet-stream
Size: 3524 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20110722/847b1837/attachment.obj
More information about the rules-users
mailing list