2
votes

This is where I am at: I am using Drools 6.2 and calling drools engine remotely via KIE Execution Server running on jboss. I used workbench to create my initial drl file and fact objects and then used Build & Deploy option of workbench to create and deploy the jar file. I then created the container using the jar file and got the end point that I am using to access the rule engine from my client application. At this point every thing is working fine and I am able to fire the rules remotely.

My requirement is to modify the rules file (.drl) outside the workbench, let's say in notepad and update the container with this new drl file. Is there an easy way to create the jar file programmatically that i can deploy to the central maven repository? I can then run the KIE scanner to look for the latest version of my jar file and automatically update my container. Or is there another recommended way to update the running container with an updated .drl file?

My client application is not in Java so I am not looking for an integrated solution where I can write java code to create the knowledge base and use kie builder to build the drl file.

1

1 Answers

0
votes

Is there an easy way to create the jar file programmatically that i can deploy to the central maven repository?

2 options that I can think of, one "easy" and one not so much:

Option 1

Use Maven and the maven drools plugin (you don't have to write Java code, just create your maven project and run mvn package to get a jar. See here: https://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/KIEChapter.html#KIEModuleIntroductionBuildingIntroductionSection

Option 2 A JAR file is simply a zip file with a specified structure. That means that you should be able to update your whatever.drl file, put it in the directory structure that the KIE server expects and deploy it.

For instance, create a directory structure like:

META-INF/kmodule.xml
com/site/project/drools/rules/myrule/SomeRule.drl

Zip those files into somefile.jar and deploy it.