|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kew.engine.StandardWorkflowEngine
public class StandardWorkflowEngine
The standard and supported implementation of the WorkflowEngine. Runs a processing loop against a given Document, processing nodes on the document until the document is completed or a node halts the processing.
Field Summary | |
---|---|
protected RouteHelper |
helper
|
private static org.apache.log4j.Logger |
LOG
|
private boolean |
runPostProcessorLogic
|
Constructor Summary | |
---|---|
StandardWorkflowEngine()
|
|
StandardWorkflowEngine(boolean runPostProcessorLogic)
|
Method Summary | |
---|---|
private boolean |
checkAssertions(RouteContext context)
Checks various assertions regarding the processing of the current node. |
private void |
checkDefaultApprovalPolicy(DocumentRouteHeaderValue document)
Check the default approval policy for the document. |
protected RouteHeaderService |
getRouteHeaderService()
|
protected RouteNodeService |
getRouteNodeService()
|
private void |
handleBackwardCompatibility(RouteContext context,
RouteNodeInstance nextNodeInstance)
|
private boolean |
hasContactedPostProcessor(RouteContext context,
DocumentRouteStatusChange event)
Returns true if the post processor has already been contacted about a PROCESSED or FINAL post processor change. |
void |
initializeDocument(DocumentRouteHeaderValue document)
This method initializes the document by materializing and activating the first node instance on the document. |
private List |
invokeTransition(RouteContext context,
RouteNodeInstance nodeInstance,
ProcessResult processResult,
TransitionEngine transitionEngine)
Invokes the transition and returns the next node instances to transition to from the current node instance on the route context. |
private boolean |
isRunawayProcessDetected(EngineState engineState)
|
boolean |
isRunPostProcessorLogic()
|
protected void |
lockAdditionalDocuments(DocumentRouteHeaderValue document)
|
protected DocumentRouteHeaderValue |
nodePostProcess(RouteContext context)
|
private void |
notifyNodeChange(RouteContext context,
RouteNodeInstance nextNodeInstance)
|
private DocumentRouteHeaderValue |
notifyPostProcessor(DocumentRouteHeaderValue document,
RouteNodeInstance nodeInstance,
DocumentRouteLevelChange event)
TODO in some cases, someone may modify the route header in the post processor, if we don't save before and reload after we will get an optimistic lock exception, we need to work on a better solution for this! TODO get the routeContext in this method - it should be a better object than the nodeInstance |
private DocumentRouteHeaderValue |
notifyPostProcessor(RouteContext context,
DocumentRouteStatusChange event)
|
private DocumentRouteHeaderValue |
notifyPostProcessorAfterProcess(DocumentRouteHeaderValue document,
Long nodeInstanceId,
AfterProcessEvent event)
TODO get the routeContext in this method - it should be a better object than the nodeInstance |
private DocumentRouteHeaderValue |
notifyPostProcessorAfterProcess(DocumentRouteHeaderValue document,
Long nodeInstanceId,
boolean successfullyProcessed)
TODO get the routeContext in this method - it should be a better object than the nodeInstance |
private DocumentRouteHeaderValue |
notifyPostProcessorBeforeProcess(DocumentRouteHeaderValue document,
Long nodeInstanceId)
TODO get the routeContext in this method - it should be a better object than the nodeInstance |
private DocumentRouteHeaderValue |
notifyPostProcessorBeforeProcess(DocumentRouteHeaderValue document,
Long nodeInstanceId,
BeforeProcessEvent event)
TODO get the routeContext in this method - it should be a better object than the nodeInstance |
void |
process(Long documentId,
Long nodeInstanceId)
|
protected ProcessContext |
processNodeInstance(RouteContext context,
RouteHelper helper)
|
private void |
saveBranch(RouteContext context,
Branch branch)
|
private void |
saveDocument(RouteContext context)
|
protected void |
saveNode(RouteContext context,
RouteNodeInstance nodeInstance)
|
void |
setRunPostProcessorLogic(boolean runPostProcessorLogic)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger LOG
protected RouteHelper helper
private boolean runPostProcessorLogic
Constructor Detail |
---|
public StandardWorkflowEngine()
public StandardWorkflowEngine(boolean runPostProcessorLogic)
Method Detail |
---|
public void setRunPostProcessorLogic(boolean runPostProcessorLogic)
setRunPostProcessorLogic
in interface WorkflowEngine
public boolean isRunPostProcessorLogic()
public void process(Long documentId, Long nodeInstanceId) throws Exception
process
in interface WorkflowEngine
Exception
protected ProcessContext processNodeInstance(RouteContext context, RouteHelper helper) throws Exception
Exception
private boolean checkAssertions(RouteContext context) throws Exception
Exception
private List invokeTransition(RouteContext context, RouteNodeInstance nodeInstance, ProcessResult processResult, TransitionEngine transitionEngine) throws Exception
1) If the node instance already has next nodes, return those, 2) otherwise, invoke the transition engine for the node, if the resulting node instances are not empty, return those, 3) lastly, if our node is in a process and no next nodes were returned from it's transition engine, invoke the transition engine of the process node and return the resulting node instances.
Exception
private void notifyNodeChange(RouteContext context, RouteNodeInstance nextNodeInstance) throws Exception
Exception
private void handleBackwardCompatibility(RouteContext context, RouteNodeInstance nextNodeInstance)
private void saveDocument(RouteContext context)
private void saveBranch(RouteContext context, Branch branch)
protected void saveNode(RouteContext context, RouteNodeInstance nodeInstance)
protected DocumentRouteHeaderValue nodePostProcess(RouteContext context) throws InvalidActionTakenException
InvalidActionTakenException
private void checkDefaultApprovalPolicy(DocumentRouteHeaderValue document) throws RouteManagerException
rh
- route header to be checkeddocType
- docType of the routeHeader to be checked.
RouteManagerException
private DocumentRouteHeaderValue notifyPostProcessor(RouteContext context, DocumentRouteStatusChange event)
private boolean hasContactedPostProcessor(RouteContext context, DocumentRouteStatusChange event)
private DocumentRouteHeaderValue notifyPostProcessor(DocumentRouteHeaderValue document, RouteNodeInstance nodeInstance, DocumentRouteLevelChange event)
private DocumentRouteHeaderValue notifyPostProcessorBeforeProcess(DocumentRouteHeaderValue document, Long nodeInstanceId)
private DocumentRouteHeaderValue notifyPostProcessorBeforeProcess(DocumentRouteHeaderValue document, Long nodeInstanceId, BeforeProcessEvent event)
protected void lockAdditionalDocuments(DocumentRouteHeaderValue document) throws Exception
Exception
private DocumentRouteHeaderValue notifyPostProcessorAfterProcess(DocumentRouteHeaderValue document, Long nodeInstanceId, boolean successfullyProcessed)
private DocumentRouteHeaderValue notifyPostProcessorAfterProcess(DocumentRouteHeaderValue document, Long nodeInstanceId, AfterProcessEvent event)
public void initializeDocument(DocumentRouteHeaderValue document)
initializeDocument
in interface WorkflowEngine
protected RouteNodeService getRouteNodeService()
private boolean isRunawayProcessDetected(EngineState engineState) throws NumberFormatException
NumberFormatException
protected RouteHeaderService getRouteHeaderService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |