[rules-users] java void in LHS

Knapp, Barry barry.knapp at railinc.com
Thu Sep 13 07:59:45 EDT 2007


You could add a helper method to your java class that returns Boolean

class ChessType

	public Boolean setPriceWithReturn(){
		this.price = price	
		return true;	
	}




rule test123
    when
         cheese: Chesse()

--->>> chess.getType().setPriceWithReturn("cheap");

         eval (chesse.getType () == "myType")


    then
           .....
    end




Barry

-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of
Tim.Nguyen at expeditors.com
Sent: Wednesday, September 12, 2007 5:11 PM
To: rules-users at lists.jboss.org
Subject: [rules-users] java void in LHS

Hi all,

I would like to insert a java void to my condition(LHS). Is there anyway
to
do that? Like an example below, how can I set something to my object
before
evaluate it.


rule test123
    when
         cheese: Chesse()

--->>> chess.getType().setPrice("cheap");

         eval (chesse.getType () == "myType")


    then
           .....
    end



Thanks,

Tim

_______________________________________________
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