The WorkflowKernel

The WorkflowKernel is the core component of the Imixs-Workflow API. The WorkflowKernel controls the flow of a process instance according to the process model definition. The WorkflowKernel is initialized by the Workflowmanager which provides the Model definition and also the plugins applied to the process model. To process a single Workitem the WorkflowKernel provides the public method process().

process(ItemCollection workitem) 

Registration of Workflow Plugins

In the processing phase of a WorkItem the WorkflowKernel calls the plug-ins registered by the WorkflowManager. To register a plug-in class the WorkflowKernel provides the method :


Plugins registered by the WorkflowManager will be called during the processing phase of a workitem. See the section Plugin API for further details about the plugin concept.

The registration of a plugin can be done ba instance of a plugin class or by the class name.

kernel = new WorkflowKernel(ctx);
// register plugin by name
// register plugin by instance
kernel.registerPlugin(new MyPlugin());
// process workitem

A plugin can also be injected by a CDI mechanism. Registered plugins are always each processing phase of a workitem. To unregister a single workItem the method unregisterPlugin can be called

// unregister plugin by name

The Processing Phase

By calling the method process() from the WorkflowKernel the processing phase or a WorkItem can be started. During the processing phase the WorkflowKernel loads all activity entities assigned to the current process status and performs a call-back life-cycle for all registered plugins. A plugin can extend the the processing phase by adding additional activities on the activity stack which is defined by the property ‘$activityidlist’ of the process instance. After the processing phase is finished the WorkflowKernel applies the new process status to the WorkItem depending on the process definition.

The WorkflowContext

The Interface org.imixs.workflow.WorkflowContext defines an abstraction of the workflow management system. The WorkflowContext is used by the WorkflowKernel to provide the runtime-environment information to registered plugins.

The WorkflowContext provides the following methods:

Method Description
getSessionContext() returns a session object (e.g. EJB Context or Web Session)
getModelManager() returns an instance of the model manager

The session context is platform specific, for example a surrounding EJB Context, a Web Module or a Spring Context. As the WorkflowKernel is part of the Imixs-Workflow core API it is a platform independent building block. Therefor the WorkflowContext builds a bridge between the Workflow System and the processing engine. For details about the concrete implementation see the WorkflowService implementation.

The Workflow Log

The Imixs WorkflowKernel generates a log entry during each processing phase with information about the current model version, the process entity and the processed workflow event. The log is stored in the property ‘txtWorkflowActivityLog’. The log entry has the following format:

ISO8601 Time | Model Version | Process.ActivityID |  NewProcessID | comment /optional)



The comment is an optional value which can be provided by a plugin. A comment is stored in the property ‘txtworkflowactivitylogComment’ of the current process instance. If no txtworkflowactivitylogComment attribute is provided the comment section will be empty.