RE: [rules-users] Issue with nested objects (Repost from message with no subject so that there is a subject)...

2008-03-26 Thread Jason Partyka
So it turns out my issue has something to do with rule-flow groups. I'm 
invoking the WorkingMemory.startProcess(String) method, with a parameter of 
QuoteBuilder to invoke the proper rule-flow, but I'm getting an error that 
says there is no such process id.

I know I am adding the proper .rf file when I build the pacakge and no error is 
occurring when I do that.

-Jason


From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Jason Partyka [EMAIL 
PROTECTED]
Sent: Monday, March 24, 2008 4:46 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Issue with nested objects (Repost from message with no 
subject so that there is a subject)...

Hi all,
I'm having an issue with my rule and Drools 4.0.4. The object that my rule is 
supposed to reason over has nested objects and Drools does not appear to be 
reasoning over it when I modify attributes. I've pasted the rule at the end of 
the e-mail. I am attempting to change the value of the ez_width and ez_drop 
properties and have the corresponding rule below invoked.
I have tried to use the StatefulSession.modifyRetract(FactHandle) and 
StatefulSession.modifyInsert(FactHandle, Object) methods, which I expected to 
work. I then, for the sake of trying, tried the 
StatefulSession.update(FactHandle, Object) method.
After both, I've tried StatefulSession.fireAllRules() as well and nothing.
It's possible I'm missing something in the rules editor but I do not know.
Any insights?
Thanks,
Jason

package com.hightower.templates;

dialect mvel

import com.hightower.tables.BasicBlindFridayTest_JP;
import com.hightower.tables.BasicMountFridayTest;
import com.hightower.tables.CRGtest;


global org.apache.commons.logging.Log LOG;
global com.hightower.drools.beans.hibernate.SoSalesOrderHeader SalesOrderHeader;
global com.hightower.drools.beans.hibernate.ArCustomer Customer;
global com.hightower.drools.beans.hibernate.ArCustomerContact Contact;
global com.hightower.drools.beans.hibernate.SyZipCode ZipCode;
global com.hightower.drools.beans.hibernate.SoShipToAddress ShipToAddress;
global com.hightower.drools.beans.hibernate.SoSalesOrderDetail SalesOrderDetail;
global com.hightower.drools.beans.hibernate.SoSalesHistory SalesHistory;
global com.hightower.drools.beans.hibernate.HtSalesOrderNo SalesOrderNo;
global com.hightower.drools.beans.hibernate.HtCustomerInstallation 
CustomerInstallation;
global com.hightower.drools.beans.hibernate.HtCustomerInfo CustomerInfo;
global com.hightower.drools.beans.hibernate.HtCustomerApplyDiscounts 
CustomerDiscounts;
global com.hightower.drools.beans.hibernate.HtOrderBasicsInfo OrderBasics;
global com.hightower.drools.beans.hibernate.Windows Window;
global com.hightower.drools.beans.hibernate.Rooms Room;




rule awe
dialect mvel
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( basicMountFridayTest.mountType == T )
then
$daObj.getBasicBlindFridayTest_JP().setRightwidht(44);
end




rule priceTableValues_ValRule0
dialect mvel
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 50.00, 
priceTable.Ez_width = 50.00 )
then
$daObj.getPriceTable().setEz_price(2500.00);
end


rule priceTableValues_ValRule1
dialect mvel
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 100.00, 
priceTable.Ez_width = 100.00 )
then
$daObj.getPriceTable().setEz_price(1.00);
end


rule priceTableValues_ValRule2
dialect mvel
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 25.00, 
priceTable.Ez_width = 25.00 )
then
$daObj.getPriceTable().setEz_price(625.00);
end


___
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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] (no subject)

2008-03-24 Thread Jason Partyka
Hi all,

