public class WorkflowEngine extends java.lang.Object implements WorkflowSystem
WorkflowSystem.Operation<X,T extends WorkflowSystem.OperationCompleted>, WorkflowSystem.OperationCompleted<T>, WorkflowSystem.OperationResult<D,T extends WorkflowSystem.OperationCompleted<D>,X extends WorkflowSystem.Operation<D,T>>, WorkflowSystem.SharedData<T>
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) |
<DAT,RES extends WorkflowSystem.OperationCompleted<DAT>,OP extends WorkflowSystem.Operation<DAT,RES>> |
processOperations(java.util.Set<OP> operations,
WorkflowSystem.SharedData<DAT> sharedData)
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 <DAT,RES extends WorkflowSystem.OperationCompleted<DAT>,OP extends WorkflowSystem.Operation<DAT,RES>> java.util.Set<WorkflowSystem.OperationResult<DAT,RES,OP>> processOperations(java.util.Set<OP> operations, WorkflowSystem.SharedData<DAT> sharedData)
WorkflowSystem
processOperations
in interface WorkflowSystem
DAT
- shared data typeRES
- success result of an operationOP
- 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, SharedData)
stopped due to interruptionpublic void setInterrupted(boolean interrupted)