I can answer one of the questions: how to achieve rule template instantiation without spreadsheets for the actual parameters: Based on the API  in the preliminary 5.0.0 relase, I wrote a few simple classes that let you instantiate templates from Bean-style objects or property maps. I&#39;m sure that this would meet your requirements since you can control the contents of the parameter objects any way you want, and you aren&#39;t stuck with a spreadsheet for instantiation.<br>
<br>I&#39;ve passed this on to the Drools development team two or three of weeks ago, but I haven&#39;t seen it merged into the codebase yet. It definitly won&#39;t make the first &quot;official&quot; 5.0 release that&#39;S due any minute now, but there&#39;s no reason why you shouldn&#39;t have these classes for experiments and planning, now. <br>
<br>-W<br><br><br><br><div class="gmail_quote">On Thu, Apr 23, 2009 at 10:26 AM, Tim Langford <span dir="ltr">&lt;<a href="mailto:tim.langford@gmail.com">tim.langford@gmail.com</a>&gt;</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;">
Hello All,<br>
<br>
I am very new to Drools and thinking about using it in a project.<br>
Apologies if these questions are naive - I have read the excellent<br>
documentation and written and run some examples but am still feeling a<br>
little lost.<br>
<br>
Due to the nature of the existing system the project will depend on we<br>
want to utilize the engine such that it operates and behaves like a<br>
&#39;function&#39;:<br>
<br>
1) The system will always assert a single hierarchical object into the<br>
working memory of the required type.<br>
2) Global variables will be attached to the working memory to provide<br>
visibility of system objects ; and also defined a set of return<br>
objects (to be retrieved by the host system after execution.<br>
3) The rules will be execute to produce a set of results that will<br>
then be acted on externally by the host system.<br>
<br>
For example:<br>
<br>
We assert a &#39;Journey&#39; (or another object) into a working memory with<br>
the following rule:<br>
<br>
rule &quot;Journey No Charge Cancellation Option&quot;<br>
    dialect &quot;java&quot;<br>
        when<br>
                # There are at least &quot;{days}&quot; days before the journey begins<br>
                $journey : Journey( )<br>
                eval(daysToDeparture($itinerary) &gt; 30)<br>
        then<br>
                &gt;toDebugLog(&quot;Journey &#39;no charge&#39; cancellation.&quot;, logger);<br>
                &gt;CancelOption option =<br>
instanceOfCancellationOption(kcontext.getRule().getName(),<br>
&quot;CancelProcessor&quot;, 0);<br>
                &gt;cancelOptions.add(option);<br>
end<br>
<br>
<br>
function CancelOption instanceOfCancellationOption(<br>
                String ruleName,<br>
                String targetProcessor,<br>
                Integer percentageBasedCharge) {<br>
<br>
                CancelOption option = new CancelOption();<br>
                option.setInvokingRule(ruleName);<br>
                option.setTargetProcessor(targetProcessor);<br>
                option.setDepositBasedChargePercentage(percentageBasedCharge);<br>
<br>
                return option;<br>
}<br>
<br>
<br>
The system must support different users from different companies - so<br>
these rules need to be &#39;templated&#39;. We need to allow users to define<br>
their own instances and constraints on any of the template rules<br>
defined. Furthermore, they maybe from different countries so system<br>
must use the DSL functionality to wrap the rules and parameters in<br>
something meaningfully to them. Finally, we need to be to be able add<br>
constraints over the rules to ensure users do not misconfigure the<br>
rules and rules values (for example only a set of date ranges for<br>
canceling a journey that don&#39;t overlap). We don&#39;t want to use the<br>
spreadsheet templating mechanism. Rule configuration will have to be<br>
provided in our weblication (and backed by the guvnor).<br>
<br>
I could easily achieve this in pure java, groovy, etc. but would like<br>
to condsider drools due to 1) Wanting it to be a bit more dynamic than<br>
java (whilst not being so dynamic a user can easily make a mistake or<br>
get confused); 2) Getting the DSL features; 3) taking advantage of the<br>
all the rule versioning and management performed by the RMS.<br>
<br>
Sorry for the long introduction. My questions are:<br>
<br>
1) Is Drools an overkill such functionality? (I am no expert).<br>
2) Is there an example that uses templating (without spreadsheets) and<br>
DSL&#39;s somewhere? Does this work with the &#39;guvnor&#39;? I have tested most<br>
Drools functionality, but don&#39;t seem to be able to get a handle on<br>
using all together to achieve this goal.<br>
<br>
<br>
Any insight or recommendations will be greatully recieved.<br>
<br>
Thanks<br>
<br>
Tim<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>
</blockquote></div><br>