Class EvaluationQueue
- java.lang.Object
-
- com.aquima.interactions.process.impl.EvaluationQueue
-
- All Implemented Interfaces:
IEvaluationQueue
public class EvaluationQueue extends Object implements IEvaluationQueue
Implementation of the evaluation queue. This queue is implemented as a FIFO queue, and accepts new tasks during the processing of current tasks.- Since:
- 7.1
- Author:
- O. Kerpershoek
-
-
Field Summary
Fields Modifier and Type Field Description protected IProcessCaseChangeListener
changeListener
protected boolean
isProcessing
protected EvaluationTask
nextTask
protected INodeHandlerFactory
nodeHandlerFactory
protected ProcessEngine
processEngine
protected ProcessEvaluator
processEvaluator
-
Constructor Summary
Constructors Modifier Constructor Description protected
EvaluationQueue(ProcessEngine engine, ProcessEvaluator evaluator)
protected
EvaluationQueue(ProcessEngine engine, ProcessEvaluator evaluator, INodeHandlerFactory nodeHandlerFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFirstTask(ITaskModel taskModel)
Adds the given task as the first element to the queue.void
addNode(IProcessNodeDefinition node, ITaskModel parent)
Add a node from a process to the evaluation queue.void
addTask(ITaskModel taskModel)
Add a task to the evaluation queue, so it will be evaluated, and the process will continue from that task if needed.void
cancelTask(ITaskModel task)
This method may be invoked to cancel a task.protected void
cancelTask(ITaskModel task, TaskStatusType status)
void
clearSchedulingHistory()
protected void
expireTask(ITaskModel task)
protected void
setChangeListener(IProcessCaseChangeListener changeListener)
protected void
setPostponedJobs(PostponedJobs postponedJobs)
protected boolean
shouldExpire(ITaskModel taskModel, IProcessNodeDefinition node, DateTimeValue currentTime)
protected void
start(DateTimeValue currentTime)
-
-
-
Field Detail
-
processEvaluator
protected ProcessEvaluator processEvaluator
-
processEngine
protected ProcessEngine processEngine
-
nodeHandlerFactory
protected INodeHandlerFactory nodeHandlerFactory
-
isProcessing
protected boolean isProcessing
-
nextTask
protected EvaluationTask nextTask
-
changeListener
protected IProcessCaseChangeListener changeListener
-
-
Constructor Detail
-
EvaluationQueue
protected EvaluationQueue(ProcessEngine engine, ProcessEvaluator evaluator)
-
EvaluationQueue
protected EvaluationQueue(ProcessEngine engine, ProcessEvaluator evaluator, INodeHandlerFactory nodeHandlerFactory)
-
-
Method Detail
-
start
protected void start(DateTimeValue currentTime) throws AppException
- Throws:
AppException
-
shouldExpire
protected boolean shouldExpire(ITaskModel taskModel, IProcessNodeDefinition node, DateTimeValue currentTime)
-
addNode
public void addNode(IProcessNodeDefinition node, ITaskModel parent) throws AppException
Description copied from interface:IEvaluationQueue
Add a node from a process to the evaluation queue. this method should be invoked for nodes that have not yet been processed.- Specified by:
addNode
in interfaceIEvaluationQueue
- Parameters:
node
- The node that should be scheduled and processed.parent
- The parent task of the node (should never be null).- Throws:
AppException
- This exception is thrown when the node could not be added to the queue.
-
addTask
public void addTask(ITaskModel taskModel)
Description copied from interface:IEvaluationQueue
Add a task to the evaluation queue, so it will be evaluated, and the process will continue from that task if needed.- Specified by:
addTask
in interfaceIEvaluationQueue
- Parameters:
taskModel
- The task that should be evaluated.
-
addFirstTask
public void addFirstTask(ITaskModel taskModel)
Description copied from interface:IEvaluationQueue
Adds the given task as the first element to the queue. Duplicates will be removed from the queue.- Specified by:
addFirstTask
in interfaceIEvaluationQueue
-
clearSchedulingHistory
public void clearSchedulingHistory()
-
expireTask
protected void expireTask(ITaskModel task)
-
cancelTask
public void cancelTask(ITaskModel task)
Description copied from interface:IEvaluationQueue
This method may be invoked to cancel a task. The task will be marked as canceled, and will be removed from the queue (if needed). If the task is a process or group task, the cancelTask method will also (automatically) be invoked for any child task that has not yet been completed.- Specified by:
cancelTask
in interfaceIEvaluationQueue
- Parameters:
task
- The task that needs to be canceled.
-
cancelTask
protected void cancelTask(ITaskModel task, TaskStatusType status)
-
setPostponedJobs
protected void setPostponedJobs(PostponedJobs postponedJobs)
-
setChangeListener
protected void setChangeListener(IProcessCaseChangeListener changeListener)
-
-