I'm having an issue with my rule and Drools 4.0.4. The object that my rule is 
supposed to reason over has nested objects and Drools does not appear to be 
reasoning over it when I modify attributes. I've pasted the rule at the end of 
the e-mail. I am attempting to change the value of the ez_width and ez_drop 
properties and have the corresponding rule below invoked.

I have tried to use the StatefulSession.modifyRetract(FactHandle) and 
StatefulSession.modifyInsert(FactHandle, Object) methods, which I expected to 
work. I then, for the sake of trying, tried the 
StatefulSession.update(FactHandle, Object) method.

After both, I've tried StatefulSession.fireAllRules() as well and nothing.

It's possible I'm missing something in the rules editor but I do not know.

Any insights?

Thanks,
Jason


package com.hightower.templates;



dialect mvel



import com.hightower.tables.BasicBlindFridayTest_JP;

import com.hightower.tables.BasicMountFridayTest;

import com.hightower.tables.CRGtest;





global org.apache.commons.logging.Log LOG;

global com.hightower.drools.beans.hibernate.SoSalesOrderHeader SalesOrderHeader;

global com.hightower.drools.beans.hibernate.ArCustomer Customer;

global com.hightower.drools.beans.hibernate.ArCustomerContact Contact;

global com.hightower.drools.beans.hibernate.SyZipCode ZipCode;

global com.hightower.drools.beans.hibernate.SoShipToAddress ShipToAddress;

global com.hightower.drools.beans.hibernate.SoSalesOrderDetail SalesOrderDetail;

global com.hightower.drools.beans.hibernate.SoSalesHistory SalesHistory;

global com.hightower.drools.beans.hibernate.HtSalesOrderNo SalesOrderNo;

global com.hightower.drools.beans.hibernate.HtCustomerInstallation 
CustomerInstallation;

global com.hightower.drools.beans.hibernate.HtCustomerInfo CustomerInfo;

global com.hightower.drools.beans.hibernate.HtCustomerApplyDiscounts 
CustomerDiscounts;

global com.hightower.drools.beans.hibernate.HtOrderBasicsInfo OrderBasics;

global com.hightower.drools.beans.hibernate.Windows Window;

global com.hightower.drools.beans.hibernate.Rooms Room;









rule awe

dialect mvel

ruleflow-group 'Validation'

when

$daObj : AReallyWonderfulAndCrappyTest( basicMountFridayTest.mountType == T )

then

$daObj.getBasicBlindFridayTest_JP().setRightwidht(44);

end









rule priceTableValues_ValRule0

dialect mvel

ruleflow-group 'Validation'

when

$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 50.00, 
priceTable.Ez_width = 50.00 )

then

$daObj.getPriceTable().setEz_price(2500.00);

end





rule priceTableValues_ValRule1

dialect mvel

ruleflow-group 'Validation'

when

$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 100.00, 
priceTable.Ez_width = 100.00 )

then

$daObj.getPriceTable().setEz_price(1.00);

end





rule priceTableValues_ValRule2

dialect mvel

ruleflow-group 'Validation'

when

$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 25.00, 
priceTable.Ez_width = 25.00 )

then

$daObj.getPriceTable().setEz_price(625.00);

end





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


[rules-users] Issue with nested objects (Repost from message with no subject so that there is a subject)...

2008-03-24 Thread Jason Partyka
Hi all,
I'm having an issue with my rule and Drools 4.0.4. The object that my rule is 
supposed to reason over has nested objects and Drools does not appear to be 
reasoning over it when I modify attributes. I've pasted the rule at the end of 
the e-mail. I am attempting to change the value of the ez_width and ez_drop 
properties and have the corresponding rule below invoked.
I have tried to use the StatefulSession.modifyRetract(FactHandle) and 
StatefulSession.modifyInsert(FactHandle, Object) methods, which I expected to 
work. I then, for the sake of trying, tried the 
StatefulSession.update(FactHandle, Object) method.
After both, I've tried StatefulSession.fireAllRules() as well and nothing.
It's possible I'm missing something in the rules editor but I do not know.
Any insights?
Thanks,
Jason

