I still think, in my opinion, it is worthwhile adding the ability to define Template Keys in DSL in Guvnor.<br><br>A simple (contrived and incomplete example) DSL might be:-<br><br>[when] There is an insurance policy quote=$p : PolicyQuote( )<br>
[when] Number of previous claims on policy is between {min} and {max}=ClaimHistory( quote == $p, numberOfClaims >= {min}, numberOfClaims < {max} )<br>[then] Set insurance premium load factor to {loadFactor} = $p.setLoadFactor( {loadFactor} );<br>
<br>A user might like to define rules using DSL for the following data set:-<br><br>0 <= claims < 1, load = 0<br>1 <= claims < 3, load = 10%<br>3 <= claims < 5, load = 15%<br>etc.<br>
<br>This can be accomplished with a Template or Decision Table using DRL terms but as yet, in Guvnor, not DSL.<br><br>Obviously it can be achieved from a developers perspective using Drools Expert as demonstrated.<br><br>
With kind regards,<br><br>Mike<br><br><div class="gmail_quote">2012/1/10 Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Frank,<br><br>thanks for your follow-up. <br><br>As much as I like source code generators, I must confess that I've come to dislike the generation of many almost identical chunks, e.g., varying only in literals.<br>
<br>This means that using templates without an "if" in the available macro language is a "weak" tool. Consequently, this triple layering isn't on my "tops" list. <br><br>Basically, I agree with your assessment, the only caveat being the level of complexity and extend that is convenient to achieve with a DSL.<br>
<br>Regards<span class="HOEnZb"><font color="#888888"><br>Wolfgang</font></span><div class="HOEnZb"><div class="h5"><br><br><br><div class="gmail_quote">On 9 January 2012 17:08, FrankVhh <span dir="ltr"><<a href="mailto:frank.vanhoenshoven@agserv.eu" target="_blank">frank.vanhoenshoven@agserv.eu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Hi,<br>
<br>
Sorry to have kept you waiting.<br>
<br>
If you use plain DRL, you have 1 source of information. If you use DSL, you<br>
add an extra source of information by inserting the data in it. Adding DSL<br>
on top of that, adds a third source of information in the form of a<br>
vocabulary.<br>
<br>
In theory, the more disperse your information, the more difficult it will be<br>
to maintain.<br>
<br>
Until now, I debugged all templates in the same way. Expand them all<br>
completely and have them outputted to a real DRL file. Than, debug the<br>
outputted file and make corrections in your template accordingly. Here,<br>
imho, there is not much difference in a DSLR template and a DRL template,<br>
provided that you have a stable DSL. This is not a debugging method that I<br>
particullary like, but it gets the job done.<br>
<br>
If you assess the difference between a DSLR and a DRL template, the only<br>
differentiator is the DSL. In that case it comes down to the question<br>
whether you have a stable DSL or not. If your DSL is mature, I would prefer<br>
DSLR over DRL for reasons of understandability to non-technical users.<br>
Unless your template is meant to be hidden from the user.<br>
<br>
Regards,<br>
Frank<br>
<br>
<br>
laune wrote<br>
><br>
> OK, thanks for the confirmation.<br>
><br>
> Do you have any comments w.r.t. to usability during development<br>
> (debugging?!) and maintenance? The example is simple enough, but what's<br>
> your feeling?<br>
><br>
> -W<br>
><br>
> On 6 January 2012 08:46, FrankVhh &lt;frank.vanhoenshoven@&gt; wrote:<br>
><br>
>><br>
>> laune wrote<br>
>> ><br>
>> > What I suggested is a non-standard way of rule authoring, and I just<br>
>> think<br>
>> > that it is possible - I've never tried it.<br>
>> ><br>
>><br>
>> This should work. I tried it once with Drools 5.0, so I assume it is<br>
>> still<br>
>> OK.<br>
>><br>
>> <a href="http://drools.46999.n3.nabble.com/file/n3637269/voc.dsl" target="_blank">http://drools.46999.n3.nabble.com/file/n3637269/voc.dsl</a> voc.dsl<br>
>> <a href="http://drools.46999.n3.nabble.com/file/n3637269/Sample.dst" target="_blank">http://drools.46999.n3.nabble.com/file/n3637269/Sample.dst</a> Sample.dst<br>
>> <a href="http://drools.46999.n3.nabble.com/file/n3637269/DroolsTest.java" target="_blank">http://drools.46999.n3.nabble.com/file/n3637269/DroolsTest.java</a><br>
>> DroolsTest.java<br>
>><br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3637269.html" target="_blank">http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3637269.html</a><br>
>> Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
>> _______________________________________________<br>
>> rules-users mailing list<br>
>> rules-users@.jboss<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>
> rules-users mailing list<br>
> rules-users@.jboss<br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
><br>
<span><font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3644953.html" target="_blank">http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3644953.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" 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>
</font></span></blockquote></div><br>
</div></div><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>
<br></blockquote></div><br>