[rules-users] How to inovke a Service...

Francisco Brum francisco.brum at link.pt
Fri Feb 9 13:06:59 EST 2007


Hello!

I'm a newbie, but I believe you have to write eval on functions.


__________________________________
Francisco Brum - francisco.brum at link.pt
Link Consulting - http://www.link.pt/
Tel.: 213 100 031
Av. Duque D'Ávila, 23 4º Esq.
1000-138 Lisboa

-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of jdepaul
Sent: sexta-feira, 9 de Fevereiro de 2007 17:53
To: rules-users at lists.jboss.org
Subject: Re: [rules-users] How to inovke a Service...


Thanks for a great example - I was able to invoke myService from the
<consequence> block in my rules, but NOT from a Function that I define...  
is this a limitation, or is there some other syntax when invoking from a
function?


rule "Shipper Match"
	salience 90
	when
		shipperGI : GateIn ( customerId == "NISSAN", primaryShipperId == "yellow"
) 
	then
		myService.sendNotification(shipperGI, Constants.SHIPPER_MATCH);	 <-- This
Works
		// notifyPartNer(shipperGI, COnstants.SHIPPER_MATCH);  <-- This DOESN'T
WORK!  
end


// Match found - notify customer
function void notifyPartner(GateIn _event, String _action ) {
	System.out.println("Invoking Service for action = " + _action );
	//myService.sendNotification(_event, _action);  <-- Never gets to here...
crashes...
}





Edson Tirelli-3 wrote:
> 
>>   So, for exaple, you can have a helper class that has the actual code
>> to call the service you want and set it as a global for your rulebase.
>> Then in the consequence you call this class method with the given
>> paramenters.
> ...
> 

-- 
View this message in context: http://www.nabble.com/How-to-inovke-a-Service...-tf3189882.html#a8890381
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




More information about the rules-users mailing list