Interface InstanceChanging
-
public interface InstanceChanging
InstanceChanging
provides the means for retrieving changeable instances and committing (or aborting) the changes afterwards. This has to be done in theExecutionManager
since the state of the instance has to be checked (instances with running process steps may not be changed), worklist managers have to be notified (removal and adding of worklist items) and theDataManager
may need to adapt the data containers accordingly to the changes of the data flow.- Author:
- Ulrich Kreher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abortInstanceChanging(SessionToken session, UUID instanceID)
Aborts changing the instance, unlocks and resumes the instance and informs the worklist managers accordingly.ChangeReport
changeAndUnlockInstance(SessionToken session, ChangeableInstance instance, Locale... locales)
Validates the instance and if this is successful, the designated instance will be changed, unlocked, resumed and the worklist and data managers will be informed about the new instance structure and state.ChangeReport
changeInstance(SessionToken session, ChangeableInstance instance, Locale... locales)
Validates the instance and if this is successful, the designated instance will be changed and the worklist and data managers will be informed about the new instance structure and state.ChangeableInstance
getInstanceForChanging(SessionToken session, UUID instanceID)
Gets a process instance that may be changed after retrieval.void
unlockChangeableInstance(SessionToken session, UUID instanceID)
Unlocks and resumes the instance without affecting any made changes, that is previously committed changes are persisted, uncommitted changes are dropped.
-
-
-
Method Detail
-
getInstanceForChanging
ChangeableInstance getInstanceForChanging(SessionToken session, UUID instanceID) throws InvalidInstanceStateException
Gets a process instance that may be changed after retrieval. The process instance is locked for execution and all further manipulation by the designated user while it is modified. This includes the removal of the corresponding worklist items by suspending the instance. It is mandatory to unlock the instance afterwards!
In case of problems while retrieving the instance for changing, the instance will be resumed.- Parameters:
session
- The session which is used to check for access rights on this method and to identify the locking agent and the corresponding organisational position.instanceID
- The unique ID of the process instance to retrieve and lock for changing it.- Returns:
- An instance that may be changed after retrieval.
- Throws:
InvalidInstanceStateException
- If the instance cannot be locked due to its state, for instance it has running activities.ADEPT2ServiceException
- If the designated instance is already locked for execution or changes (except for changes by the designated user), anADEPT2ServiceException
will be thrown.
-
changeAndUnlockInstance
ChangeReport changeAndUnlockInstance(SessionToken session, ChangeableInstance instance, Locale... locales)
Validates the instance and if this is successful, the designated instance will be changed, unlocked, resumed and the worklist and data managers will be informed about the new instance structure and state. If the validation fails, the instance will remain locked and unchanged.- Parameters:
session
- The session which is used to check for access rights on this method and to identify the unlocking agent and the corresponding organisational position.instance
- An instance that has been changed and is still locked.locales
- The locales the change report should provide (or at least a fallback of each). If this isnull
,Locale.ROOT
will be used.- Returns:
- A change report providing information on the validity of the instance as well as its new ID if the change has been successful.
- Throws:
ADEPT2ServiceException
- If the designated instance is not locked by the designated user or locked for execution, aADEPT2ServiceException
will be thrown.
-
changeInstance
ChangeReport changeInstance(SessionToken session, ChangeableInstance instance, Locale... locales)
Validates the instance and if this is successful, the designated instance will be changed and the worklist and data managers will be informed about the new instance structure and state. If the validation fails, the instance will remain unchanged. The instance remains locked, so use this method if you want to commit the actual changes but keep a lock for further changes, otherwise usechangeAndUnlockInstance(SessionToken, ChangeableInstance, Locale...)
.- Parameters:
session
- The session which is used to check for access rights on this method and to identify the unlocking agent and the corresponding organisational position.instance
- An instance that has been changed and is still locked.locales
- The locales the change report should provide (or at least a fallback of each). If this isnull
,Locale.ROOT
will be used.- Returns:
- A change report providing information on the validity of the instance as well as its new ID if the change has been successful.
- Throws:
ADEPT2ServiceException
- If the designated instance is not locked by the designated user or locked for execution, aADEPT2ServiceException
will be thrown.
-
unlockChangeableInstance
void unlockChangeableInstance(SessionToken session, UUID instanceID)
Unlocks and resumes the instance without affecting any made changes, that is previously committed changes are persisted, uncommitted changes are dropped. The worklist managers will be informed accordingly.- Parameters:
session
- The session which is used to check for access rights on this method and to identify the unlocking agent and the corresponding organisational position.instanceID
- The ID of a a locked instance that has been changed viachangeInstance(SessionToken, ChangeableInstance, Locale...)
or of which the changes are to be aborted.- Throws:
ADEPT2ServiceException
- If the designated instance is not locked by the designated user or locked for execution, aADEPT2ServiceException
will be thrown.
-
abortInstanceChanging
void abortInstanceChanging(SessionToken session, UUID instanceID)
Aborts changing the instance, unlocks and resumes the instance and informs the worklist managers accordingly.- Parameters:
session
- The session which is used to check for access rights on this method and to identify the unlocking agent and the corresponding organisational position.instanceID
- A locked instance that should be changed but the change is aborted.- Throws:
ADEPT2ServiceException
- If the designated instance is not locked by the designated user or locked for execution, aADEPT2ServiceException
will be thrown.
-
-