Drools 6.0 onwards a new approach is designed to create a Knowledge Base and a Knowledge Session compared to previous versions.
In our last post, we learned Drools Default KieSession example The below example will explain on how to create a Named KieSession
The Drools 6.0 project consists of a single meta data file META-INF/kmodule.xml. The file is located under the source folder as shown in below snapshot.
If the file is not located at the location
If the named session is not defined in kmodule.xml
By default, kc.newKieSession("namedKieSession") returns the object of org.drools.core.impl.StatefulKnowledgeSessionImpl class.
Below are the files that are required to fire the rules using KieSession