droolskiedrools-guvnorredhat-brms

How to get Rule Definition from DRL File in BRMS


Is there a way to get a rule definition from a DRL file in JBOSS BRMS using rest or java API? I have a Kie server where my container is loaded, can I get the rule file definition from the container using API or REST call.

We are using 6.5.0.Final-redhat-2 version of KIE and 6.4.0.GA version for BRMS


Solution

  • There is no KieServer API to return a DRL resource as of today. If you have the DRL file or the kjar containing the file, you can use the parser API to retrieve the rue definition:

    Here are some test cases with examples of how to use the parser to inspect rules:

    https://github.com/kiegroup/drools/blob/6.5.0.Final/drools-compiler/src/test/java/org/drools/compiler/lang/RuleParserTest.java