[rules-users] What can be done in RHS block...

jdepaul jjdepaul at us.ibm.com
Wed Feb 7 16:59:35 EST 2007


I have a simple rule set working: I assert a Fact and Drools matches multiple
rules per Fact as desired - now I need to do something meaningful when one
OR MORE rules matches - i.e. I need to be able to send a JMS message for
every Rule match to the interested Party, or invoke some type of process
when Drools finds the right MULTIPLE conditions for me...  Examples I've
seen only show how to update/modify the Fact, or how to print out a Println
- how do I get beyond that?

Here's my simple rule with functions - any suggestions will be welcome:

rule "Customer Match"
	salience 100
	when
		custGI : GateIn ( matched==false, customerId == "NISSAN",
destinationLocation matches "^SF.*" ) 
	then
		System.out.println("\nFound Customer Match");
		notifyPartner(custGI.getCustomerId());		
end

rule "Shipper Match"
	salience 90
	when
		shipperGI : GateIn ( matched==false, primaryShipperId == "YELLOW" ) 
	then
		System.out.println("\nFound Shipper Match");
		notifyPartner(shipperGI.getPrimaryShipperId());		
end


// Match found - notify customer
function void notifyPartner(String _partner ) {
	System.out.println("Notifying Partner " + _partner );
        /*
         * How do I invoke a notification Service from here?! 
         */

}




-- 
View this message in context: http://www.nabble.com/What-can-be-done-in-RHS-block...-tf3189882.html#a8855072
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list