[rules-users] Help with DefaultAgenda.java

Mark Proctor mproctor at codehaus.org
Sun Mar 10 20:47:12 EDT 2013


I replied to this on the DEV mailing list, this is the USER mailing list. Please see the web archives.

Mark
On 11 Mar 2013, at 00:36, Mallory <gmalathi.in at gmail.com> wrote:

> Hello,
> 
> I have tried to change the source code of DefaultAgenda.Java by adding the
> code below:
> 
>     //drools orginial sequential code
>      /*
>        while ( continueFiring( fireLimit ) && fireNextItem( agendaFilter )
> ) {
>            fireCount++;
>            fireLimit = updateFireLimit( fireLimit );
>            this.workingMemory.executeQueuedActions();
>        }
>        */
> 
> 
>        //code with concurrency
> 
>        InternalAgendaGroup myGroup = (InternalAgendaGroup) getNextFocus();
>        fireCount = myGroup.size();
> 
>        for(int i =0; i< fireCount; ++i)
>        {
> 
>                new Thread(new Runnable(){
>                        public void run()
>                        {
>                                fireNextItem( agendaFilter );
> 
>                        }
>                }).start();
> 
>        }
> 
> 
> I am getting an Errorjava.lang.NullPointerException because my code flow is
> going to consequenceExceptionHandler ! = null exception.
> 
> else if ( this.consequenceExceptionHandler != null ) {
> 
>                    this.consequenceExceptionHandler.handleException(
> activation, this.workingMemory.getKnowledgeRuntime(),
>                                                                      e );
> 
> 
> Could you kindly help me with this?
> 
> I am pasting the exception below and I am using Drools 5.4 Final version.
> 
> In DA: [Activation rule=Rule 1, act#=0, salience=0, tuple=[fact
> 0:0:1773684356:1306428912:0:DEFAULT:org.drools.reteoo.InitialFactImpl at 4dde85f0]
> ]
> Exception in thread "Thread-1" Exception in thread "Thread-0" Exception
> executing consequence for rule "Rule 1" in defaultpkg:
> java.lang.NullPointerException
> In DA WM: org.drools.impl.StatefulKnowledgeSessionImpl at 542487b1
> In DA Errorjava.lang.NullPointerException
> In DA: [Activation rule=Rule 2, act#=1, salience=0, tuple=[fact
> 0:0:1773684356:1306428912:0:DEFAULT:org.drools.reteoo.InitialFactImpl at 4dde85f0]
> ]
> In DA WM: org.drools.impl.StatefulKnowledgeSessionImpl at 542487b1
> In DA Errorjava.lang.NullPointerException
>        at
> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
>        at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
>        at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1208)
>        at org.drools.common.DefaultAgenda$1.run(DefaultAgenda.java:1471)
>        at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NullPointerException
>        at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1272)
>        ... 3 more
> Exception executing consequence for rule "Rule 2" in defaultpkg:
> java.lang.NullPointerException
>        at
> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
>        at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
>        at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1208)
>        at org.drools.common.DefaultAgenda$1.run(DefaultAgenda.java:1471)
>        at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NullPointerException
>        at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1272)
>        ... 3 more
> 
> 
> Thanks a lot for the help.
> 
> Regards,
> Malory
> 
> 
> 
> --
> View this message in context: http://drools.46999.n3.nabble.com/Help-with-DefaultAgenda-java-tp4022758.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list