To check and retrieve the build results for a list of severities, the Knowledge Builder API offers a couple of methods: /** * Return the knowledge builder results for the listed severities.* @param severities * @return */ Knowledge Builder Results get Results(Result Severity...Instead of adding the resources to create definitions programmatically it is also possible to do it by configuration, via the Change Set XML.The simple XML file supports three elements: add, remove, and modify, each of which has a sequence of prefix, which signifies the protocol for the resource.// sets the severity of rule updates to error Option( KBuilder Severity Option.get( "drools.kbuilder.severity.duplicate Rule", Result Severity.ERROR ) ); // sets the severity of function updates to error Option( KBuilder Severity Option.get( "drools.kbuilder.severity.duplicate Function", Result Severity.As of this version, Drools supports configurable result severity for rule updates and function updates.
The options parameter can be used for things like changing the dialect or registering new accumulator functions.
Moreover, the Knowledge Builder (regardless if you are using the batch mode or not) also allows to discard what has been added with the last DRL(s) build.
This can be useful to recover from having added an erroneous DRL to the Knowledge Builder, as shown below.
It is a best practice to check the compilation results after each resource addition.
The Knowledge Builder can report compilation results of 3 different severities: ERROR, WARNING and INFO.