Class ReadonlyProcessEngine
java.lang.Object
com.aquima.interactions.process.wrapper.ProcessEngineDelegate
com.aquima.interactions.process.wrapper.ReadonlyProcessEngine
- All Implemented Interfaces:
IProcessData
,IProcessEngine
,IProcessEngineBehavior
,IProcessEngineDefinitions
,IProcessExpressionHandler
Decorator class that wraps a process engine to make it immutable (read-only).
- Since:
- 7.1
- Author:
- Jon van Leuven
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReadonlyProcessEngine
(IProcessEngine processEngine) Constructs a read-only wrapper for the specified process engine. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method may be used to cancel started tasks that were abandoned, for example due to an unexpected server shutdownevaluateIMultilingualText
(IMultilingualText displayNameContent, IProfile profile) This method checks aIMultilingualText
to see if there are any TSL expressions.void
evaluateTimer
(DateTimeValue currentTime) Always throws an InvalidStateException: No modifications allowed on a read only process engine.findCases
(CaseCriteria caseFilter) This method returns an array containing views of all cases that are valid after applying the filters from the filter contextfindTasks
(TaskCriteria taskFilter) This method returns an array containing views of all tasks that are valid after applying the filters from the filter context.findWaitingCases
(String messageEventName, Set<Long> specificCaseIds) This method returns the cases waiting for a message event.getAvailableCases
(IUserData userData) This method will return an array containing the cases that are available for the supplied user.getAvailableTasks
(IUserData userData, Long caseId) This method returns an array containing the tasks that are available for the supplied user.getCase
(long caseId) This method returns the case for the specified ID.getCaseState
(long caseId) Gets the case stategetPriorityAlgorithm
(String name) This method returns the definition of an priority algorithm.getRoutingAlgorithm
(String name) This method returns the routing algorithm definition for the specified name.getTask
(long taskId) This method returns the task for the specified ID.getTaskModel
(long taskId) This method returns the task for the specified ID.This method returns an array containing all the tasks that have not yet been assigned.void
registerCaseEvaluator
(ICaseEvaluator evaluator) Registers a case evaluator that will be used by this process engine to evaluate cases in the background.void
registerDelegate
(IProcessTaskDelegate processTaskDelegate) This method can be used to register a handler that is able to handle certain tasks (for example handling of automatic tasks).void
reopenTask
(long taskId) Always throws an InvalidStateException: No modifications allowed on a read only process engine.void
reopenTask
(long taskId, IUserData userData) Always throws an InvalidStateException: No modifications allowed on a read only process engine.long
replayMessageEvent
(long eventId, Long caseId) Always throws an InvalidStateException: No modifications allowed on a read only process engine.long
replayMessageEvent
(long eventId, Long caseId, IUserData userData) Always throws an InvalidStateException: No modifications allowed on a read only process engine.long
replayTimerEvent
(long eventId) Always throws an InvalidStateException: No modifications allowed on a read only process engine.long
replayTimerEvent
(long eventId, IUserData userData) Always throws an InvalidStateException: No modifications allowed on a read only process engine.protected static IProcessCase
wrapReadonly
(IProcessCase processCase) protected static IProcessCase[]
wrapReadonly
(IProcessCase[] pCases) protected static IProcessTask
wrapReadonly
(IProcessTask pTask) protected static IProcessTask[]
wrapReadonly
(IProcessTask[] pTasks) Methods inherited from class com.aquima.interactions.process.wrapper.ProcessEngineDelegate
closeCase, findByCriteria, findByCriteria, getAuthorizationAlgorithm, getCaseEvaluator, getCaseModel, getCaseProcesses, getExpressionParser, getMessageEventByName, getNodeDefinition, getNodeIds, getPriorityAlgorithmByName, getProcessByName, getProcessEventByName, getProcessSettings, getProcessTaskDefinition, getRoles, getRoutingAlgorithmByName, getTaskByName, getTypeByName, notifyEvent, notifyEvent
-
Field Details
-
MODIFICATION_ATTEMPT_ERROR_MESSAGE
- See Also:
-
-
Constructor Details
-
ReadonlyProcessEngine
Constructs a read-only wrapper for the specified process engine.- Parameters:
processEngine
- The process engine that should be wrapped in this read-only decorator.
-
-
Method Details
-
evaluateTimer
Always throws an InvalidStateException: No modifications allowed on a read only process engine.- Specified by:
evaluateTimer
in interfaceIProcessEngineBehavior
- Overrides:
evaluateTimer
in classProcessEngineDelegate
- Parameters:
currentTime
- The current time.
-
reopenTask
public void reopenTask(long taskId) throws UnknownProcessCaseException, UnknownProcessTaskException, OpenProcessTaskException Always throws an InvalidStateException: No modifications allowed on a read only process engine.- Parameters:
taskId
- the id of the task to be re-opened- Throws:
UnknownProcessCaseException
- if the task is linked to an unknown caseUnknownProcessTaskException
- if a task with the given id is not foundOpenProcessTaskException
- if a node with the given id is found but it is not task, or its status is not started
-
reopenTask
public void reopenTask(long taskId, IUserData userData) throws UnknownProcessCaseException, UnknownProcessTaskException, OpenProcessTaskException Always throws an InvalidStateException: No modifications allowed on a read only process engine.- Parameters:
taskId
- the id of the task to be re-openeduserData
- the data of the current user- Throws:
UnknownProcessCaseException
- if the task is linked to an unknown caseUnknownProcessTaskException
- if a task with the given id is not foundOpenProcessTaskException
- if a node with the given id is found but it is not task, or its status is not started
-
replayMessageEvent
Always throws an InvalidStateException: No modifications allowed on a read only process engine.- Parameters:
eventId
- the id of the original message event which should be replayedcaseId
- the optional ID of the case in which the message event will be replayed (if null, the message event will be broadcast to all waiting cases)- Returns:
- the id of the newly created event
-
replayMessageEvent
Always throws an InvalidStateException: No modifications allowed on a read only process engine.- Parameters:
eventId
- the id of the original message event which should be replayedcaseId
- the optional ID of the case in which the message event will be replayed (if null, the message event will be broadcast to all waiting cases)userData
- the data of the current user- Returns:
- the id of the newly created event
-
replayTimerEvent
public long replayTimerEvent(long eventId) throws ReplayCaseEventException, UnknownProcessCaseException Always throws an InvalidStateException: No modifications allowed on a read only process engine.- Parameters:
eventId
- the id of the original timer event which should be replayed- Returns:
- the id of the newly created event
- Throws:
ReplayCaseEventException
- if an error occurs during replayUnknownProcessCaseException
- if the process case in which the event should be replayed could not be found
-
replayTimerEvent
public long replayTimerEvent(long eventId, IUserData userData) throws ReplayCaseEventException, UnknownProcessCaseException Always throws an InvalidStateException: No modifications allowed on a read only process engine.- Parameters:
eventId
- the id of the original timer event which should be replayeduserData
- the data of the current user- Returns:
- the id of the newly created event
- Throws:
ReplayCaseEventException
- if an error occurs during replayUnknownProcessCaseException
- if the process case in which the event should be replayed could not be found
-
getAvailableCases
Description copied from interface:IProcessData
This method will return an array containing the cases that are available for the supplied user.- Specified by:
getAvailableCases
in interfaceIProcessData
- Overrides:
getAvailableCases
in classProcessEngineDelegate
- Parameters:
userData
- Object containing the information about the current user.- Returns:
- an array containing the cases that are available for the supplied user.
-
getAvailableTasks
Description copied from interface:IProcessData
This method returns an array containing the tasks that are available for the supplied user. This method is also known as the "tasks for me" in the documentation.- Specified by:
getAvailableTasks
in interfaceIProcessData
- Overrides:
getAvailableTasks
in classProcessEngineDelegate
- Parameters:
userData
- The data of the user to which the task must be assigned.caseId
- ID of the case to which the tasks must belong.- Returns:
- an array containing the tasks for the supplied user.
-
findTasks
Description copied from interface:IProcessData
This method returns an array containing views of all tasks that are valid after applying the filters from the filter context.- Specified by:
findTasks
in interfaceIProcessData
- Overrides:
findTasks
in classProcessEngineDelegate
- Parameters:
taskFilter
- TaskFilterContext to filter the tasks that are returned.- Returns:
- an array containing the task views.
-
findCases
Description copied from interface:IProcessData
This method returns an array containing views of all cases that are valid after applying the filters from the filter context- Specified by:
findCases
in interfaceIProcessData
- Overrides:
findCases
in classProcessEngineDelegate
- Parameters:
caseFilter
- CaseFilterContext to filter the cases that are returned.- Returns:
- an array containing the case views
-
getRoutingAlgorithm
public IRoutingAlgorithmDefinition getRoutingAlgorithm(String name) throws UnknownRoutingAlgorithmException Description copied from interface:IProcessEngineDefinitions
This method returns the routing algorithm definition for the specified name.- Parameters:
name
- The name of the routing algorithm whose definition is requested.- Returns:
- The definition of the routing algorithm with the specified name.
- Throws:
UnknownRoutingAlgorithmException
- This exception is thrown when the routing algorithm could not be found.
-
getPriorityAlgorithm
public IPriorityAlgorithmDefinition getPriorityAlgorithm(String name) throws UnknownPriorityAlgorithmException Description copied from interface:IProcessEngineDefinitions
This method returns the definition of an priority algorithm.- Parameters:
name
- The name of the algorithm.- Returns:
- The definition of the algorithm.
- Throws:
UnknownPriorityAlgorithmException
-
getCase
Description copied from interface:IProcessData
This method returns the case for the specified ID.- Specified by:
getCase
in interfaceIProcessData
- Overrides:
getCase
in classProcessEngineDelegate
- Parameters:
caseId
- The ID of the requested case.- Returns:
- The case for the specified ID.
- Throws:
UnknownProcessCaseException
- This exception is thrown when the case could not be found.
-
findWaitingCases
Description copied from interface:IProcessData
This method returns the cases waiting for a message event.- Specified by:
findWaitingCases
in interfaceIProcessData
- Overrides:
findWaitingCases
in classProcessEngineDelegate
- Parameters:
messageEventName
- The message event name, may not be null.specificCaseIds
- A set of case ids, may be null. If not null, only those cases are processed.- Returns:
- The case models waiting for the message event.
-
getUnassignedTasks
Description copied from interface:IProcessData
This method returns an array containing all the tasks that have not yet been assigned.- Specified by:
getUnassignedTasks
in interfaceIProcessData
- Overrides:
getUnassignedTasks
in classProcessEngineDelegate
- Returns:
- an array containing all the tasks that have not yet been assigned.
-
getTask
Description copied from interface:IProcessData
This method returns the task for the specified ID.- Specified by:
getTask
in interfaceIProcessData
- Overrides:
getTask
in classProcessEngineDelegate
- Parameters:
taskId
- The ID of the requested task.- Returns:
- The task for the specified ID.
- Throws:
UnknownProcessTaskException
- This exception is thrown when the task could not be found.
-
getTaskModel
Description copied from interface:IProcessData
This method returns the task for the specified ID.- Parameters:
taskId
- The ID of the requested task.- Returns:
- The task for the specified ID.
-
wrapReadonly
-
wrapReadonly
-
wrapReadonly
-
wrapReadonly
-
registerDelegate
Description copied from interface:IProcessEngine
This method can be used to register a handler that is able to handle certain tasks (for example handling of automatic tasks).- Parameters:
processTaskDelegate
- The delegate that is used for certain tasks (like automatic tasks).
-
registerCaseEvaluator
Description copied from interface:IProcessEngine
Registers a case evaluator that will be used by this process engine to evaluate cases in the background.- Parameters:
evaluator
- the new evaluator (not null)
-
cancelStartedTasks
public void cancelStartedTasks()Description copied from interface:IProcessEngineBehavior
This method may be used to cancel started tasks that were abandoned, for example due to an unexpected server shutdown -
evaluateIMultilingualText
public IMultilingualText evaluateIMultilingualText(IMultilingualText displayNameContent, IProfile profile) Description copied from interface:IProcessExpressionHandler
This method checks aIMultilingualText
to see if there are any TSL expressions. If there are, it will return back a newIMultilingualText
with the TSL expressions evaluated and the rest of the text will remain the same- Specified by:
evaluateIMultilingualText
in interfaceIProcessExpressionHandler
- Overrides:
evaluateIMultilingualText
in classProcessEngineDelegate
- Parameters:
displayNameContent
- the multi lingual display nameprofile
- the profile- Returns:
IMultilingualText
with the TSL values evaluated
-
getCaseState
Description copied from interface:IProcessData
Gets the case state- Parameters:
caseId
- the case ID- Returns:
- the case state
-