Hi Darren,<div>We have published some slides and we have some examples in our repository.</div><div>Check the following links and let us know if you have questions about them.</div><div><br></div><div>You can find pointers to the slide in this blog posts:</div>
<div><a href="http://salaboy.wordpress.com/2011/02/23/drools-5-community-training-announced-roadmap/">http://salaboy.wordpress.com/2011/02/23/drools-5-community-training-announced-roadmap/</a></div><div>And the code for the examples is located here:</div>
<div><a href="https://github.com/Salaboy/Drools_jBPM5-Training-Examples">https://github.com/Salaboy/Drools_jBPM5-Training-Examples</a></div><div>Under the drools5 directory.</div><div><br></div><div>The main idea is have very simple examples that allows you to get comfortable about how the rules are being matched and executed.</div>
<div><br></div><div>I hope this helps.</div><div><br></div><div>PS: frank great explanation :)</div><div><br><div class="gmail_quote">On Fri, Aug 12, 2011 at 12:46 PM, FrankVhh <span dir="ltr"><<a href="mailto:frank.vanhoenshoven@agserv.eu">frank.vanhoenshoven@agserv.eu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
The best way to get started, imho, is to read the Drools Expert guide -<br>
don't worry if some things are not very clear in the beginning - and have a<br>
look at the samples. The basic hello world sample that comes with the<br>
eclipse plugin is basically all you need to get started. From then on, you<br>
can add complexity as you will.<br>
<div class="im"><br>
However, instead of populating and returning a loanApplication object, how<br>
would I return just the decision/end result of a rule if it was only one<br>
value (the approved/not approved decision) from the java app? KnowledgeBase<br>
is loaded from the java app, but struggling with StatefulKnowledgeSession<br>
versus StatelessKnowledgeSession and how to simply get back the rule<br>
decision value (again, preferably without a specific object if it is only<br>
one value)?<br>
<br>
</div>To get one misunderstanding out of the way: the rule engine does not return<br>
a "decision value". In fact, it returns nothing at all. You provide the<br>
engine with facts ( insert(myFact) ), then the engine will start<br>
constructing its rete-tree. Once you execute fireAllRules(), the engine will<br>
start reasoning upon the objects and change attributes, add objects to<br>
working memory, remove from wm, creating new objects and all other beautiful<br>
things that java can handle. When there are no more rules to fire, the<br>
engine will stop and the objects will have reached their final state. It is<br>
up to you to fetch the interesting information.<br>
<br>
If you want to implement a decision service that only returns true/false,<br>
you have to implement this in your java code and return the correct boolean<br>
value, which you first fetched from your inserted facts.<br>
<br>
The difference between stateful and stateless is basically this:<br>
- Stateful: the engine will be able to reevaluate the rules during<br>
execution, hereby enabling foreward chaining.<br>
- Stateless: engine will not do any reevaluations, the state of the facts<br>
as they come in to the engine, will be considered their fixed state, even if<br>
they are modified.<br>
<br>
<br>
Example:<br>
when customer has 10 items when loyal customer<br>
then customer is loyal customer then reduction of 10%<br>
<br>
With this ruleset, with A true on rule execution. The *statefull* session<br>
will "acknowledge" the reduction of 10%. The *stateless* session will only<br>
get determine that the customer is loyal. The reduction is not taken into<br>
account, as the loyalty was not established at the point of rule execution.<br>
<div class="im"><br>
I'm also looking to only fire/execute one rule at a time for now until we<br>
get comfortable - any help for an app developer trying to ease their way<br>
into drools?<br>
<br>
</div>It might be a good idea to get a basic understanding of the internal working<br>
of a rule engine, i.e. get a basic understanding of the Rete algorithm. This<br>
might help in getting rid of the procedural way of thinking, which is often<br>
a "problem" with technical people.<br>
<br>
Hope this helps.<br>
<br>
Good luck.<br>
<br>
Regards,<br>
Frank<br>
<div><div></div><div class="h5"><br>
<br>
dhartford wrote:<br>
><br>
> Hey all,<br>
> I'm trying to dip some toes into the water with Drools, and have an<br>
> application that would be a good start but having some<br>
> understanding/lacking an appropriate example issue.<br>
><br>
> The application context, let's say, is Mortgages, and already using the<br>
> Mortgage rules that are stored in a running instance of Guvnor.<br>
><br>
> Going back to 'toe in water', lets assume that all 'facts' are loaded on<br>
> call (so nothing is pre-loaded, all data to run a rule is supplied at the<br>
> time the rule is called). This is to make it easier to get started<br>
> without jumping all-in just yet ;-)<br>
><br>
> Using the mortgage business rule 'CreditApproval' that is already loaded<br>
> into Guvnor, I can see passing the Application object, with the<br>
> creditRating field/fact to a rule.<br>
><br>
> However, instead of populating and returning a loanApplication object, how<br>
> would I return just the decision/end result of a rule if it was only one<br>
> value (the approved/not approved decision) from the java app?<br>
> KnowledgeBase is loaded from the java app, but struggling with<br>
> StatefulKnowledgeSession versus StatelessKnowledgeSession and how to<br>
> simply get back the rule decision value (again, preferably without a<br>
> specific object if it is only one value)?<br>
><br>
> I'm also looking to only fire/execute one rule at a time for now until we<br>
> get comfortable - any help for an app developer trying to ease their way<br>
> into drools?<br>
><br>
> Sorry if I not overly clear, still trying to learn the appropriate<br>
> terminology :-)<br>
><br>
> -Darren<br>
><br>
<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://drools.46999.n3.nabble.com/app-dev-toe-in-water-help-please-tp3249458p3249601.html" target="_blank">http://drools.46999.n3.nabble.com/app-dev-toe-in-water-help-please-tp3249458p3249601.html</a><br>
<div><div></div><div class="h5">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">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> - CTO @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a> <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div>
- Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br> - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino "Salaboy" Mauricio -</div>
<br>
</div>