3.7. Defining KIE Bases and Sessions
A KIE base is a repository of the application’s knowledge definitions. It contains rules, processes, functions, and type models. A KIE base does not contain runtime data, instead sessions are created from the KIE base into which data can be inserted and process instances started.
A KIE session stores runtime data created from a KIE base. See the KIE Sessions chapter of the Red Hat JBoss BPM Suite Development Guide for more information.
You can create KIE bases and sessions by editing the
kmodule.xml project descriptor file of your project.You can do so through Business Central or by editing
kmodule.xml in the
src/main/resources/META-INF/ folder by navigating through the
Defining KIE Bases and Sessions in the Project Editor
To define a KIE base or session in Business Central, do the following:
- Click Authoring → Project Authoring and navigate to your project.
- In the Project Explorer window, click Open Project Editor.
Click Project Settings: Project General Settings → Knowledge bases and sessions. This view provides a user interface for changing
Click Add to define and add your bases.
After you enter a name for your Knowledge Base, add Packages. For including all packages, click Add below Packages and enter asterisk
- After you enter a name for your Knowledge Base, add Packages. For including all packages, click Add below Packages and enter asterisk
- Below Knowledge Sessions, click Add and enter the name of your session.
Defaultand select appropriate state.
For Red Hat JBoss BRMS, you can choose between
statelessif you do not need iterative invocations of the facts. Otherwise, use
- Click Save in the top right corner once you are done.
Defining KIE Bases and Sessions in kmodule.xml
To define a KIE base or session by editing
kmodule.xml, do the following:
Open the repository view for your project.
Figure 3.4. Changing to Repository View
/src/main/resources/META-INF. Click on
kmodule.xmlto edit the file directly.
ksessions. For example:
<kmodule xmlns="http://www.drools.org/xsd/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <kbase name="myBase" default="true" eventProcessingMode="stream" equalsBehavior="identity" packages="*"> <ksession name="mySession" type="stateless" default="true" clockType="realtime"/> </kbase> </kmodule>
- Click save in the top right corner.
You can switch between the Project Editor view and the Repository view to look at the changes you make in each view. To do so, close and reopen the view each time a change is made.