KIE Demo Workbench :: Basic concepts

 

Process models are used as templates for Process Instances.
For example:
which have the following xml representation:

To separate the static Process Models from their dynamic runtime versions (Process Instances), they live in two different entities: Process models live in a Kie Base (or Knowledge Base) and their data cannot be changed by the Process Engine; Process instances live in a Kie Session (or Knowledge Session) which exists in the Process Engine and contains the runtime data, which are changed during runtime by the Process Engine.
Load and execute process (interaction with the process engine):
  • create knowledge base
    • load all the necessary process definitions,
    • knowledge base contains references to process definitions
  • set up a session
    • session communicates with the process engine
    • session starts executiong processes
    • session has a reference to a knowledge base
  • start process instance
Comments:
  • Knowledge base:
    • usually is created only once
    • it is heavy-weight process
    • it involves parsing and compiling the process definitions
    • is (can be) shared across sessions
    • process definitions can be added or removed at runtime
  • Session:
    • you can create as many sessions as you need (example: for customer to be independent from processes for another customer)
Code excerpt:

In addition to the above – interfaces with comments:
KnowledgeBase:

KieBase:

StatefulKnowledgeSession:

 

Leave a Reply