package com.hightower.templates;

dialect mvel

import com.hightower.tables.BasicBlindFridayTest_JP;
import com.hightower.tables.BasicMountFridayTest;
import com.hightower.tables.CRGtest;


global org.apache.commons.logging.Log LOG;
global com.hightower.drools.beans.hibernate.SoSalesOrderHeader SalesOrderHeader;
global com.hightower.drools.beans.hibernate.ArCustomer Customer;
global com.hightower.drools.beans.hibernate.ArCustomerContact Contact;
global com.hightower.drools.beans.hibernate.SyZipCode ZipCode;
global com.hightower.drools.beans.hibernate.SoShipToAddress ShipToAddress;
global com.hightower.drools.beans.hibernate.SoSalesOrderDetail SalesOrderDetail;
global com.hightower.drools.beans.hibernate.SoSalesHistory SalesHistory;
global com.hightower.drools.beans.hibernate.HtSalesOrderNo SalesOrderNo;
global com.hightower.drools.beans.hibernate.HtCustomerInstallation 
CustomerInstallation;
global com.hightower.drools.beans.hibernate.HtCustomerInfo CustomerInfo;
global com.hightower.drools.beans.hibernate.HtCustomerApplyDiscounts 
CustomerDiscounts;
global com.hightower.drools.beans.hibernate.HtOrderBasicsInfo OrderBasics;
global com.hightower.drools.beans.hibernate.Windows Window;
global com.hightower.drools.beans.hibernate.Rooms Room;




rule awe
dialect mvel
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( basicMountFridayTest.mountType == T )
then
$daObj.getBasicBlindFridayTest_JP().setRightwidht(44);
end




rule priceTableValues_ValRule0
dialect mvel
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 50.00, 
priceTable.Ez_width = 50.00 )
then
$daObj.getPriceTable().setEz_price(2500.00);
end


rule priceTableValues_ValRule1
dialect mvel
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 100.00, 
priceTable.Ez_width = 100.00 )
then
$daObj.getPriceTable().setEz_price(1.00);
end


rule priceTableValues_ValRule2
dialect mvel
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop = 25.00, 
priceTable.Ez_width = 25.00 )
then
$daObj.getPriceTable().setEz_price(625.00);
end


___
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


RE: [rules-users] Interesting null pointer exception when inserting afact.

2008-03-14 Thread Jason Partyka
Well, another update, if it helps anyone, I turned off Shadow objects and it's 
still occurring.


From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Jason Partyka [EMAIL 
PROTECTED]
Sent: Wednesday, March 12, 2008 1:58 PM
To: Rules Users List
Subject: RE: [rules-users] Interesting null pointer exception when inserting 
afact.

It looks like the bug is still in there.

I am attempting to resolve it myself, but in order to do so I need to go into 
the MVEL code, but the mvel jar that is included as part of the drools 
classpath container (within eclipse) is just mvel14.jar. So I'm not sure where 
the source is or what version of MVEL source I should be attaching. I realize 
that the source-location thing is just an Eclipse issue, but I thought I'd let 
you know right away that it looks like it's still there.

Anywhere you can point me to that would help with making sure I'm looking the 
right code.

Thanks,
Jason

From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Mark Proctor [EMAIL 
PROTECTED]
Sent: Monday, March 10, 2008 8:17 AM
To: Rules Users List
Subject: Re: [rules-users] Interesting null pointer exception when inserting 
afact.

please check with 4.0.x, which will be in 4.0.5 this week, and let us know if 
this is fixed or not. But hurry we are releasing 4.0.5 very soon:
http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/

Mark
Jason Partyka wrote:
I can give this a shot, but the reason why you suggest this is not obvious to 
me.

Have you encountered this problem yourself?

-Jason




