Hi Mauricio
in response to:
http://drools.46999.n3.nabble.com/rules-users-Declarative-agenda-final-AP...
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".
if I turn on the
knowledgeBaseConfiguration.setOption(DeclarativeAgendaOption.ENABLED); no
rule is fired
tried with
<drools.ver>5.3.0.Final</drools.ver>
<jbpm.version>5.1.2.Final</jbpm.version>
----------------
package droolsbestpractices;
import org.drools.runtime.rule.Activation;
dialect "mvel"
declare Customer
name : String @key
level : Integer @key
end
//user can decide to bypass ...
rule initialize
ruleflow-group "setUp"
when
then
System.out.println(kcontext.rule.name);
Customer customer1 = new Customer("John", 1);
insert(customer1);
end
rule customerLevelLow @bypass('customerValidation')
ruleflow-group "validate"
when
Customer( level < 3 )
then
System.out.println(kcontext.rule.name);
end
rule customerLevelBypass @activationListener('direct')
when
$a : Activation( bypass == 'customerValidation' )
then
System.out.println(kcontext.rule.name);
kcontext.blockActivation( $a );
end
--------------------------
Best regards,
Michal