public class WorkflowEngine extends java.lang.Object implements StateWorkflowSystem, WorkflowSystemEventHandler
StateWorkflowSystem.OperationCompleteEvent<D,RES extends WorkflowSystem.OperationCompleted<D>,OP extends WorkflowSystem.Operation<D,RES>>, StateWorkflowSystem.OperationEvent<D>, StateWorkflowSystem.StateChange<D>, StateWorkflowSystem.StateChangeEvent<D>, StateWorkflowSystem.StateEvent<D>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,Y>| Constructor and Description |
|---|
WorkflowEngine(RuleEngine ruleEngine,
MutableStateObj state,
java.util.concurrent.ExecutorService executor)
Create engine
|
| Modifier and Type | Method and Description |
|---|---|
void |
event(WorkflowSystemEvent event)
handle event
|
void |
event(WorkflowSystemEventType eventType,
java.lang.String message)
handle event with message
|
void |
event(WorkflowSystemEventType eventType,
java.lang.String message,
java.lang.Object data)
handle event with message and data
|
boolean |
isWorkflowEndState() |
<DAT,RES extends WorkflowSystem.OperationCompleted<DAT>,OP extends WorkflowSystem.Operation<DAT,RES>> |
processOperations(java.util.Set<OP> operations,
WorkflowSystem.SharedData<DAT,java.util.Map<java.lang.String,java.lang.String>> sharedData)
Process the operations and return results when all runnable operations are complete.
|
boolean |
processStateChange(StateWorkflowSystem.StateChange<?> change)
Handle the state changes for the rule engine
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetListeners, getRuleEngine, getState, operationCompleteEvent, operationEvent, setListeners, stateChange, stateChangeEvent, stateEventisInterruptedpublic WorkflowEngine(RuleEngine ruleEngine, MutableStateObj state, java.util.concurrent.ExecutorService executor)
ruleEngine - 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,java.util.Map<java.lang.String,java.lang.String>> sharedData)
WorkflowSystemprocessOperations in interface WorkflowSystem<java.util.Map<java.lang.String,java.lang.String>>DAT - shared data typeRES - success result of an operationOP - operation classoperations - operationspublic boolean processStateChange(StateWorkflowSystem.StateChange<?> change)
StateWorkflowSystemprocessStateChange in interface StateWorkflowSystemchange - public void event(WorkflowSystemEventType eventType, java.lang.String message)
WorkflowSystemEventHandlerevent in interface WorkflowSystemEventHandlerpublic void event(WorkflowSystemEventType eventType, java.lang.String message, java.lang.Object data)
WorkflowSystemEventHandlerevent in interface WorkflowSystemEventHandlerpublic void event(WorkflowSystemEvent event)
WorkflowSystemEventHandlerevent in interface WorkflowSystemEventHandlerpublic boolean isWorkflowEndState()
isWorkflowEndState in interface StateWorkflowSystem