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. A Workflowmanager loads an instance of a Workflowkernel and hand over a Model and register Plugins for processing one or many workitems.
Version:
1.1
Author:
Ralph Soika
See Also:
  • Field Details

  • Constructor Details

    • WorkflowKernel

      public WorkflowKernel(WorkflowContext actx)
      Constructor initialize the contextObject and plugin vectors
  • Method Details

    • 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: