drools - Reading Excel Sheet in Guvnor Rule -


i have take decision in guvnor rule based on value in excel sheet. possible in guvnor rule? let me explain simple example of want exactly:

rule: read average salary in particular country person. based on avg. salary compute other calculations in rule.

i person's country in input. have take country , check in excel sheet average salary , perform calculations based on it.

excel content:


country salary


ind $2000


usa $3000


chn $1900


now if input person country ind. how can read excel in guvnor?

is better read excel in guvnor or read in java code before calling rule , adding value 1 of pojo field.

any appreciated.

i parse xls file externally , insert data facts (or globals if wish). you can write rules like:

when     person($country: country)     avgsalary(country == $country, $salary: salary)  //this fact comes xls.     ... end 

another option encapsulate parsing of xls file , provide mechanism extract particular salary particular country. in case, can provide mechanism using global , write rules one:

global xlsparser;   // parser class  rule "..." when     person($country: country)     $salary: double() xlsparser.getavgsalary($country)     ... end 

hope helps,


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -