Information Technology Reference
In-Depth Information
We can infer the following points from the preceding diagram:
• The runtime won't be stored at every single change, but after a specific method in-
vocation is completed. This means our runtime will only be storing itself when its
internal execution reaches a static return point. Think of it as a very complex,
configurable state machine, which will only be persisted after it reaches a defined
state.
• Every process in the runtime will be persisted only when it reaches a safe state.
That means, if we have multiple automatic steps and a few asynchronous steps in
a process, the process runtime will only be persisted at the asynchronous step's
wait states.
Internally, the JPA persistence strategy will store the process runtime separated in three
different entities:
SessionInfo : This class is a serialization of the KIE session, and it is persis-
ted exclusively from the command pattern whenever a method on the persistent
KIE session is invoked. It basically stores a byte array with the deserialized in-
formation of the KIE session at a particular state and an integer ID.
ProcessInstanceInfo : This class is a serialization of a specific process in-
stance's runtime information. It stores a byte array with the deserialized informa-
tion of the process instance runtime, its ID, state, and pending event information.
There is a special manager class used by the persistent KIE session, called
JPAProcessInstanceManager , which takes care of notifying the persisten-
ce of any changes the KIE session does to each process instance's internal status.
WorkItemInfo : This class stores information about a specific state in a process
instance. It specifically stores a byte array with the input and output information
of a step, its ID, a process instance it references, and the particular step's internal
state flag. There is a special manager class used by the persistent KIE session,
called JPAWorkItemManager , which takes care of notifying the persistence of
any changes in each step done by the KIE session.
In order for the JPA to be able to perform all the required steps to actually store the con-
tent of the KIE session and its components in a database, it requires certain configura-
tions:
• JPA implementations and jBPM6-related dependencies
• A data source with access to an existing database
• A persistence unit with all the entity mappings
• A transaction manager configuration
Search WWH ::




Custom Search