<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'>It is not a myth ... but indeed, it's hard.<br>Most of times, you have to find one guy at client's side who is ready to learn at least the main principles of expert-systems. For my experience, it works well enough (ie most of rules dev time is done by the BA) in about 1 proj out of 3. For the others, an IT guy is still needed to help the BA (which is something doable if you have enough rules to author).<br><br>DSL are hard to set, and harder to maintain, especially while using 
guvnor (using DSL in a dsrl rule is fine, but dsrl rules for non-IT guys
 is a myth).<br>
Usually I try as much as I can to set a business-compliant POJO model (ie simple, almost flat, with fields named in a way they understand what is behind) and no DSL at all...<br>For the rules' firing control, it is harder ... <br><br>@dme1 : May be you can think on an agenda filter that looks for the rule's package ? Or use "category rules", which is a rule binded to a category, which acts as a parent rule for all rules under this category (so all rules of the same category will have the same common first conditions, which can be the test of your control fact). But beware of that, there was a bug on sub-categories, or when a rule has more than one category (one the first category is taken if I remember well). A last thing could be to use verifier to ensure that all rules have a first condition that test the control fact.<br><br>@GPatel : your approach sounds great. How much time did you spent to write such a Guvnor alternative ?<br><br><br><hr id="zwchr"><div style="color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>De: </b>GPatel@tsys.com<br><b>À: </b>"Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br><b>Envoyé: </b>Jeudi 13 Septembre 2012 18:47:52<br><b>Objet: </b>Re: [rules-users] Cutom Attributes in Drools<br><br><font face="sans-serif" size="2">"</font><tt><font size="2">I would not
store the result of the (missed) activation of a rule in a rule<br>
attribute, anyway. Can't you just use a dedicated fact(s) for that?"</font></tt>
<br>
<br><tt><font size="2">I face a similar issue where the target audience are
"business" users i.e users that dont really understanding or
wish to get into logic. I am finding myself having to resort to all sorts
of tricks (using categories/packages/standlone rule editor) to allow business
users to easily specify which rules are for what purposes and when they
should fire. I just cant rely on them using facts correctly to disable
rules that should not fire. In fact, I am now down to using only the standalone
editor and saving the rule xml in my tables (not guvnor) so that i have
full control over itemized rule display, rule search, knowledgebase creation
for different execution profiles, etc.</font></tt>
<br>
<br><tt><font size="2">Overall, I increasingly tend to think rules for business
users is a myth. The business users wants rule-driven systems, yet they
dont want to learn drools. And drools DSL just doesnt cut it.</font></tt>
<br>
<br>
<br>
<br><font color="#5f5f5f" face="sans-serif" size="1">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font face="sans-serif" size="1">Davide Sottara &lt;dsotty@gmail.com&gt;</font>
<br><font color="#5f5f5f" face="sans-serif" size="1">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font face="sans-serif" size="1">rules-users@lists.jboss.org,
</font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font face="sans-serif" size="1">09/13/2012 01:57 AM</font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font face="sans-serif" size="1">Re: [rules-users]
Cutom Attributes in Drools</font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font face="sans-serif" size="1">rules-users-bounces@lists.jboss.org</font>
<br>
<hr noshade="noshade">
<br>
<br>
<br><tt><font size="2">You can add any metadata using the format @name( "value"
) or @name(<br>
key=value ). You can then look them up using rule.getMetaData(). <br>
Please notice that there's a bug (solved by an open pull request) that
does<br>
not let you write just @name.<br>
<br>
In order to use those attributes to control whether a rule fires or not,
you<br>
can use the "declarative agenda", i.e. add meta-rules to your
knowledge base<br>
such as:<br>
<br>
rule "Meta"<br>
@activationListener('direct')<br>
when<br>
 &nbsp; &nbsp;// assuming the attribute is @region( [value] )<br>
 &nbsp; &nbsp;$a : Activation( rule.metaData[ "name" ] != "MyDesiredRegion",
$objs :<br>
objects )<br>
 &nbsp; &nbsp;// any condition on the tuple here, if needed<br>
then<br>
 &nbsp; &nbsp;drools.cancelActivation( $a );<br>
end<br>
<br>
notice that you'll have to enable the corresponding option first:<br>
KnowledgeBaseConfiguration kconf =<br>
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();<br>
kconf.setOption( DeclarativeAgendaOption.ENABLED );<br>
KnowledgeBase kb = KnowledgeBaseFactory.newKnowledgeBase( kconf );<br>
<br>
<br>
If you want to have rules override each other, watch out for an upcoming<br>
feature, "Defeasible logic".<br>
I would not store the result of the (missed) activation of a rule in a
rule<br>
attribute, anyway. Can't you<br>
just use a dedicated fact(s) for that?<br>
<br>
Best<br>
Davide<br>
<br>
<br>
<br>
--<br>
View this message in context: </font></tt><a href="http://drools.46999.n3.nabble.com/Cutom-Attributes-in-Drools-tp4019692p4019736.html" target="_blank"><tt><font size="2">http://drools.46999.n3.nabble.com/Cutom-Attributes-in-Drools-tp4019692p4019736.html</font></tt></a><tt><font size="2"><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
rules-users@lists.jboss.org<br>
</font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"><tt><font size="2">https://lists.jboss.org/mailman/listinfo/rules-users</font></tt></a><tt><font size="2"><br>
</font></tt>
<br>

-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you <br>_______________________________________________<br>rules-users mailing list<br>rules-users@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/rules-users<br></div><br></div></body></html>