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 <[EMAIL PROTECTED]> 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
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users




--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to