Information Technology Reference
In-Depth Information
Here, we can see that we have two implementations of a
KieSession
interface:
StatefulKnowledgeSessionImpl
, which is the real implementation of a KIE ses-
sion, and
CommandBasedStatefulKnoweldgeSession
, which is the command
pattern adaptation of the KIE session interface. The latter will implement each method by
creating a specific
Command
object and assigning its execution to a
CommandService
object.
The actual implementation used by the JPA persistent KIE session is called
SingleSessionCommandService
, and it provides a wrapper around the KIE ses-
sion command execution that creates a database transaction before the command execu-
tion, serializes the actual KIE session object to a persistent object, and commits the trans-
action.
The
SingleSessionCommandService
session doesn't directly implement the trans-
action management, but it has an
Interceptor
list that defines all the different method
Human Interactions
uses.
Eventually, the interaction between persistence and the KIE session activity happens on a
per-method invocation basis, as shown in the following diagram: