Hi Mauricio<br><br>in response to:<br><a href="http://drools.46999.n3.nabble.com/rules-users-Declarative-agenda-final-API-tp3684502p3688171.html">http://drools.46999.n3.nabble.com/rules-users-Declarative-agenda-final-API-tp3684502p3688171.html</a><br>
<br>here is an example with declarative agenda and ruleflow, the knowledgebase consists of the following rule file plus bpmn ruleflow file that has only two ruleflow groups "setup" and then "validation".<br>
<br>if I turn on the knowledgeBaseConfiguration.setOption(DeclarativeAgendaOption.ENABLED); no rule is fired<br><br>tried with <br> <drools.ver>5.3.0.Final</drools.ver><br> <jbpm.version>5.1.2.Final</jbpm.version><br>
<br>----------------<br>package droolsbestpractices;<br><br>import org.drools.runtime.rule.Activation;<br><br>dialect "mvel" <br><br>declare Customer<br> name : String @key<br> level : Integer @key<br>end<br><br>
//user can decide to bypass ...<br><br>rule initialize<br>ruleflow-group "setUp"<br> when<br> <br> then<br> System.out.println(<a href="http://kcontext.rule.name">kcontext.rule.name</a>);<br>
Customer customer1 = new Customer("John", 1);<br> insert(customer1);<br>end<br><br>rule customerLevelLow @bypass('customerValidation')<br>ruleflow-group "validate"<br> when<br>
Customer( level < 3 )<br> then<br> System.out.println(<a href="http://kcontext.rule.name">kcontext.rule.name</a>);<br>end<br><br>rule customerLevelBypass @activationListener('direct')<br> when<br>
$a : Activation( bypass == 'customerValidation' )<br> then<br> System.out.println(<a href="http://kcontext.rule.name">kcontext.rule.name</a>);<br> kcontext.blockActivation( $a );<br>end<br>
--------------------------<br><br>Best regards,<br>Michal<br>