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 ObjectThe 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]=123Optimistic 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 Classes Modifier and Type Class Description classSequenceService.SequenceNumberA SequenceNumber is a internal object separating a fixed part form a number part.
-
Field Summary
Fields Modifier and Type Field Description static StringITEM_SEQUENCENUMBERstatic StringITEM_SEQUENCENUMBER_DEPRECATED
-
Constructor Summary
Constructors Constructor Description SequenceService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputeSequenceNumber(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 Detail
-
ITEM_SEQUENCENUMBER
public static final String ITEM_SEQUENCENUMBER
- See Also:
- Constant Field Values
-
ITEM_SEQUENCENUMBER_DEPRECATED
public static final String ITEM_SEQUENCENUMBER_DEPRECATED
- See Also:
- Constant Field Values
-
-
Method Detail
-
computeSequenceNumber
public void computeSequenceNumber(org.imixs.workflow.ItemCollection documentContext) throws org.imixs.workflow.exceptions.AccessDeniedExceptionThis 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-
-
-