Project my-app:
- some POJOs and some business logic classes
- put only the POJOs from above project inside a jar
Import above jar into Guvnor
- define rules from user interface (UI), not like DRL file
- mock test pojo data in Guvnor
- test the rules
- publish/export the rules for execution in java runtime using drools API
import the rules into the my-app and execute it
- import the rules (WHAT will be the format of the import?)
execute the rules inside business logic using drools/KIE API as follows:
kSession.insert(pojoInstance); kSession.fireAllRules();
Is this a right approach? If not, can someone guide how this can be done?
Approach you mentioned looks good to me. I am not sure which version of drools you are using but if you are using Drools 7/6 then you can think of using kie-server. Kie-server provide REST API for rule execution and it support kie-Scanner API's through which you can update rules at runtime without downtime. It will save efforts of exporting rules/jar and using them in application.