Question: for a single lookup like the one shown in the rule you reference, do you want to add another technology to your stack (or rather code that in Java)?
You will need to insert both Employee and EmployeeTypeSalary objects into WM:-
Employee( "manager" )
Employee( "director" )
EmployeeTypeSalary( "manager", 100 )
EmployeeTypeSalary( "director", 300 )
You won't need any more rules than the one shown. This rule will not need to be changed.
Just insert your reference data (EmployeeTypeSalary) and employee data (Employee) into Working Memory.
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.
On 23 August 2012 15:16, debchamps <majumdar.debarghya@gmail.com> wrote:So the thing is I will have rules like
But by taking the value from db the rules will look like
when
EmployeeTypeSalary( $et : emplyeeType, $s : salary )
$e : Employee( employeeType == $et )
then
modify($e) {
setSalary( $s );
}
end
if(employesalary.color == "manager")
employesalary.salary = 100
if(employesalary.color == "director")
employesalary.salary = 300
There is only one template
But I want to take this rules from db i.e
employee salary
-------------------
manager 100
director 300
For this I need some reference/example specially for connecting Drools with
db and how the things work.
Thanks,
Deb
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-with-rules-from-database-tp4019357p4019361.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users