[rules-users] Asserting new Facts in RHS...

Steven Williams stevearoonie at gmail.com
Thu Apr 19 19:02:04 EDT 2007


rule "Assert new Target Records"
       when
         $one   : RKEM_TARGET ( EQPNO == "1") &&
         $three : RKEM_TARGET ( EQPNO == "3")

       then
               // Assert the missing Equipment number record
               RKEM_TARGET $two = new RKEM_TARGET();
               $two.setEQPNO("2");  // Set attribute
               assert( $two );  <-- This does NOT work...
end

Then "then" section is just normal java with a few methods and objects
provided for you.

cheers
Steve

On 4/20/07, jdepaul <jjdepaul at us.ibm.com> wrote:
>
>
> I'm trying to assert a new Fact based on a condition, but I dont know how
> to
> assert a new Fact with a specific attribute in it.  I'm trying this - why
> doesn't this syntax work:
>
> rule "Assert new Target Records"
>         when
>           $one   : RKEM_TARGET ( EQPNO == "1") &&
>           $three : RKEM_TARGET ( EQPNO == "3")
>
>         then
>                 // Assert the missing Equipment number record
>                 $two : new RKEM_TARGET();
>                 $two.setEQPNO("2");  // Set attribute
>                 assert( $two );  <-- This does NOT work...
> end
>
> How do you assert a new Fact with a specific value in the attribute(s)?
>
> THanks,
> James
>
>
> --
> View this message in context:
> http://www.nabble.com/Asserting-new-Facts-in-RHS...-tf3609763.html#a10086922
> 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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw at objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070420/afa8f7ef/attachment.html 


More information about the rules-users mailing list