In my organization we have decided to use KieServer for running drools. We are not using kieworkbench, this is because we need more control over the deployment and should be aligned with related application. The ask is to externalize the condition check.
for example in rule like below, the check for "2008" will be stored in a Database
when
$customer:Customer(membersince <= "2008")
then
$customer.setOfferPercent("50%")
I have figured out a way to get this value 2008 from the database/inmemory cache implementation and change it as below. This will allow my operations/business to change such values without a deployment in the kie server and reduce lot of efforts
when
$customer:Customer(membersince <= cache.get("Member_Since_Elite"))
then
$customer.setOfferPercent("50%")
My Question is, Is there any other way to declare as global and auto populate the values when its changed in the database. I am hoping to do something like below by using annotations, and need some help.
declare Properties
member_since_elite : String @Property("member_since_elite")
end
when
$customer:Customer(membersince <= Properties.member_since_elite )
then
$customer.setOfferPercent("50%")
This way it will help me to auto inject the values from database/cache when ever its value changes.