i trying execute rules written in kie workbench , integrated kie exceution server , got response expected . rquirement execute 1 specific rule list of large rules defined. possible ways can achieve . used activation group , rule flow group no luck if 1 can me achieve .
i created guided decision table in kie workbench . , source generated in way
package demo.drools_examples; //from row number: 1 rule "row 1 rule1" dialect "mvel" when f1 : account( accounttype == "regular" ) f1.setbaseamount( 10.0 ); f1.setbasethreshold( 10.0 ); calculateamount(f1); calculatethreshold(f1); end //from row number: 2 rule "row 2 rule1" dialect "mvel" when f1 : account( accounttype == "registered" ) f1.setbaseamount( 5.0 ); f1.setbasethreshold( 15.0 ); calculateamount(f1); calculatethreshold(f1); end //from row number: 3 rule "row 3 rule1" dialect "mvel" when f1 : account( accounttype == "saving" ) f1.setbaseamount( 20.0 ); f1.setbasethreshold( 10.0 ); calculateamount(f1); calculatethreshold(f1); end
how can define saliance , activation group or other policy call rule 1 rather calling fireallrules(1).. please me
you'll have call fireallrules, twist:
agendafilter af = new singlerulefilter( "row 1 rule1" ); int nfired = kiesession.fireallrules( af );
and need write this:
public class singlerulefilter implements agendafilter { private string name; public singlerulefilter( string name ){ this.name = name; } public boolean accept( activation activation ){ return activation.getrule().getname().equals( name ); } }
Comments
Post a Comment