Hello,
> - How we can execute rules using Drools at runtime.
Do you mean a simple usage?
You can find it in getting started section (latest version 8, RuleUnit API).
https://docs.drools.org/latest/drools-docs/docs-website/drools/getting-started/index.html#first-rule-project_getting-startedOr this blog post is based on a little old version (7.61.0, traditional API), but contains various examples.
https://blog.kie.org/2021/11/drools-basic-examples.html
> - Is it good practice to keep rules into Database.
An usual practice is to manage rules with version control system and build them with kie-maven-plugin to create a kjar.
But I see some users keep rules into database and build them programmatically.
> - How to run multiple .drl files into same application (module wise) like payments, customers, mortgage, etc.
It's just fine to have multiple .drl files and build a kbase. Also you may split them to multiple kbases if those rules are logically separated.
> - In which scenario we should use multiple sessions/ containers to execute rules.
Firstly, it's common to create multiple sessions when you handle multiple web requests concurrently.
If you think about using multiple sessions for one request, it may be the case which I described above as multiple kbases. In that case, you would create one ksession from one kbase.
I hope this helps.
Regards,
Toshiya
2023年2月21日火曜日 14:03:23 UTC+9 Deepak Sharma: