Re: [rules-users] Error in Activator.java

2013-03-10 Thread Mallory
Thanks!

That worked:)



--
View this message in context: 
http://drools.46999.n3.nabble.com/Error-in-Activator-java-tp4022753p4022755.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Help with DefaultAgenda.java

2013-03-10 Thread Mallory
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@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@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@4dde85f0]
]
In DA WM: org.drools.impl.StatefulKnowledgeSessionImpl@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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Help with DefaultAgenda.java

2013-03-10 Thread Mark Proctor
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...@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@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@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@4dde85f0]
 ]
 In DA WM: org.drools.impl.StatefulKnowledgeSessionImpl@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@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] How to adjust different timezones in drools

2013-03-10 Thread richie
Hi,

Recently I encountered a problem, my server is in timezone -0700, but the
client is in timezone +0800, so when client set a condition such as date =
'11-Mar-2013', when client is in Mar 11, this condition should return true,
but maybe the server is still in Mar 10, so the actual result of this
condition is false, anyway to run out of this?



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-adjust-different-timezones-in-drools-tp4022759.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Expert Systems and Functional programming?

2013-03-10 Thread Grant Rettke
On Thu, Mar 7, 2013 at 2:44 PM, Matteo Mortari matteo.mort...@gmail.com wrote:
 The Question I'm asking myself: is there a specific, or few, areas where
 Functional Programming could actually benefit Expert Systems so much to
 actually spawn new paradigms of writing Rules? Or benefit in a new
 generation of the Rete algorithm?
 Or actually, Functional Programming will spawn a completely different
 paradigm of system which will go beyond Expert Systems the way are designed
 today?

Great question, very inspiring just to think of the possibilities. The
biggest opportunity out there right now is for rules-engines to help
bridge the artificial gap that exists between the so called
fundamental models of computation for the different camps. For
example, Java is a Turing style sequential language and Lisp is a
Church style functional language. This shoe-horning of languages into
different camps is arbitrary, boring, mentally restrictive, totally
artificial, and offers little more benefits than easily separating
books on a bookshelf at the bookstore. It is really, really sad to see
the quelling of creativity and reduction of the beautiful parts of
different computational models reduced into tiny, little, lonely camps
that must live in isolation. Digging into rules engines is a pathway,
albeit deeply unpopular, into another important form computational
expression that never really got it's day in the sun like the biggies
today. New and interesting things will benefit all camps when they dig
into the world of production systems and welcome it as a first class
citizen to their programming toolbox. Would it result in new and great
things? Who knows :).
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users