You will need to insert both Employee and EmployeeTypeSalary objects into WM:-<br><br>Employee( "manager" )<br>Employee( "director" )<br>EmployeeTypeSalary( "manager", 100 )<br>EmployeeTypeSalary( "director", 300 )<br>
<br>You won't need any more rules than the one shown. This rule will not need to be changed.<br><br>Just insert your reference data (EmployeeTypeSalary) and employee data (Employee) into Working Memory.<br><br>How you get both the reference data and employee data is up to you. I'm not about to embark on JDBC\JPA etc lessons.<br>
<br><div class="gmail_quote">On 23 August 2012 15:16, debchamps <span dir="ltr"><<a href="mailto:majumdar.debarghya@gmail.com" target="_blank">majumdar.debarghya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So the thing is I will have rules like<br>
<div class="im"><br>
when<br>
EmployeeTypeSalary( $et : emplyeeType, $s : salary )<br>
$e : Employee( employeeType == $et )<br>
then<br>
modify($e) {<br>
setSalary( $s );<br>
}<br>
end<br>
<br>
<br>
</div>But by taking the value from db the rules will look like<br>
if(employesalary.color == "manager")<br>
employesalary.salary = 100<br>
<br>
if(employesalary.color == "director")<br>
employesalary.salary = 300<br>
<br>
There is only one template<br>
<br>
But I want to take this rules from db i.e<br>
employee salary<br>
-------------------<br>
manager 100<br>
director 300<br>
<br>
<br>
For this I need some reference/example specially for connecting Drools with<br>
db and how the things work.<br>
<br>
Thanks,<br>
Deb<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools-with-rules-from-database-tp4019357p4019361.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-with-rules-from-database-tp4019357p4019361.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>