I knew I was on dangerous ground :)<br><br>Thanks Wolfgang for tying up my loose end.<br><br>At least you didn&#39;t change it to employesalary.color == &quot;director&quot; which would have confused me ;)<br><br><div class="gmail_quote">
On 23 August 2012 19:01, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div class="im">On 23 August 2012 17:08, Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

You will need to insert both Employee and EmployeeTypeSalary objects into WM:-<br><br>Employee( &quot;manager&quot; )<br>Employee( &quot;director&quot; )<br>EmployeeTypeSalary( &quot;manager&quot;, 100 )<br>EmployeeTypeSalary( &quot;director&quot;, 300 )<br>


<br>You won&#39;t need any more rules than the one shown. This rule will not need to be changed.<br></blockquote></div><div><br>Only a little :)<br><br>The way it is written it will loop. Either add the rule attribute<br>
   no-loop true<br>
or<br>    $e : Employee( employeeType ==  $et, salary == null )<br>or<br>    $e : Employee( employeeType ==  $et, salary == 0 )<br>depending on the type if Employee.salary.<span class="HOEnZb"><font color="#888888"><br><br>
-W<br><br> </font></span></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<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&#39;m not about to embark on JDBC\JPA etc lessons.<div>

<div><br>
<br><div class="gmail_quote">On 23 August 2012 15:16, debchamps <span dir="ltr">&lt;<a href="mailto:majumdar.debarghya@gmail.com" target="_blank">majumdar.debarghya@gmail.com</a>&gt;</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><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 == &quot;manager&quot;)<br>
employesalary.salary = 100<br>
<br>
if(employesalary.color == &quot;director&quot;)<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><div>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" target="_blank">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>
</div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br></blockquote></div></div></div><br>
<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>
<br></blockquote></div><br>