---------- Forwarded message ----------
From:
<avneesh.sisodia@intelegencia.com>
Date: 4 September 2012 12:33
Subject: how to import function in drl file on guvnor
To:
michael.anstis@gmail.comHello mantis,
I am very new in drools and guvnor users. I have a problem during making rules. I want to use my predefined functions in rule execution.
Suppose I have a rule "companyDivision" and i want to import it into my rule file like this:
package com.exp.test
import com.abc.bean.CompanyBean
import function
com.abc.util.Validation.companyDivision;
rule "CompanyInfo"
dialect "mvel"
when
CompanyBean( businessType == "ABC" , insuranceProgram == "XYZ" )
then
CompanyBean fact0 = new CompanyBean();
fact0.setBusinessType( "ABC" );
fact0.setInsuranceProgram( "XYZ" );
companyDivision(fact0 );
end
How I can do this.
I am doing following steps to c\generate rules::
1. creating com.exp.test package
2. uploading jar(model) file which included all pojo files of application
3. creating "CompanyInfo" rule
rule file generated by guvnor is like this:::
package com.exp.test
import com.abc.bean.CompanyBean
rule "CompanyInfo"
dialect "mvel"
when
CompanyBean( businessType == "ABC" , insuranceProgram == "XYZ" )
then
CompanyBean fact0 = new CompanyBean();
fact0.setBusinessType( "ABC" );
fact0.setInsuranceProgram( "XYZ" );
insert(fact0 );
end
I have only two options there 1. insert and 2. insert logically.
but on place of insert and insert logically I want to use "companyDivision" function.
Please guys tell me how it is possible.
Thanks