Class SequenceNumberPlugin

  • All Implemented Interfaces:
    org.imixs.workflow.Plugin

    public class SequenceNumberPlugin
    extends org.imixs.workflow.engine.plugins.AbstractPlugin
    This Plugin handles a unique sequence number for a workItem. The current sequenceNumber for a workitem is based on the workflowGroup. The next free sequence number will be stored in the configuration Entity 'BASIC'. The configuration entity provides a property named 'sequencenumbers' with the current number range for each workflowGroup.

    If a WorkItem is assigned to a WorkflowGroup with no corresponding entry in the BASIC configuration, the Plugin will not compute a new number for the workitem.

    If the Workitem already have a sequence number, the plugin will not run.

    The new computed SequenceNumer will be stored into the property 'numsequencenumber'. To compute the sequence Number the plugin uses the SequeceService .

    Optimistic Locking Problem

    In earlier versions, the method runs in a OptimisticLockException in case that multiple processes run in parallel. To fix this the SequenceService was changed into a singleton. See issue #290.

    Version:
    2.0
    Author:
    rsoika
    See Also:
    SequenceService
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String NO_SEQUENCE_SERVICE_FOUND  
      • Fields inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin

        INVALID_ITEMVALUE_FORMAT, INVALID_PROPERTYVALUE_FORMAT
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.imixs.workflow.ItemCollection run​(org.imixs.workflow.ItemCollection documentContext, org.imixs.workflow.ItemCollection event)
      This method loads a sequence number object and increases the sequence number in the workItem.
      • Methods inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin

        close, getCtx, getWorkflowService, init, mergeFieldList, uniqueList
    • Field Detail

      • NO_SEQUENCE_SERVICE_FOUND

        public static String NO_SEQUENCE_SERVICE_FOUND
    • Constructor Detail

      • SequenceNumberPlugin

        public SequenceNumberPlugin()
    • Method Detail

      • run

        public org.imixs.workflow.ItemCollection run​(org.imixs.workflow.ItemCollection documentContext,
                                                     org.imixs.workflow.ItemCollection event)
                                              throws org.imixs.workflow.exceptions.PluginException
        This method loads a sequence number object and increases the sequence number in the workItem. If the workItem is form type'workitem' then the next sequecnenumer is computed based on the workflowGroup. If the workItem is from type='childworkitem' then the next sequencenumber is computed on the parent workItem.
        Returns:
        Throws:
        javax.mail.internet.AddressException
        org.imixs.workflow.exceptions.PluginException