Hi,<br><br><div class="gmail_quote">On Sun, Oct 31, 2010 at 7:47 PM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</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;">
Is there a compelling reason for discarding the system that'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'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'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 <<a href="mailto:nirmal070125@gmail.com" target="_blank">nirmal070125@gmail.com</a>>:<br>
> Hi Laun,<br>
><br>
>> Consider that 5000+ is a large number. Estimate the time it'll take you<br>
>> to transform one rule: Will you be able to spend, say, 3 months for this<br>
>> task?<br>
><br>
> We've already developed a piece of code which does this conversion.<br>
> Following is an example.<br>
> Can you please comment on the converted rule? whether it is a valid drools<br>
> rule or not?<br>
><br>
> Our Rule<br>
> IF _psubj(be,$var0) ^ NOT date($var0) ^ NOT $var0=$Time THEN<br>
> ^1_Existence:Entity(be,$var0)<br>
><br>
> Converted Drools Rule<br>
> rule "0"<br>
> when p: Processor( eval(p.existence("_psubj(be,"+p.conceptVar[0]+")"))<br>
> && eval(!p.existence("date("+p.conceptVar[0]+")")) &&<br>
> eval(!p.testVar(p.conceptVar[0],"$Time")) )<br>
> then<br>
> eval(p.AppendRule(" ^1_Existence:Entity(be,"+p.conceptVar[0]+")"));<br>
> end<br>
><br>
><br>
><br>
> Thanks.<br>
>><br>
>> -W<br>
>><br>
>><br>
>> 2010/10/31 Nirmal Fernando <<a href="mailto:nirmal070125@gmail.com" target="_blank">nirmal070125@gmail.com</a>><br>
>>><br>
>>> Something like following 2 rules:<br>
>>><br>
>>> # IF when($Awareness,$var0) THEN ^1_Awareness:Time($Awareness,$var0)<br>
>>> # IF $relTime($Awareness,$Time) THEN ^1_Awareness:Time($Awareness,$Time)<br>
>>><br>
>>> thanks.<br>
>>><br>
>>> 2010/10/31 Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>><br>
>>>><br>
>>>> What, exactly, do you mean by "hand written"? Java statements? Another<br>
>>>> Rule System?<br>
>>>> Can you provide a sample?<br>
>>>><br>
>>>><br>
>>>> 2010/10/31 Nirmal Fernando <<a href="mailto:nirmal070125@gmail.com" target="_blank">nirmal070125@gmail.com</a>><br>
>>>>><br>
>>>>> Hi,<br>
>>>>><br>
>>>>> I am having a 5000+ hand written rules which is used in an open source<br>
>>>>> project.<br>
>>>>> I am searching for the reasons, me to be shifted to a rule engine like<br>
>>>>> Drools, instead of using hand written once.<br>
>>>>> Drools rules can be debugged that will be a plus point, isn't it? I<br>
>>>>> would love to get a list of benefits that I will be getting.<br>
>>>>><br>
>>>>> Thanks.<br>
>>>>><br>
>>>>> --<br>
>>>>> Best Regards,<br>
>>>>> Nirmal<br>
>>>>><br>
>>>>> C.S.Nirmal J. Fernando<br>
>>>>> Department of Computer Science & Engineering,<br>
>>>>> Faculty of Engineering,<br>
>>>>> University of Moratuwa,<br>
>>>>> Sri Lanka.<br>
>>>>> Blog: <a href="http://nirmalfdo.blogspot.com/" target="_blank">http://nirmalfdo.blogspot.com/</a><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>
>>>>><br>
>>>><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>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Best Regards,<br>
>>> Nirmal<br>
>>><br>
>>> C.S.Nirmal J. Fernando<br>
>>> Department of Computer Science & Engineering,<br>
>>> Faculty of Engineering,<br>
>>> University of Moratuwa,<br>
>>> Sri Lanka.<br>
>>> Blog: <a href="http://nirmalfdo.blogspot.com/" target="_blank">http://nirmalfdo.blogspot.com/</a><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>
>>><br>
>><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>
>><br>
><br>
><br>
><br>
><br>
> --<br>
> Best Regards,<br>
> Nirmal<br>
><br>
> C.S.Nirmal J. Fernando<br>
> Department of Computer Science & Engineering,<br>
> Faculty of Engineering,<br>
> University of Moratuwa,<br>
> Sri Lanka.<br>
> Blog: <a href="http://nirmalfdo.blogspot.com/" target="_blank">http://nirmalfdo.blogspot.com/</a><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>
><br>
><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 & 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>