[rules-users] Editing DefaultAgenda.java file from org.drools.common

Davide Sottara dsotty at gmail.com
Sat Feb 23 00:54:14 EST 2013


Which version of the various components are you using? And to what extent
have you changed the code?
(could you post the modified source file, e.g. using nopaste or pastebin?)

In any case, I would not recommend changing the source code until you are
completely sure that your 
modification has not broken the code base.. Especially considering that you
can do this when you create
your KB:

KnowledgeBaseConfiguration kbConf =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
// Provide an instance of an AgendaFactory that returns an extension of
DefaultAgenda
((RuleBaseConfiguration) kbConf).getComponentFactory().setAgendaFactory( new
MyAgendaFactory() )
KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase( kbConf );

For example:

public class  MyAgendaFactory() {
            public DefaultAgenda createAgenda(InternalRuleBase ruleBase) {
                return createAgenda( ruleBase, true );
            }

            public DefaultAgenda createAgenda(InternalRuleBase ruleBase,
boolean initMain) {
                return new DefaultAgenda( ruleBase, initMain ) {
                    @Override
                    public synchronized void fireActivation(Activation
activation) throws ConsequenceException {
                        System.out.println( "I am about to fire " );
                        super.fireActivation(activation);
                    }
                };
            }




--
View this message in context: http://drools.46999.n3.nabble.com/Editing-DefaultAgenda-java-file-from-org-drools-common-tp4022549p4022550.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list