Download - All IT eBooks

Transcript
Chapter 5
• Facts: Data that can be added to the Kie session and then updated or
removed (retracted). This information is inserted, technically speaking, into
the session through channels named entry points, and evaluated according
to the Drools business rules, for activation. Drools Agenda manages the rule
activation and firing mechanism.
Please refer to Drools reference documentation for additional
details on facts, rules, entry points, Agenda, and the Drools
rule engine in general: https://docs.jboss.org/drools/
release/6.2.0.Final/drools-docs/html. Drools and jBPM
are complementary projects that integrate together very nicely.
Variables and globals are accessed through context-type implicit references made
available to the jBPM constructs at runtime:
• ProcessContext (kcontext): This gives you access to variables
• KieRuntime (kcontext.getKieRuntime()): This gives you access to globals
and facts
There are no implementation constraints on parameters, variables, and global class
types apart from implementing the java.io.Serialization interface. Remember in
fact that jBPM uses the standard in-memory serialization mechanism (readObject/
writeObject). When we enable persistence, it features an additional custom object
marshalling mechanism to and from the store for session and process instances (see
Marshalling in Chapter 7, Customizing and Extending jBPM). Furthermore, when there
are persisting process variables for auditing and logging (VARIABLEINSTANCELOG
table), jBPM stores the values by calling the process variable toString() method.
jBPM does not provide out-of-the-box process variable persistence
in any of its schema tables. We need to implement our ad-hoc
variable serialization strategy (we will cover variables persistence
with Marshalling in Chapter 7, Customizing and Extending jBPM.).
[ 127 ]