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.AbstractPluginThis 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 StringNO_SEQUENCE_SERVICE_FOUND
-
Constructor Summary
Constructors Constructor Description SequenceNumberPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.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.
-
-
-
Field Detail
-
NO_SEQUENCE_SERVICE_FOUND
public static String NO_SEQUENCE_SERVICE_FOUND
-
-
Method Detail
-
run
public org.imixs.workflow.ItemCollection run(org.imixs.workflow.ItemCollection documentContext, org.imixs.workflow.ItemCollection event) throws org.imixs.workflow.exceptions.PluginExceptionThis 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.AddressExceptionorg.imixs.workflow.exceptions.PluginException
-
-