Package org.drools.event

Examples of org.drools.event.DefaultAgendaEventListener


        final List<String> list = new ArrayList<String>();
        workingMemory.setGlobal( "list",
                                 list );

        final List<Activation> activations = new ArrayList<Activation>();
        AgendaEventListener listener = new DefaultAgendaEventListener() {
            public void activationCancelled(ActivationCancelledEvent event,
                                            WorkingMemory workingMemory) {
                activations.add( event.getActivation() );
            }
        };
View Full Code Here


        }
    }

    private void initProcessActivationListener() {
        addEventListener( new DefaultAgendaEventListener() {
            public void activationCreated(ActivationCreatedEvent event,
                                          WorkingMemory workingMemory) {
                String ruleFlowGroup = event.getActivation().getRule().getRuleFlowGroup();
                if ( "DROOLS_SYSTEM".equals( ruleFlowGroup ) ) {
                    // new activations of the rule associate with a state node
View Full Code Here

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase( RuleBase.RETEOO );
        ruleBase.addPackage( this.pkg );
        final WorkingMemory workingMemory = ruleBase.newStatefulSession();

        final DefaultAgendaEventListener listener = new DefaultAgendaEventListener() {
            private int counter = 0;

            //           public void activationCreated(ActivationCreatedEvent event) {
            //                super.activationCreated( event );
            //                System.out.println( event );
View Full Code Here

        final DefaultAgenda agenda = (DefaultAgenda) workingMemory.getAgenda();

        final Boolean[] filtered = new Boolean[]{false};

        workingMemory.addEventListener( new DefaultAgendaEventListener() {

            public void activationCancelled(ActivationCancelledEvent event,
                                            WorkingMemory workingMemory) {
                if ( event.getCause() == MatchCancelledCause.FILTER ) {
                    filtered[0] = true;
View Full Code Here

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase( RuleBase.RETEOO );
        ruleBase.addPackage( this.pkg );
        final WorkingMemory workingMemory = ruleBase.newStatefulSession();

        final DefaultAgendaEventListener listener = new DefaultAgendaEventListener() {
            private int counter = 0;

            //           public void activationCreated(ActivationCreatedEvent event) {
            //                super.activationCreated( event );
            //                System.out.println( event );
View Full Code Here

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase( RuleBase.RETEOO );
        ruleBase.addPackage( this.pkg );
        final WorkingMemory workingMemory = ruleBase.newStatefulSession();

        final DefaultAgendaEventListener listener = new DefaultAgendaEventListener() {
            private int counter = 0;

            //           public void matchCreated(ActivationCreatedEvent event) {
            //                super.matchCreated( event );
            //                System.out.println( event );
View Full Code Here

        final DefaultAgenda agenda = (DefaultAgenda) workingMemory.getAgenda();
       
        final Boolean[] filtered = new Boolean[] { false };
       
        workingMemory.addEventListener( new DefaultAgendaEventListener() {
        
            public void activationCancelled(ActivationCancelledEvent event,
                                            WorkingMemory workingMemory) {
                if ( event.getCause() == ActivationCancelledCause.FILTER ) {
                    filtered[0] = true;
View Full Code Here

        final DefaultAgenda agenda = (DefaultAgenda) workingMemory.getAgenda();

        final Boolean[] filtered = new Boolean[]{false};

        workingMemory.addEventListener( new DefaultAgendaEventListener() {

            public void activationCancelled(ActivationCancelledEvent event,
                                            WorkingMemory workingMemory) {
                if ( event.getCause() == ActivationCancelledCause.FILTER ) {
                    filtered[0] = true;
View Full Code Here

        ruleBase = SerializationHelper.serializeObject( ruleBase );
        final InternalWorkingMemoryActions wm = (InternalWorkingMemoryActions) ruleBase.newStatefulSession();
        final List created = new ArrayList();
        final List cancelled = new ArrayList();
        final AgendaEventListener l = new DefaultAgendaEventListener() {
            public void activationCreated( ActivationCreatedEvent event,
                                           WorkingMemory workingMemory ) {
                created.add( event );
            }
View Full Code Here

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( builder.getPackage() );

        final StatefulSession session = ruleBase.newStatefulSession();

        session.addEventListener( new DefaultAgendaEventListener() {
            public void afterActivationFired(final AfterActivationFiredEvent arg0) {
                super.afterActivationFired( arg0,
                                            session );
            }
        } );
View Full Code Here

TOP

Related Classes of org.drools.event.DefaultAgendaEventListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.