@FrankVhh<br><br>Entry-points are used with CEP; you'll find details in the Fusion documetation.<br><br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote">On 7 April 2011 15:21, FrankVhh <span dir="ltr"><<a href="mailto:frank.vanhoenshoven@agserv.eu">frank.vanhoenshoven@agserv.eu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Sariman,<br>
<br>
The trick with "from entry-point", is quite unfamiliar to me. There might be<br>
some problem with that, but I cannot tell by looking at it.<br>
<br>
However, there are a few problems with the rules that you have printed out<br>
for us.<br>
<br>
1) The way I understand it, they do not do what they should be doing. You<br>
said you do NOT want an action when all sensors evaluate to true. In your<br>
case, you are evaluateing whether all sensors are false. This is pretty<br>
useless if you already have a rule which evaluates the existence of at least<br>
1 "true" sensor. The way I would put this is like this:<br>
<br>
rule "Myrule"<br>
when<br>
#conditions<br>
sensorEvent1: SensorEvent(booleanValue == true)<br>
exists( SensorEvent(booleanValue == false) )<br>
then<br>
#actions<br>
end<br>
<br>
2) There are some errors in your rule. No idea whether this is a copy/paste<br>
or a read/type, so I will just point them out.<br>
- ";" is usually not needed in a LHS, I am not familiar with the from<br>
entry-point syntax, but I assume it wouldn't be needed<br>
- There is a ")" in excess in one of your conditions<br>
<br>
3) I don't think it makes sense to put your rules as you did in the second<br>
example. Even if you are trying to examine whether those three sensors are<br>
false.<br>
<br>
On a personal note: what does from entry-point do? I must have overlooked it<br>
in the documentation.<br>
<br>
Regards,<br>
Frank<br>
<br>
<br>
sariman wrote:<br>
><br>
> To keep it short, I have three sensors providing me some values every x<br>
> seconds. I am running an algorithm over those values and getting at the<br>
> end a single value for each sensor. Next I check if this value is<br>
> greater/less than a threshold value and creating an object and setting its<br>
> booelan value to true/false. The last part looks like this:<br>
><br>
> SensorEvent sensorEvent = new SensorEvent ();<br>
> sensorEvent.setBoolean(booleanValue);<br>
> sensorEvent.setSensorID(sensorID);<br>
><br>
> I want to do some actions if one of the sensors has "true" and this works.<br>
> But I want no action if all sensors have "true". And this part doens't<br>
> work. If I only check one of the sensors if it is "false" it is ok but the<br>
> combination doesn't work. It means this case seems naver to happen. No<br>
> exception or error but no system print either. Here is the code snippet<br>
> from my rules file:<br>
><br>
> declare SensorEvent<br>
> @role(event)<br>
> end<br>
><br>
><br>
> rule "All false"<br>
><br>
> when<br>
> #conditions<br>
> sensorEvent1 : SensorEvent(sensorID == 1 , booleanValue == false) from<br>
> entry-point "Default";<br>
> sensorEvent2 : SensorEvent(sensorID == 5 , booleanValue == false) ) from<br>
> entry-point "Default";<br>
> sensorEvent3 : SensorEvent(sensorID == 6 , booleanValue == false) from<br>
> entry-point "Default";<br>
><br>
> then<br>
> #actions<br>
> System.out.println(" All false!! -> ");<br>
><br>
> end<br>
><br>
><br>
> I run the engine in stream mode and every single value (or object) is<br>
> being inserted after I receieved the value. I also tried this variant but<br>
> it didn't work either:<br>
><br>
> rule "All false"<br>
><br>
> when<br>
> #conditions<br>
> sensorEvent1 : SensorEvent(sensorID == 1 ) from entry-point "Default";<br>
> sensorEvent2 : SensorEvent(sensorID == 5 ) from entry-point "Default";<br>
> sensorEvent3 : SensorEvent(sensorID == 6 , booleanValue == false &&<br>
> sensorEvent1.booleanValue == false && sensorEvent2.booleanValue == false))<br>
> from entry-point "Default";<br>
><br>
> then<br>
> #actions<br>
> System.out.println(" All false!! -> ");<br>
><br>
> end<br>
><br>
> Any suggestions?<br>
><br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools-drools-expert-drools-fusion-guvnor-drools-planner.46999.n3.nabble.com/Combination-of-conditions-doesn-t-work-tp2789735p2790446.html" target="_blank">http://drools-drools-expert-drools-fusion-guvnor-drools-planner.46999.n3.nabble.com/Combination-of-conditions-doesn-t-work-tp2789735p2790446.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>