[rules-users] How to inovke a Service...
jdepaul
jjdepaul at us.ibm.com
Fri Feb 9 12:52:51 EST 2007
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.
More information about the rules-users
mailing list