Hi ,

I am new to Drool and need some help . I have done integration of
Drool with database.

I am calling DB helper class memeber function in
Drool. 

In my Drool file (.drl) file, I need to pass 2
parameter as input . Basically, I have to provide
source airport code and destination airport code to my
rule engine. it will call the database and based on
query, it will return domestic or international. 

How can I pass the input parameter to Drool as
variable? Right now, it is hard coded in drool file
like dbh.isDomestic("JFK", "YYZ") .  Here is the .drl
file:

package org.apache.servicemix.drools

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.drools.model.Exchange;

import loanbroker.DbHelper;

global org.apache.servicemix.drools.model.JbiHelper
jbi;


rule TourType
        when
                me : Exchange( status == Exchange.ACTIVE, in : in !=
null, operation ==
"{urn:logicblaze:soa:creditagency}getCreditHistoryLength")
        then
                DbHelper dbh = new DbHelper();
                jbi.answer("<TourTypeResponse><name>" + 
                        dbh.isDomestic("JFK", "YYZ") + 
                        "</name></TourTypeResponse>");
end


Please advise.
Regards,
Prasanta


-- 
View this message in context: 
http://www.nabble.com/How-to-pass-parameter-into-Drool-3.2-rule-.-tf3996673s12049.html#a11350560
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to