From: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] [EMAIL 
PROTECTED]mailto:[EMAIL PROTECTED]] On Behalf Of Anstis, Michael (M.) [EMAIL 
PROTECTED]mailto:[EMAIL PROTECTED]]
Sent: Monday, March 10, 2008 5:06 AM
To: Rules Users List
Subject: RE: [rules-users] Interesting null pointer exception when inserting 
afact.

I'm no expert but recall there can be problems running long running 
(subjective) code from AWT's worker thread.

I thought it was good practice to run your application code in a worker 
thread. This was the first google hit I had on the matter.

http://www.cs.helsinki.fi/u/vihavain/k03/Java/JavathreadsandGUI.html

Cheers,

Mike


From: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
Behalf Of Edson Tirelli
Sent: 08 March 2008 13:15
To: Rules Users List
Subject: Re: [rules-users] Interesting null pointer exception when inserting 
afact.


   Jason,

   Can you please isolate and show us the rule that is creating the problem? It 
is happening either in a eval() statement or in a nested property access.

[]s
Edson

2008/3/7, Jason Partyka [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]:
Hi,

This is in relation to drools 4.0.4

I have an interesting problem. I am getting a null pointer exception when I am 
inserting a fact into a StatefulSession object. What is odd about this NPE is 
that, as far as I can tell (and I have inserted a breakpoint right before I 
insert the fact) that all the properties in the object are initialized, and 
there are no rules accessing any thing that could be null.

So here's my exception trace (just first few lines to get context):

Exception in thread AWT-EventQueue-0 org.drools.RuntimeDroolsException: 
java.lang.NullPointerException
  at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
  at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:145)
  at 
org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
  at 
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
  at 
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
  at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
  at org.drools.reteoo.Rete.assertObject(Rete.java:177)
  at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
  at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:858)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:659)
  at com.hightower.drools.executablerules.Rules.setTemplate(Rules.java:112)

Caused by: java.lang.NullPointerException
  at 
org.drools.base.mvel.MVELEvalExpression.evaluate(MVELEvalExpression.java:39)
  at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
  ... 39 more


(that setTemplate method is not a drools template)

Any ideas?

Thanks,
Jason

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



--
  Edson Tirelli
  JBoss Drools Core Development

RE: [rules-users] Interesting null pointer exception when inserting afact.

2008-03-12 Thread Jason Partyka
It looks like the bug is still in there.

I am attempting to resolve it myself, but in order to do so I need to go into 
the MVEL code, but the mvel jar that is included as part of the drools 
classpath container (within eclipse) is just mvel14.jar. So I'm not sure where 
the source is or what version of MVEL source I should be attaching. I realize 
that the source-location thing is just an Eclipse issue, but I thought I'd let 
you know right away that it looks like it's still there.

Anywhere you can point me to that would help with making sure I'm looking the 
right code.

Thanks,
Jason

From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Mark Proctor [EMAIL 
PROTECTED]
Sent: Monday, March 10, 2008 8:17 AM
To: Rules Users List
Subject: Re: [rules-users] Interesting null pointer exception when inserting 
afact.

please check with 4.0.x, which will be in 4.0.5 this week, and let us know if 
this is fixed or not. But hurry we are releasing 4.0.5 very soon:
http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/

Mark
Jason Partyka wrote:
I can give this a shot, but the reason why you suggest this is not obvious to 
me.

Have you encountered this problem yourself?

-Jason




From: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] [EMAIL 
PROTECTED]mailto:[EMAIL PROTECTED]] On Behalf Of Anstis, Michael (M.) [EMAIL 
PROTECTED]mailto:[EMAIL PROTECTED]]
Sent: Monday, March 10, 2008 5:06 AM
To: Rules Users List
Subject: RE: [rules-users] Interesting null pointer exception when inserting 
afact.

I'm no expert but recall there can be problems running long running 
(subjective) code from AWT's worker thread.

I thought it was good practice to run your application code in a worker 
thread. This was the first google hit I had on the matter.

