[rules-users] RE: trivial case in xls

Bin Shen (BA/EDD) bin.shen at ericsson.com
Thu Aug 16 10:35:20 EDT 2007


sorry, i used the wrong word "action", instead of "data".

take the schema once more to avoid misunderstanding (assume no grouped rows).

-------------------------------------------
                        |      CONDITION
-------------------------------------------
object type/            |     $p : Person
-------------------------------------------
snippet/condition       |         ? 
-------------------------------------------
explaination text       |      xxxxxxxxx      
-------------------------------------------
cell/data               |         ?
-------------------------------------------

it's clear: the condition ("snippet" in my term) can not be empty, and the data ("cell" in my term) can be empty. 

in my case how should i put the condition, when no field constraint is there? how should i put in the data? an empty invalidates the condition! 

the case i raised seems trivial. actually it finds many applications as follows. in question comes the rule "otherwise":  

rule "main"
	salience 10
	when
 		$p : Person(age > 35)
 	then
 		// do something with persons older than 35
		System.out.println("hello, " + $p + "!");
end 	

rule "otherwise"
	when
 		$p : Person()
 	then
		// ignore other persons, i.e. retract them to avoid memory leaks
 		retract($p);
end


/ Ben


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070816/7c64ba4d/attachment.html 


More information about the rules-users mailing list