[rules-users] Drools with rules from database

Michael Anstis michael.anstis at gmail.com
Thu Aug 23 08:05:08 EDT 2012


Why not add EmployeeTypeSalary objects to Working Memory, then you only
need one static rule:-

when
  EmployeeTypeSalary( $et : emplyeeType, $s : salary )
  $e : Employee( employeeType ==  $et )
then
  modify($e) {
    setSalary( $s );
  }
end

EmployeeTypeSalary represents individual rows in your database.

With kind regards,

Mike

On 23 August 2012 12:57, debchamps <majumdar.debarghya at gmail.com> wrote:

> Hi
> I have the following requirement
>
> The rule is like if(employeeType == $1) set salary = $1
>
> emloyeeType                              salary
> ---------------                             ---------------
> MANAGER                                          100
> SR Manager                                        200
> Director                                              300
>
> Now new employeeType  gets added every day. So the requirement is to
>  update
> the knowledgebase without again activating the service.
>
> So how to achieve that with Drools. I am using Drools with a Decision table
> for a different requirement in the same project. So if it can be achieved
> with decision table it would be great(So new rows will get added to the
> decision table dynamically but no column in this case).
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-with-rules-from-database-tp4019357.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120823/14d76bd0/attachment.html 


More information about the rules-users mailing list