[rules-users] Nullpointer inserting fact.

Edson Tirelli tirelli at post.com
Mon May 12 15:34:22 EDT 2008


   Improve your rule constraints:

rule "..."
ruleflow-group "invoke"
salience 10
when
       $web : WebService ( invoke == null )
then
      Invoke inv = new invoke();
      $web.setInvoke(inv);
      update( $web );
      insert(inv);
end

   []s
   Edson


2008/5/12 psyduck <psyduck101 at gmail.com>:

>
> Thx for the response. But when i use the update(no dynamic facts), the
> rule
> keeps repeating himself for the same webservice object. I use no-loop but
> that doesnt help.
>
> rule "..."
> ruleflow-group "invoke"
> no-loop true
> salience 10
> when
>        $web : WebService ( )
> then
>       Invoke inv = new invoke();
>       $web.setInvoke(inv);
>       insert(inv);
> end
>
>
> AllenABQ wrote:
> >
> >
> > 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
> >
> --
> View this message in context:
> http://www.nabble.com/Nullpointer-inserting-fact.-tp17100525p17189814.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
>



-- 
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080512/bd254325/attachment.html 


More information about the rules-users mailing list