Information Technology Reference
In-Depth Information
How does persistence work?
So far, we've seen how to start a persistent KIE session using helper classes from the
jBPM6 API. We are now going to take some time to understand the components that are
generated by those helper classes. Understanding the internal composition of a persistent
KIE session will help you understand how and when the persistence is being used, and it
will help you to easily detect problems in your persistence configuration.
Persistence is provided to a KIE session is through a specific set of adapters that use a
command pattern implementation. Command pattern shows that every operation is encap-
sulated by a single contract (specifically, a Command interface with an execute method).
Using this contract, you can implement different Command objects for all the different
methods of a class (in our case, the KIE session). Then, you can decorate every method in-
vocation by just deriving each command execution through another class, called a Com-
mandService , which will have the responsibility of knowing what you have to do before
and/or after each command execution.
An example of how this is done to provide a persistent KIE session can be seen in the fol-
lowing class diagram:
Search WWH ::




Custom Search