@FrankVhh<br><br>Entry-points are used with CEP; you&#39;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">&lt;<a href="mailto:frank.vanhoenshoven@agserv.eu">frank.vanhoenshoven@agserv.eu</a>&gt;</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 &quot;from entry-point&quot;, 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 &quot;true&quot; sensor. The way I would put this is like this:<br>
<br>
rule &quot;Myrule&quot;<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>
    - &quot;;&quot; is usually not needed in a LHS, I am not familiar with the from<br>
entry-point syntax, but I assume it wouldn&#39;t be needed<br>
    - There is a &quot;)&quot; in excess in one of your conditions<br>
<br>
3) I don&#39;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>
&gt;<br>
&gt; To keep it short, I have three sensors providing me some values every x<br>
&gt; seconds. I am running an algorithm over those values and getting at the<br>
&gt; end a single value for each sensor. Next I check if this value is<br>
&gt; greater/less than a threshold value and creating an object and setting its<br>
&gt; booelan value to true/false. The last part looks like this:<br>
&gt;<br>
&gt; SensorEvent sensorEvent = new SensorEvent ();<br>
&gt;               sensorEvent.setBoolean(booleanValue);<br>
&gt;               sensorEvent.setSensorID(sensorID);<br>
&gt;<br>
&gt; I want to do some actions if one of the sensors has &quot;true&quot; and this works.<br>
&gt; But I want no action if all sensors have &quot;true&quot;. And this part doens&#39;t<br>
&gt; work. If I only check one of the sensors if it is &quot;false&quot; it is ok but the<br>
&gt; combination doesn&#39;t work. It means this case seems naver to happen. No<br>
&gt; exception or error but no system print either. Here is the code snippet<br>
&gt; from my rules file:<br>
&gt;<br>
&gt; declare SensorEvent<br>
&gt;       @role(event)<br>
&gt; end<br>
&gt;<br>
&gt;<br>
&gt; rule &quot;All false&quot;<br>
&gt;<br>
&gt;       when<br>
&gt;               #conditions<br>
&gt;               sensorEvent1    : SensorEvent(sensorID == 1 , booleanValue == false)    from<br>
&gt; entry-point &quot;Default&quot;;<br>
&gt;               sensorEvent2    : SensorEvent(sensorID == 5 , booleanValue == false) )  from<br>
&gt; entry-point &quot;Default&quot;;<br>
&gt;               sensorEvent3    : SensorEvent(sensorID == 6 , booleanValue == false)    from<br>
&gt; entry-point &quot;Default&quot;;<br>
&gt;<br>
&gt;       then<br>
&gt;               #actions<br>
&gt;               System.out.println(&quot; All false!! -&gt; &quot;);<br>
&gt;<br>
&gt; end<br>
&gt;<br>
&gt;<br>
&gt; I run the engine in stream mode and every single value (or object) is<br>
&gt; being inserted after I receieved the value. I also tried this variant but<br>
&gt; it didn&#39;t work either:<br>
&gt;<br>
&gt; rule &quot;All false&quot;<br>
&gt;<br>
&gt;       when<br>
&gt;               #conditions<br>
&gt;               sensorEvent1    : SensorEvent(sensorID == 1 )   from entry-point &quot;Default&quot;;<br>
&gt;               sensorEvent2    : SensorEvent(sensorID == 5 )   from entry-point &quot;Default&quot;;<br>
&gt;               sensorEvent3    : SensorEvent(sensorID == 6 , booleanValue == false &amp;&amp;<br>
&gt; sensorEvent1.booleanValue == false &amp;&amp; sensorEvent2.booleanValue == false))<br>
&gt; from entry-point &quot;Default&quot;;<br>
&gt;<br>
&gt;       then<br>
&gt;               #actions<br>
&gt;               System.out.println(&quot; All false!! -&gt; &quot;);<br>
&gt;<br>
&gt; end<br>
&gt;<br>
&gt; Any suggestions?<br>
&gt;<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>