Hi,<br><br><div class="gmail_quote">On Sun, Oct 31, 2010 at 7:47 PM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</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;">

Is there a compelling reason for discarding the system that&#39;s in use now?<br></blockquote><div><br>Mainly due to difficulty in maintaining a hand written large amount of rules.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
It would appear that you are emulating the existing system&#39;s functions (_psubj,<br>
date, equality test) by some mechanism using reflection, which, in<br>
itself, will cause some<br>
overhead. Then, in the Drools rule, you are using eval(), which is the<br>
least efficient way of<br>
formulating a condition; none of the optimizations will work this way.<br>
This kind of<br>
transformation may result in a significant increase of execution time<br>
(which, of course, may not hurt you if there isn&#39;t much time spent in<br>
condition evaluation now.)<br>
<br>
The eval() call after then looks suspicious: is this a function you<br>
have defined?<br></blockquote><div><br>Not really, I think this is drools eval function.<br>Ok, let me ask you like this, if I give you the following rule, can you write an equivalent drools rule?<br><br>IF _psubj(be,$var0) ^ NOT date($var0) ^ NOT $var0=$Time THEN ^1_Existence:Entity(be,$var0)<br>
<br>Thanks for the great help!<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div><br>
<br>
<br>
<br>
<br>
<br>
2010/10/31 Nirmal Fernando &lt;<a href="mailto:nirmal070125@gmail.com" target="_blank">nirmal070125@gmail.com</a>&gt;:<br>
&gt; Hi Laun,<br>
&gt;<br>
&gt;&gt; Consider that 5000+ is a large number. Estimate the time it&#39;ll take you<br>
&gt;&gt; to transform one rule: Will you be able to spend, say, 3 months for this<br>
&gt;&gt; task?<br>
&gt;<br>
&gt; We&#39;ve already developed a piece of code which does this conversion.<br>
&gt; Following is an example.<br>
&gt; Can you please comment on the converted rule? whether it is a valid drools<br>
&gt; rule or not?<br>
&gt;<br>
&gt; Our Rule<br>
&gt; IF _psubj(be,$var0) ^ NOT date($var0) ^ NOT $var0=$Time THEN<br>
&gt; ^1_Existence:Entity(be,$var0)<br>
&gt;<br>
&gt; Converted Drools Rule<br>
&gt; rule &quot;0&quot;<br>
&gt;     when p: Processor( eval(p.existence(&quot;_psubj(be,&quot;+p.conceptVar[0]+&quot;)&quot;))<br>
&gt; &amp;&amp; eval(!p.existence(&quot;date(&quot;+p.conceptVar[0]+&quot;)&quot;)) &amp;&amp;<br>
&gt; eval(!p.testVar(p.conceptVar[0],&quot;$Time&quot;)) )<br>
&gt;     then<br>
&gt;         eval(p.AppendRule(&quot; ^1_Existence:Entity(be,&quot;+p.conceptVar[0]+&quot;)&quot;));<br>
&gt;     end<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thanks.<br>
&gt;&gt;<br>
&gt;&gt; -W<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2010/10/31 Nirmal Fernando &lt;<a href="mailto:nirmal070125@gmail.com" target="_blank">nirmal070125@gmail.com</a>&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Something like following 2 rules:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # IF when($Awareness,$var0) THEN ^1_Awareness:Time($Awareness,$var0)<br>
&gt;&gt;&gt; # IF $relTime($Awareness,$Time) THEN ^1_Awareness:Time($Awareness,$Time)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; thanks.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2010/10/31 Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; What, exactly, do you mean by &quot;hand written&quot;? Java statements? Another<br>
&gt;&gt;&gt;&gt; Rule System?<br>
&gt;&gt;&gt;&gt; Can you provide a sample?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; 2010/10/31 Nirmal Fernando &lt;<a href="mailto:nirmal070125@gmail.com" target="_blank">nirmal070125@gmail.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I am having a 5000+ hand written rules which is used in an open source<br>
&gt;&gt;&gt;&gt;&gt; project.<br>
&gt;&gt;&gt;&gt;&gt; I am searching for the reasons, me to be shifted to a rule engine like<br>
&gt;&gt;&gt;&gt;&gt; Drools, instead of using hand written once.<br>
&gt;&gt;&gt;&gt;&gt; Drools rules can be debugged that will be a plus point, isn&#39;t it? I<br>
&gt;&gt;&gt;&gt;&gt; would love to get a list of benefits that I will be getting.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Thanks.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; Best Regards,<br>
&gt;&gt;&gt;&gt;&gt; Nirmal<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; C.S.Nirmal J. Fernando<br>
&gt;&gt;&gt;&gt;&gt; Department of Computer Science &amp; Engineering,<br>
&gt;&gt;&gt;&gt;&gt; Faculty of Engineering,<br>
&gt;&gt;&gt;&gt;&gt; University of Moratuwa,<br>
&gt;&gt;&gt;&gt;&gt; Sri Lanka.<br>
&gt;&gt;&gt;&gt;&gt; Blog: <a href="http://nirmalfdo.blogspot.com/" target="_blank">http://nirmalfdo.blogspot.com/</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Best Regards,<br>
&gt;&gt;&gt; Nirmal<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; C.S.Nirmal J. Fernando<br>
&gt;&gt;&gt; Department of Computer Science &amp; Engineering,<br>
&gt;&gt;&gt; Faculty of Engineering,<br>
&gt;&gt;&gt; University of Moratuwa,<br>
&gt;&gt;&gt; Sri Lanka.<br>
&gt;&gt;&gt; Blog: <a href="http://nirmalfdo.blogspot.com/" target="_blank">http://nirmalfdo.blogspot.com/</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Best Regards,<br>
&gt; Nirmal<br>
&gt;<br>
&gt; C.S.Nirmal J. Fernando<br>
&gt; Department of Computer Science &amp; Engineering,<br>
&gt; Faculty of Engineering,<br>
&gt; University of Moratuwa,<br>
&gt; Sri Lanka.<br>
&gt; Blog: <a href="http://nirmalfdo.blogspot.com/" target="_blank">http://nirmalfdo.blogspot.com/</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>Nirmal<br><br>C.S.Nirmal J. Fernando<br>Department of Computer Science &amp; Engineering,<br>Faculty of Engineering,<br>University of Moratuwa,<br>

Sri Lanka.<div><br></div><div>Blog: <a href="http://nirmalfdo.blogspot.com/" target="_blank">http://nirmalfdo.blogspot.com/</a></div><br>