Class WorkflowKernel
The WorkflowKernel operates on a Open BPMN model instance to navigate through
a BPMN 2.0 model. The model instance is identified by the attribute
$modelversion. The WorkflowKernel expects a WorkflowContext
to
access the ModelManager
and the runtime environment.
An implementation of the WorkflowManager
typical creates an instance
of a WorkflowKernel and register Plugin
and Adapter
classes
to be executed during the processing life cycle of one or many workItems.
- Version:
- 2.0
- Author:
- Ralph Soika
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Deprecated.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
ConstructorDescriptionConstructor initialize the contextObject and plugin vectors -
Method Summary
Modifier and TypeMethodDescriptioneval
(ItemCollection _workitem) Evaluates the next task BPMN element for a process instance (workitem) based on the current model definition.static String
This method generates an secure 8 byte random secure id.static String
This method generates an immutable universally unique identifier (UUID).Returns a registry containing all registered Adapter instances.Returns a registry containing all registered plugin instances.This method returns new SplitWorkitems evaluated during the last processing life-cycle.process
(ItemCollection workitem) This method processes a workitem (process instance) based on the current model definition.void
registerAdapter
(Adapter adapter) This method registers a new adapter class.void
registerPlugin
(String pluginClass) This method registers a new plugin based on class name.void
registerPlugin
(Plugin plugin) This method registers a new plugin class.void
This method removes all registered pluginsvoid
unregisterPlugin
(String pluginClass) This method removes a registered plugin based on its class name.
-
Field Details
-
MISSING_WORKFLOWCONTEXT
- See Also:
-
UNDEFINED_PROCESSID
- See Also:
-
UNDEFINED_ACTIVITYID
- See Also:
-
UNDEFINED_WORKITEM
- See Also:
-
UNDEFINED_PLUGIN_ERROR
- See Also:
-
ACTIVITY_NOT_FOUND
- See Also:
-
MODEL_ERROR
- See Also:
-
PLUGIN_NOT_CREATEABLE
- See Also:
-
PLUGIN_NOT_REGISTERED
- See Also:
-
PLUGIN_ERROR
- See Also:
-
ADAPTER_ERROR_CONTEXT
- See Also:
-
ADAPTER_ERROR_CODE
- See Also:
-
ADAPTER_ERROR_PARAMS
- See Also:
-
ADAPTER_ERROR_MESSAGE
- See Also:
-
ISO8601_FORMAT
- See Also:
-
UNIQUEID
- See Also:
-
UNIQUEIDSOURCE
- See Also:
-
UNIQUEIDVERSIONS
- See Also:
-
WORKITEMID
- See Also:
-
MODELVERSION
- See Also:
-
TRANSACTIONID
- See Also:
-
PROCESSID
Deprecated.- See Also:
-
TASKID
- See Also:
-
EVENTID
- See Also:
-
INTERMEDIATE_EVENTID
- See Also:
-
INTERMEDIATE_EVENT_ELEMENTID
- See Also:
-
WORKFLOWGROUP
- See Also:
-
WORKFLOWSTATUS
- See Also:
-
ISVERSION
- See Also:
-
LASTTASK
- See Also:
-
LASTEVENT
- See Also:
-
LASTEVENTDATE
- See Also:
-
CREATOR
- See Also:
-
EDITOR
- See Also:
-
LASTEDITOR
- See Also:
-
EVENTLOG
- See Also:
-
EVENTLOG_COMMENT
- See Also:
-
CREATED
- See Also:
-
MODIFIED
- See Also:
-
TYPE
- See Also:
-
-
Constructor Details
-
WorkflowKernel
Constructor initialize the contextObject and plugin vectors
-
-
Method Details
-
generateUniqueID
This method generates an immutable universally unique identifier (UUID). A UUID represents a 128-bit value.- Returns:
- UUID
-
generateTransactionID
This method generates an secure 8 byte random secure id. The ID is returned as a hex decimal value.- Returns:
- transactionID
-
registerPlugin
This method registers a new plugin class. The method throws a PluginException if the class can not be registered. If the new Plugin implements the PluginDependency interface, the method validates dependencies.- Parameters:
pluginClass
-- Throws:
PluginException
-
registerAdapter
This method registers a new adapter class.- Parameters:
adapterClass
-
-
registerPlugin
This method registers a new plugin based on class name. The plugin will be instantiated by its name. The method throws a PluginException if the plugin class can not be created.- Parameters:
pluginClass
-- Throws:
PluginException
-
unregisterPlugin
This method removes a registered plugin based on its class name.- Parameters:
pluginClass
-- Throws:
PluginException
- if plugin not registered
-
unregisterAllPlugins
public void unregisterAllPlugins()This method removes all registered plugins- Parameters:
pluginClass
-
-
getPluginRegistry
Returns a registry containing all registered plugin instances.- Returns:
-
getAdapterRegistry
Returns a registry containing all registered Adapter instances.- Returns:
-
process
This method processes a workitem (process instance) based on the current model definition. A workitem must at least provide the properties$ModelVersion
,$TaskID
and$EventID
.During the processing life-cycle more than one event can be processed. This depends on the model definition which is controlled by the
ModelManager
. For example an event can be followed by another event in the process flow. Also conditional events can have different outcomes depending on the data of a workitem.The method executes all plugin and adapter classes and returns an updated instance of the workitem. The method did not persist the process instance. The persistance mechanism is covered by the
WorkflowService
witch is not part of this core project.- Parameters:
workitem
- the process instance to be processed.- Returns:
- updated workitem
- Throws:
PluginException
ModelException
-
eval
Evaluates the next task BPMN element for a process instance (workitem) based on the current model definition. A Workitem must at least provide the properties$TaskID
and a$EventID
or$intermediateEventID
.During the evaluation life-cycle more than one event can be evaluated. This depends on the model definition which can define follow-up-events, split-events and conditional events.
The method did not persist the process instance or execute any plugins or adapter classes.
- Parameters:
workitem
- the process instance to be evaluated.- Returns:
- the BPMN task element followed by the given execution flow
- Throws:
PluginException
ModelException
-
getSplitWorkitems
This method returns new SplitWorkitems evaluated during the last processing life-cycle.- Returns:
-