Package org.imixs.workflow.office.util
Class SequenceService
java.lang.Object
org.imixs.workflow.office.util.SequenceService
@DeclareRoles({"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"})
@RolesAllowed({"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"})
@RunAs("org.imixs.ACCESSLEVEL.MANAGERACCESS")
public class SequenceService
extends Object
The SequcneceService is a singleton EJB which handles continuous
sequenceNumbers for a workitem separated for each workflowGroup.
The sequence numbers are stored in the item 'sequencenumbers' of the configuration entity with the name "BASIC" in in the following format
[GROUP]=123
Optimistic Locking Problem
In earlier versions, the method runs in a OptimisticLockException in case that multiple processes run in parallel. To fix this the service is changed into a singleton. See issue #290.
- Author:
- rsoika
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA SequenceNumber is a internal object separating a fixed part form a number part. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputeSequenceNumber(org.imixs.workflow.ItemCollection documentContext) This method computes the sequence number based on a configuration entity with the name "BASIC".booleanhasSequenceNumber(org.imixs.workflow.ItemCollection documentContext) This method verifies if a sequence number already exists.
-
Field Details
-
ITEM_SEQUENCENUMBER
- See Also:
-
ITEM_SEQUENCENUMBER_DEPRECATED
- See Also:
-
-
Constructor Details
-
SequenceService
public SequenceService()
-
-
Method Details
-
computeSequenceNumber
public void computeSequenceNumber(org.imixs.workflow.ItemCollection documentContext) throws org.imixs.workflow.exceptions.AccessDeniedException This method computes the sequence number based on a configuration entity with the name "BASIC". The configuration provides a property 'sequencenumbers' with the current number range for each workflowGroup. If a Workitem have a WorkflowGroup with no corresponding entry the method will not compute a new number.This method loads and updates the configuration entity in a new transaction. In combination with the
- Throws:
InvalidWorkitemExceptionorg.imixs.workflow.exceptions.AccessDeniedException
-
hasSequenceNumber
public boolean hasSequenceNumber(org.imixs.workflow.ItemCollection documentContext) This method verifies if a sequence number already exists.The method also migrate the old item name 'numsequencenumber' into the new item name 'sequencenumber'
- Parameters:
documentContext-
-