Sid Muthiah
Sid Muthiah

Reputation: 53

Integrate rule from Guvnor into Java

  1. Project my-app:

    • some POJOs and some business logic classes
    • put only the POJOs from above project inside a jar
  2. 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
  3. 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?

Upvotes: 0

Views: 129

Answers (1)

Abhijit Humbe
Abhijit Humbe

Reputation: 1631

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.

Upvotes: 0

Related Questions