[rules-users] Nullpointer inserting fact.

Bagwell, Allen F afbagwe at sandia.gov
Mon May 12 09:55:00 EDT 2008


Are these dynamic facts you're working with? If they aren't (and at least your new Invoke object is not), then try:


then
         Invoke inv = new invoke();
       $web.setInvoke(inv);
       insert(inv);
         update($web);
end


-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of psyduck
Sent: Friday, May 09, 2008 2:20 PM
To: rules-users at lists.jboss.org
Subject: [rules-users] Nullpointer inserting fact.


Hey,

I ve got a class
WebService{
          getter/setter for invoke property }

then i got the following rules

rule "..."
salience 10
when
        $web : WebService ( )
then
       Invoke inv = new invoke();
       $web.setInvoke(inv);
       insert(inv);
end
this succeeds,but then the following rule :
rule "..."
salience 9
when
       $inv : Invoke( )
       $web : WebService ( invoke == $inv); then ...
end

never gets executed,because he doesnt find a webservice with same invoke, (according to debug information,they are the same invoke object)

Is it possible that this happens because when i inserted the webservice in the workingmemory, the invoke property was not yet defined(=null)?
Does anyone know a solution for this?
Thx in advance
--
View this message in context: http://www.nabble.com/Nullpointer-inserting-fact.-tp17100525p17100525.html
Sent from the drools - user 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