public class WorkflowEngine extends java.lang.Object implements WorkflowSystem
WorkflowSystem.Operation<T extends WorkflowSystem.OperationSuccess>, WorkflowSystem.OperationResult<T extends WorkflowSystem.OperationSuccess,X extends WorkflowSystem.Operation<T>>, WorkflowSystem.OperationSuccess
Constructor and Description |
---|
WorkflowEngine(RuleEngine engine,
MutableStateObj state,
java.util.concurrent.ExecutorService executor)
Create engine
|
Modifier and Type | Method and Description |
---|---|
WorkflowSystemEventListener |
getListener() |
boolean |
isInterrupted() |
protected boolean |
isWorkflowEndState(MutableStateObj state) |
<T extends WorkflowSystem.OperationSuccess,X extends WorkflowSystem.Operation<T>> |
processOperations(java.util.Set<X> operations)
Process the operations and return results when all runnable operations are complete.
|
void |
setInterrupted(boolean interrupted) |
void |
setListener(WorkflowSystemEventListener listener) |
public WorkflowEngine(RuleEngine engine, MutableStateObj state, java.util.concurrent.ExecutorService executor)
engine
- rule engine to process state changes via rulesstate
- initial stateexecutor
- executor to process operations, which should be multithreaded to process operations concurrentlypublic <T extends WorkflowSystem.OperationSuccess,X extends WorkflowSystem.Operation<T>> java.util.Set<WorkflowSystem.OperationResult<T,X>> processOperations(java.util.Set<X> operations)
WorkflowSystem
processOperations
in interface WorkflowSystem
T
- success result of an operationX
- operation classoperations
- operationsprotected boolean isWorkflowEndState(MutableStateObj state)
public WorkflowSystemEventListener getListener()
public void setListener(WorkflowSystemEventListener listener)
public boolean isInterrupted()
isInterrupted
in interface WorkflowSystem
WorkflowSystem.processOperations(Set)
stopped due to interruptionpublic void setInterrupted(boolean interrupted)