Package com.aquima.interactions.process
Interface IProcessEngineBehavior
- All Known Subinterfaces:
IProcessEngine
- All Known Implementing Classes:
ProcessEngine
,ProcessEngineDelegate
,ReadonlyProcessEngine
public interface IProcessEngineBehavior
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method may be used to cancel started tasks that were abandoned, for example due to an unexpected server shutdownvoid
This method may be used to close an existing case and cancel all its tasks.void
evaluateTimer
(DateTimeValue currentTime) This method (re)evaluates all open timer tasks.void
notifyEvent
(IMessageEvent messageEvent, IUserData user, IProcessCaseChangeListener listener) This method notifies the process engine about an event.void
notifyEvent
(IMessageEvent messageEvent, IUserData user, IProcessCaseChangeListener listener, Set<Long> specificCaseIds) This method notifies the process engine about an event.void
reopenTask
(long taskId) Reopens a task which is stuck in the started state.void
reopenTask
(long taskId, IUserData userData) Reopens a task which is stuck in the started state.long
replayMessageEvent
(long eventId, Long caseId) Replays (re-triggers) a message event.long
replayMessageEvent
(long eventId, Long caseId, IUserData userData) Replays (re-triggers) a message event.long
replayTimerEvent
(long eventId) Replays (re-triggers) a timer event.long
replayTimerEvent
(long eventId, IUserData userData) Replays (re-triggers) a timer event.
-
Method Details
-
closeCase
This method may be used to close an existing case and cancel all its tasks.- Parameters:
userData
- Object containing information about the current user.caseId
- The ID of the case that should be closed.- Throws:
CloseProcessCaseException
- This exception is thrown when the case could not be closed.
-
notifyEvent
This method notifies the process engine about an event.- Parameters:
messageEvent
- The message event, may not be null.user
- The user, may not be null.listener
- A listener to trace the modified cases, may be null.- Throws:
InvalidMessageEventException
- This exception is thrown in case of an invalid message event.AppException
- This exception is thrown when the event could not be processed.
-
notifyEvent
void notifyEvent(IMessageEvent messageEvent, IUserData user, IProcessCaseChangeListener listener, Set<Long> specificCaseIds) This method notifies the process engine about an event.- Parameters:
messageEvent
- The message event, may not be null.user
- The user, may not be null.listener
- A listener to trace the modified cases, may be null.specificCaseIds
- A set of case ids, may be null. If not null, only those cases are processed.- Throws:
InvalidMessageEventException
- This exception is thrown in case of an invalid message event.AppException
- This exception is thrown when the event could not be processed.
-
evaluateTimer
This method (re)evaluates all open timer tasks.- Parameters:
currentTime
- The current time.
-
reopenTask
void reopenTask(long taskId) Reopens a task which is stuck in the started state. The case of the task is also opened if it is locked.- 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 startedProcessException
- if any other error is encountered while reopening the task
-
reopenTask
Reopens a task which is stuck in the started state. The case of the task is also opened if it is locked.- 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 startedProcessException
- if any other error is encountered while reopening the task
-
replayMessageEvent
Replays (re-triggers) a message event.- 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
- Throws:
UnknownCaseEventException
- if the message event with the given id could not be foundUnknownProcessCaseException
- if the process case in which the event should be replayed could not be foundReplayCaseEventException
- if an error occurs during replay
-
replayMessageEvent
Replays (re-triggers) a message event.- 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
- Throws:
UnknownCaseEventException
- if the message event with the given id could not be foundUnknownProcessCaseException
- if the process case in which the event should be replayed could not be foundReplayCaseEventException
- if an error occurs during replay
-
replayTimerEvent
long replayTimerEvent(long eventId) Replays (re-triggers) a timer event.- Parameters:
eventId
- the id of the original timer event which should be replayed- Returns:
- the id of the newly created event
- Throws:
UnknownCaseEventException
- if the timer event with the given id could not be foundReplayCaseEventException
- if an error occurs during replayUnknownProcessCaseException
- if the process case in which the event should be replayed could not be found
-
replayTimerEvent
Replays (re-triggers) a timer event.- 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:
UnknownCaseEventException
- if the timer event with the given id could not be foundReplayCaseEventException
- if an error occurs during replayUnknownProcessCaseException
- if the process case in which the event should be replayed could not be found
-
cancelStartedTasks
void cancelStartedTasks()This method may be used to cancel started tasks that were abandoned, for example due to an unexpected server shutdown- Since:
- 9.2
-