http://www.cs.helsinki.fi/u/vihavain/k03/Java/JavathreadsandGUI.html

Cheers,

Mike


From: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
Behalf Of Edson Tirelli
Sent: 08 March 2008 13:15
To: Rules Users List
Subject: Re: [rules-users] Interesting null pointer exception when inserting 
afact.


   Jason,

   Can you please isolate and show us the rule that is creating the problem? It 
is happening either in a eval() statement or in a nested property access.

[]s
Edson

2008/3/7, Jason Partyka [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]:
Hi,

This is in relation to drools 4.0.4

I have an interesting problem. I am getting a null pointer exception when I am 
inserting a fact into a StatefulSession object. What is odd about this NPE is 
that, as far as I can tell (and I have inserted a breakpoint right before I 
insert the fact) that all the properties in the object are initialized, and 
there are no rules accessing any thing that could be null.

So here's my exception trace (just first few lines to get context):

Exception in thread AWT-EventQueue-0 org.drools.RuntimeDroolsException: 
java.lang.NullPointerException
  at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
  at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:145)
  at 
org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
  at 
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
  at 
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
  at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
  at org.drools.reteoo.Rete.assertObject(Rete.java:177)
  at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
  at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:858)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:659)
  at com.hightower.drools.executablerules.Rules.setTemplate(Rules.java:112)

Caused by: java.lang.NullPointerException
  at 
org.drools.base.mvel.MVELEvalExpression.evaluate(MVELEvalExpression.java:39)
  at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
  ... 39 more


(that setTemplate method is not a drools template)

Any ideas?

Thanks,
Jason

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



--
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.comhttp://www.jboss.com



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

RE: [rules-users] Interesting null pointer exception when inserting afact.

2008-03-12 Thread Jason Partyka
Well, I've downloaded the source, and it appears that it is occuring in the 
org.mvel.MVELRuntime class, method execute(). My equals token (==) is being 
properly recognized, and converted to its integer representation (10). However, 
in a block with switch (operator), the org.mvel.Operator.EQUAL token does not 
appear, so the execute() method returns a null value because nothing is ever 
evaluated.

I've even verified that null is being returned from the execute method.

I stepped back out to the line (in org.mvel.CompiledExpression,java)
return handleParserEgress(execute(false, this, staticContext, factory), 
returnBigDecimal);

and then stepped into handleParserEgress and the first parameter, which is the 
return value from execute() is null!

Any ideas?

Thanks,
Jason


---


From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Mark Proctor [EMAIL 
PROTECTED]
Sent: Wednesday, March 12, 2008 2:28 PM
To: Rules Users List
Subject: Re: [rules-users] Interesting null pointer exception when inserting 
afact.


Jason Partyka wrote:
It looks like the bug is still in there.

I am attempting to resolve it myself, but in order to do so I need to go into 
the MVEL code, but the mvel jar that is included as part of the drools 
classpath container (within eclipse) is just mvel14.jar. So I'm not sure where 
the source is or what version of MVEL source I should be attaching. I realize 
that the source-location thing is just an Eclipse issue, but I thought I'd let 
you know right away that it looks like it's still there.
We strip jar version numbers to make deployment with Eclipse easier. If you 
look at parent pom.xml it will tell you the version of MVEL used.


Anywhere you can point me to that would help with making sure I'm looking the 
right code.

Thanks,
Jason


From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Mark Proctor [EMAIL 
PROTECTED]
Sent: Monday, March 10, 2008 8:17 AM
To: Rules Users List
Subject: Re: [rules-users] Interesting null pointer exception when inserting 
afact.


please check with 4.0.x, which will be in 4.0.5 this week, and let us know if 
this is fixed or not. But hurry we are releasing 4.0.5 very soon:
http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/

Mark
Jason Partyka wrote:
I can give this a shot, but the reason why you suggest this is not obvious to 
me.

Have you encountered this problem yourself?

