Package org.imixs.workflow
Class WorkflowKernel
- java.lang.Object
-
- org.imixs.workflow.WorkflowKernel
-
public class WorkflowKernel extends Object
The Workflowkernel is the core component of this Framework to control the processing of a workitem. AWorkflowmanager
loads an instance of a Workflowkernel and hand over aModel
and registerPlugins
for processing one or many workitems.- Version:
- 1.1
- Author:
- Ralph Soika
- See Also:
WorkflowManager
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description WorkflowKernel(WorkflowContext actx)
Constructor initialize the contextObject and plugin vectors
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
eval(ItemCollection workitem)
Evaluates the next taskID for a process instance (workitem) based on the current model definition.static String
generateTransactionID()
This method generates an secure 8 byte random secure id.static String
generateUniqueID()
This method generates an immutable universally unique identifier (UUID).List<Plugin>
getPluginRegistry()
Returns a registry containing all registered plugin instances.List<ItemCollection>
getSplitWorkitems()
This method returns new SplitWorkitems evaluated during the last processing life-cycle.ItemCollection
process(ItemCollection workitem)
Processes a process instance (workitem) 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
unregisterAllPlugins()
This method removes all registered pluginsvoid
unregisterPlugin(String pluginClass)
This method removes a registered plugin based on its class name.
-
-
-
Field Detail
-
MISSING_WORKFLOWCONTEXT
public static final String MISSING_WORKFLOWCONTEXT
- See Also:
- Constant Field Values
-
UNDEFINED_PROCESSID
public static final String UNDEFINED_PROCESSID
- See Also:
- Constant Field Values
-
UNDEFINED_ACTIVITYID
public static final String UNDEFINED_ACTIVITYID
- See Also:
- Constant Field Values
-
UNDEFINED_WORKITEM
public static final String UNDEFINED_WORKITEM
- See Also:
- Constant Field Values
-
UNDEFINED_PLUGIN_ERROR
public static final String UNDEFINED_PLUGIN_ERROR
- See Also:
- Constant Field Values
-
ACTIVITY_NOT_FOUND
public static final String ACTIVITY_NOT_FOUND
- See Also:
- Constant Field Values
-
MODEL_ERROR
public static final String MODEL_ERROR
- See Also:
- Constant Field Values
-
PLUGIN_NOT_CREATEABLE
public static final String PLUGIN_NOT_CREATEABLE
- See Also:
- Constant Field Values
-
PLUGIN_NOT_REGISTERED
public static final String PLUGIN_NOT_REGISTERED
- See Also:
- Constant Field Values
-
PLUGIN_ERROR
public static final String PLUGIN_ERROR
- See Also:
- Constant Field Values
-
ISO8601_FORMAT
public static final String ISO8601_FORMAT
- See Also:
- Constant Field Values
-
UNIQUEID
public static final String UNIQUEID
- See Also:
- Constant Field Values
-
UNIQUEIDSOURCE
public static final String UNIQUEIDSOURCE
- See Also:
- Constant Field Values
-
UNIQUEIDVERSIONS
public static final String UNIQUEIDVERSIONS
- See Also:
- Constant Field Values
-
WORKITEMID
public static final String WORKITEMID
- See Also:
- Constant Field Values
-
MODELVERSION
public static final String MODELVERSION
- See Also:
- Constant Field Values
-
TRANSACTIONID
public static final String TRANSACTIONID
- See Also:
- Constant Field Values
-
PROCESSID
@Deprecated public static final String PROCESSID
Deprecated.- See Also:
- Constant Field Values
-
TASKID
public static final String TASKID
- See Also:
- Constant Field Values
-
EVENTID
public static final String EVENTID
- See Also:
- Constant Field Values
-
ACTIVITYIDLIST
public static final String ACTIVITYIDLIST
- See Also:
- Constant Field Values
-
WORKFLOWGROUP
public static final String WORKFLOWGROUP
- See Also:
- Constant Field Values
-
WORKFLOWSTATUS
public static final String WORKFLOWSTATUS
- See Also:
- Constant Field Values
-
ISVERSION
public static final String ISVERSION
- See Also:
- Constant Field Values
-
LASTTASK
public static final String LASTTASK
- See Also:
- Constant Field Values
-
LASTEVENT
public static final String LASTEVENT
- See Also:
- Constant Field Values
-
LASTEVENTDATE
public static final String LASTEVENTDATE
- See Also:
- Constant Field Values
-
CREATOR
public static final String CREATOR
- See Also:
- Constant Field Values
-
EDITOR
public static final String EDITOR
- See Also:
- Constant Field Values
-
LASTEDITOR
public static final String LASTEDITOR
- See Also:
- Constant Field Values
-
CREATED
public static final String CREATED
- See Also:
- Constant Field Values
-
MODIFIED
public static final String MODIFIED
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
MAXIMUM_ACTIVITYLOGENTRIES
public static final int MAXIMUM_ACTIVITYLOGENTRIES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WorkflowKernel
public WorkflowKernel(WorkflowContext actx)
Constructor initialize the contextObject and plugin vectors
-
-
Method Detail
-
generateUniqueID
public static String generateUniqueID()
This method generates an immutable universally unique identifier (UUID). A UUID represents a 128-bit value.- Returns:
- UUID
-
generateTransactionID
public static String generateTransactionID()
This method generates an secure 8 byte random secure id. The ID is returned as a hex decimal value.- Returns:
- transactionID
-
registerPlugin
public void registerPlugin(Plugin plugin) throws PluginException
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
public void registerAdapter(Adapter adapter)
This method registers a new adapter class.- Parameters:
adapterClass
-
-
registerPlugin
public void registerPlugin(String pluginClass) throws PluginException
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
public void unregisterPlugin(String pluginClass) throws PluginException
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
public List<Plugin> getPluginRegistry()
Returns a registry containing all registered plugin instances.- Returns:
-
process
public ItemCollection process(ItemCollection workitem) throws PluginException, ModelException
Processes a process instance (workitem) based on the current model definition. A Workitem must at least provide the properties $TASKID and $EVENTID.During the processing life-cycle more than one event can be processed. This depends on the model definition which can define follow-up-events, split-events and conditional events.
The method executes all plugin and adapter classes and returns an updated instance of the workitem. But the method did not persist the process instance. The persitance mechanism is covered by the WorkflowService.
- Parameters:
workitem
- the process instance to be processed.- Returns:
- updated workitem
- Throws:
PluginException
ModelException
-
eval
public int eval(ItemCollection workitem) throws PluginException, ModelException
Evaluates the next taskID for a process instance (workitem) based on the current model definition. A Workitem must at least provide the properties $TASKID and $EVENTID.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 plugin or adapter class.
- Parameters:
workitem
- the process instance to be evaluated.- Returns:
- result TaskID
- Throws:
PluginException
ModelException
-
getSplitWorkitems
public List<ItemCollection> getSplitWorkitems()
This method returns new SplitWorkitems evaluated during the last processing life-cycle.- Returns:
-
-