Package org.imixs.marty.plugins
Class SequenceNumberPlugin
java.lang.Object
org.imixs.workflow.engine.plugins.AbstractPlugin
org.imixs.marty.plugins.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:
-
Field Summary
FieldsFields inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin
INVALID_ITEMVALUE_FORMAT, INVALID_PROPERTYVALUE_FORMAT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.imixs.workflow.ItemCollectionrun(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 Details
-
NO_SEQUENCE_SERVICE_FOUND
-
-
Constructor Details
-
SequenceNumberPlugin
public SequenceNumberPlugin()
-
-
Method Details
-
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:
jakarta.mail.internet.AddressExceptionorg.imixs.workflow.exceptions.PluginException
-