-Jason





From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Anstis, Michael (M.) 
[EMAIL PROTECTED]
Sent: Monday, March 10, 2008 5:06 AM
To: Rules Users List
Subject: RE: [rules-users] Interesting null pointer exception when inserting 
afact.


I'm no expert but recall there can be problems running long running 
(subjective) code from AWT's worker thread.

I thought it was good practice to run your application code in a worker 
thread. This was the first google hit I had on the matter.

http://www.cs.helsinki.fi/u/vihavain/k03/Java/JavathreadsandGUI.html

Cheers,

Mike




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: 08 March 2008 13:15
To: Rules Users List
Subject: Re: [rules-users] Interesting null pointer exception when inserting 
afact.



   Jason,

   Can you please isolate and show us the rule that is creating the problem? It 
is happening either in a eval() statement or in a nested property access.

[]s
Edson


2008/3/7, Jason Partyka [EMAIL PROTECTED]:
Hi,

This is in relation to drools 4.0.4

I have an interesting problem. I am getting a null pointer exception when I am 
inserting a fact into a StatefulSession object. What is odd about this NPE is 
that, as far as I can tell (and I have inserted a breakpoint right before I 
insert the fact) that all the properties in the object are initialized, and 
there are no rules accessing any thing that could be null.

So here's my exception trace (just first few lines to get context):

Exception in thread AWT-EventQueue-0 org.drools.RuntimeDroolsException: 
java.lang.NullPointerException
  at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
  at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:145)
  at 
org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
  at 
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
  at 
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
  at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
  at org.drools.reteoo.Rete.assertObject(Rete.java:177)
  at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
  at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:858)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java

RE: [rules-users] Interesting null pointer exception when inserting afact.

2008-03-10 Thread Jason Partyka
I can give this a shot, but the reason why you suggest this is not obvious to 
me.

Have you encountered this problem yourself?

-Jason




From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Anstis, Michael (M.) 
[EMAIL PROTECTED]
Sent: Monday, March 10, 2008 5:06 AM
To: Rules Users List
Subject: RE: [rules-users] Interesting null pointer exception when inserting 
afact.

I'm no expert but recall there can be problems running long running 
(subjective) code from AWT's worker thread.

I thought it was good practice to run your application code in a worker 
thread. This was the first google hit I had on the matter.

http://www.cs.helsinki.fi/u/vihavain/k03/Java/JavathreadsandGUI.html

Cheers,

Mike


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: 08 March 2008 13:15
To: Rules Users List
Subject: Re: [rules-users] Interesting null pointer exception when inserting 
afact.


   Jason,

   Can you please isolate and show us the rule that is creating the problem? It 
is happening either in a eval() statement or in a nested property access.

[]s
Edson

2008/3/7, Jason Partyka [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]:
Hi,

This is in relation to drools 4.0.4

I have an interesting problem. I am getting a null pointer exception when I am 
inserting a fact into a StatefulSession object. What is odd about this NPE is 
that, as far as I can tell (and I have inserted a breakpoint right before I 
insert the fact) that all the properties in the object are initialized, and 
there are no rules accessing any thing that could be null.

So here's my exception trace (just first few lines to get context):

Exception in thread AWT-EventQueue-0 org.drools.RuntimeDroolsException: 
java.lang.NullPointerException
  at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
  at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:145)
  at 
org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
  at 
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
  at 
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
  at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
  at org.drools.reteoo.Rete.assertObject(Rete.java:177)
  at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
  at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:858)
  at 
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:659)
  at com.hightower.drools.executablerules.Rules.setTemplate(Rules.java:112)

Caused by: java.lang.NullPointerException
  at 
org.drools.base.mvel.MVELEvalExpression.evaluate(MVELEvalExpression.java:39)
  at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
  ... 39 more


(that setTemplate method is not a drools template)

Any ideas?

Thanks,
Jason

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



--
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.comhttp://www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users