Forwarded to mailing list.<br><br>You would have to consider use of free-format DRL in this scenario.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b> <span dir="ltr">&lt;<a href="mailto:avneesh.sisodia@intelegencia.com">avneesh.sisodia@intelegencia.com</a>&gt;</span><br>
Date: 4 September 2012 12:33<br>Subject: how to import function in drl file on guvnor<br>To: <a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a><br><br><br>Hello mantis,<br>
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.<br>
Suppose I have a rule &quot;companyDivision&quot; and i want to import it into my rule file like this:<br>
<br>
package com.exp.test<br>
<br>
import com.abc.bean.CompanyBean<br>
import function<br>
        com.abc.util.Validation.companyDivision;<br>
<br>
rule &quot;CompanyInfo&quot;<br>
        dialect &quot;mvel&quot;<br>
        when<br>
                CompanyBean( businessType == &quot;ABC&quot; , insuranceProgram == &quot;XYZ&quot; )<br>
        then<br>
                CompanyBean fact0 = new CompanyBean();<br>
                fact0.setBusinessType( &quot;ABC&quot; );<br>
                fact0.setInsuranceProgram( &quot;XYZ&quot; );<br>
                companyDivision(fact0 );<br>
end<br>
<br>
<br>
How I can do this.<br>
I am doing following steps to c\generate rules::<br>
1. creating com.exp.test package<br>
2. uploading jar(model) file which included all pojo files of application<br>
3. creating &quot;CompanyInfo&quot; rule<br>
<br>
rule file generated by guvnor is like this:::<br>
<br>
package com.exp.test<br>
<br>
import com.abc.bean.CompanyBean<br>
<br>
<br>
rule &quot;CompanyInfo&quot;<br>
        dialect &quot;mvel&quot;<br>
        when<br>
                CompanyBean( businessType == &quot;ABC&quot; , insuranceProgram == &quot;XYZ&quot; )<br>
        then<br>
                CompanyBean fact0 = new CompanyBean();<br>
                fact0.setBusinessType( &quot;ABC&quot; );<br>
                fact0.setInsuranceProgram( &quot;XYZ&quot; );<br>
                insert(fact0 );<br>
end<br>
<br>
I have only two options there 1. insert and 2. insert logically.<br>
but on place of insert and insert logically I want to use &quot;companyDivision&quot; function.<br>
Please guys tell me how it is possible.<br>
Thanks<br>
</div><br>