Try this out : <a href="http://sourceforge.net/projects/droolsruleedit">http://sourceforge.net/projects/droolsruleedit</a> . It's in early development stage, but it might help you.<br><br><div><span class="gmail_quote">
On 4/5/07, <b class="gmail_sendername"><a href="mailto:John.Tal@gxs.com">John.Tal@gxs.com</a></b> <<a href="mailto:John.Tal@gxs.com">John.Tal@gxs.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
<div lang="EN-US" link="#0000ff" vlink="#800080"><div><p><font size="2" face="Courier New"><span style="font-size: 10pt">Drools developers,</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">In our specific use case we have customers who need to be able to write validation rules and NOT have to resort to writing them in Java. Hence our interest in using drools as an open source 'standard' to potentially replace a proprietary rules engine we already have.
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">In the previous case I mentioned where I want to do this:
</span></font></p><span class="q"><p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *rule* "UCCnet_DVE_Depth_All"
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *when*</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> catalogObject : CatalogObject( )
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> String s = catalogObject.getElementValue("depth");</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
> *eval*( s == *null* || s == "" )</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *then*</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
> logWriter.logDebug("Package Depth is Blank");</span></font></p></span><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *end*</span></font></p><p><font size="2" face="Courier New">
<span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">This is because potentially, in our use for data validation, there might be 50 values we need to compare against. Those values need to be on the drools (not java) side of the world. So getting the result of
catalogObject.getElementValue("depth") into a String variable and being able to use String methods like indexOf or multiple || cases is much more desirable than crossing from the rule back into the object by having to call getElementValue 50 times. There are numerous, other cases, where the result of
catalogObject.getElementValue need to be saved into a local drools variable and evaluated multiple times without encurring the overhead of multiple calls back into java.</span></font></p><p><font size="2" face="Courier New">
<span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">Please consider enhancing drl syntax to support this use case. Is there a bug/enhancement process for me to follow to submit this functionality request.
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">Thanks</span></font></p><p><font size="2" face="Courier New">
<span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">John</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font></p>
<p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">Date: Thu, 5 Apr 2007 16:47:07 +1000</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">From: "Michael Neale" <
<a href="mailto:michael.neale@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">michael.neale@gmail.com</a>></span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
Subject: Re: [rules-users] RE: Need DRL authoring Help</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">To: "Rules Users List" <<a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rules-users@lists.jboss.org</a>></span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">Message-ID:</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt"> <
<a href="mailto:96ab3ced0704042347s130a4b46ma4a5b74fb45ef0d4@mail.gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">96ab3ced0704042347s130a4b46ma4a5b74fb45ef0d4@mail.gmail.com</a>></span>
</font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">Content-Type: text/plain; charset="iso-8859-1"</span></font></p><div><span class="e" id="q_111c1f175564a621_3"><p><font size="2" face="Courier New">
<span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">OK you are really bending what you would use rules for, I really wouldn't recommend that. flattening the object model would allow you to write rules over it, but as it stands, its just going to be a bit difficult for you.
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font><font size="2" face="Courier New">
<span lang="FR" style="font-size: 10pt">catalogObject : CatalogObject( )</span></font></p><p><font size="2" face="Courier New"><span lang="FR" style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New">
<span lang="FR" style="font-size: 10pt"> *eval*( catalogObject.getElementValue("depth") == *null* ||</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">catalogObject.getElementValue
("depth") == "" )</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt"> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">On 4/5/07, <a href="mailto:John.Tal@gxs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
John.Tal@gxs.com</a> <<a href="mailto:John.Tal@gxs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">John.Tal@gxs.com</a>> wrote:</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> Ok, Thanks for the help on the drl syntax.</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> So this works.</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> </span></font></p><p><font size="2" face="Courier New">
<span style="font-size: 10pt">> *rule* "UCCnet_DVE_Depth_All"</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *when*</span></font></p><p><font size="2" face="Courier New">
<span style="font-size: 10pt">> catalogObject : CatalogObject( )</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *eval*( catalogObject.getElementValue("depth") == *null* ||
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> catalogObject.getElementValue("depth") == "" )</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
> *then*</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> logWriter.logDebug("Package Depth is Blank");</span></font></p><p><font size="2" face="Courier New">
<span style="font-size: 10pt">> *end*</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> But how do I get the drl parser to accept something like this:
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *rule* "UCCnet_DVE_Depth_All"</span>
</font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *when*</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> catalogObject : CatalogObject( )
</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> String s = catalogObject.getElementValue("depth");</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
> *eval*( s == *null* || s == "" )</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *then*</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">
> logWriter.logDebug("Package Depth is Blank");</span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> *end*</span></font></p><p><font size="2" face="Courier New">
<span style="font-size: 10pt">> </span></font></p><p><font size="2" face="Courier New"><span style="font-size: 10pt">> I am getting an Unexpected token 's' InvalidRulePackage</span></font></p><p><font size="2" face="Arial">
<span style="font-size: 10pt; font-family: Arial"> </span></font></p></span></div></div></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br><br></blockquote></div><br>