public abstract class WorkflowProcessor extends Object implements WorkflowProcessorListener, Comparable<WorkflowProcessor>
Modifier and Type | Field and Description |
---|---|
protected WorkflowProcessorHelper |
helper |
protected WorkflowLifecycleManager |
lifecycleManager |
Constructor and Description |
---|
WorkflowProcessor(WorkflowLifecycleManager lifecycleManager,
WorkflowInstance workflowInstance) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(WorkflowProcessor workflowProcessor) |
List<String> |
getExcusedSubProcessorIds() |
WorkflowLifecycleManager |
getLifecycleManager() |
List<WorkflowProcessorListener> |
getListeners() |
int |
getMinReqSuccessfulSubProcessors() |
WorkflowProcessor |
getPostConditions() |
WorkflowProcessor |
getPreConditions() |
protected abstract List<WorkflowProcessor> |
getRunnableSubProcessors()
This is the core method of the WorkflowProcessor class in the new Wengine
style workflows.
|
List<TaskProcessor> |
getRunnableWorkflowProcessors() |
List<WorkflowProcessor> |
getSubProcessors() |
WorkflowInstance |
getWorkflowInstance() |
protected abstract void |
handleSubProcessorMetadata(WorkflowProcessor workflowProcessor) |
boolean |
isAnyCategory(String... categories)
Evaluates whether or not this processor's
WorkflowLifecycleStage
is in any of the provided category names. |
boolean |
isAnyState(String... states)
Evaluates whether or not this processor's
WorkflowState
is in any of the provided state names. |
protected WorkflowState |
isDone()
First checks to see if any of this Processor's
subProcessors have
arrived in a state within the done category. |
void |
nextState()
Advances this WorkflowProcessor to its next
WorkflowState . |
void |
notifyChange(WorkflowProcessor processor,
ChangeType changeType) |
protected boolean |
passedPostConditions() |
protected boolean |
passedPreConditions() |
void |
setExcusedSubProcessorIds(List<String> excusedSubProcessorIds) |
void |
setLifecycleManager(WorkflowLifecycleManager lifecycleManager) |
void |
setListeners(List<WorkflowProcessorListener> listeners) |
void |
setMinReqSuccessfulSubProcessors(int minReqSuccessfulSubProcessors) |
void |
setPostConditions(WorkflowProcessor postConditions) |
void |
setPreConditions(WorkflowProcessor preConditions) |
void |
setSubProcessors(List<WorkflowProcessor> subProcessors) |
void |
setWorkflowInstance(WorkflowInstance workflowInstance) |
protected WorkflowLifecycleManager lifecycleManager
protected WorkflowProcessorHelper helper
public WorkflowProcessor(WorkflowLifecycleManager lifecycleManager, WorkflowInstance workflowInstance)
public WorkflowInstance getWorkflowInstance()
public void setWorkflowInstance(WorkflowInstance workflowInstance)
workflowInstance
- the workflowInstance to setpublic List<String> getExcusedSubProcessorIds()
public void setExcusedSubProcessorIds(List<String> excusedSubProcessorIds)
excusedSubProcessorIds
- the excusedSubProcessorIds to setpublic List<WorkflowProcessor> getSubProcessors()
public void setSubProcessors(List<WorkflowProcessor> subProcessors)
subProcessors
- the subProcessors to setpublic List<WorkflowProcessorListener> getListeners()
public void setListeners(List<WorkflowProcessorListener> listeners)
listeners
- the listeners to setpublic int getMinReqSuccessfulSubProcessors()
public void setMinReqSuccessfulSubProcessors(int minReqSuccessfulSubProcessors)
minReqSuccessfulSubProcessors
- the minReqSuccessfulSubProcessors to setpublic WorkflowLifecycleManager getLifecycleManager()
public void setLifecycleManager(WorkflowLifecycleManager lifecycleManager)
lifecycleManager
- the lifecycleManager to setpublic WorkflowProcessor getPreConditions()
public void setPreConditions(WorkflowProcessor preConditions)
preConditions
- the preConditions to setpublic WorkflowProcessor getPostConditions()
public void setPostConditions(WorkflowProcessor postConditions)
postConditions
- the postConditions to setpublic int compareTo(WorkflowProcessor workflowProcessor)
compareTo
in interface Comparable<WorkflowProcessor>
public void notifyChange(WorkflowProcessor processor, ChangeType changeType)
notifyChange
in interface WorkflowProcessorListener
public List<TaskProcessor> getRunnableWorkflowProcessors()
public void nextState()
WorkflowState
.public boolean isAnyState(String... states)
WorkflowState
is in any of the provided state names.states
- The names of states to check this processor's
WorkflowState
against.WorkflowState
, False otherwise.public boolean isAnyCategory(String... categories)
WorkflowLifecycleStage
is in any of the provided category names.categories
- The names of categories to check this processor's
WorkflowLifecycleStage
against.WorkflowLifecycleStage
, False otherwise.protected boolean passedPreConditions()
protected boolean passedPostConditions()
protected WorkflowState isDone()
subProcessors
have
arrived in a state within the done category. If so the method determines if
any of the done subProcessors
are in Failure state. If so, the
method compares the number of Failed sub-processors against
minReqSuccessfulSubProcessors
, and if it is greater than it,
returns a ResultsFailure WorkflowState
. Otherwise, the method scans
the failed sub-processors, and checks to see if all of them have been
excused. If they haven't, then a ResultFailure state is returned. Finally,
the method checks to ensure that all sub processors are in the done
category. If they are, a ResultsSuccess WorkflowState
is returned,
otherwise, a ResultsBail state is returned.WorkflowState
, according to the method description.protected abstract List<WorkflowProcessor> getRunnableSubProcessors()
Workflow
, these style WorkflowProcessors
actually require their implementing sub-classes to return the current set
of Runnable sub-processors (which could be tasks, conditions, even
Workflow
s themselves.
The Parallel sub-class returns a list of task or condition processors that
are able to run at a given time. The Sequential sub-class returns only a
single task or condition processor to run, and so forth.protected abstract void handleSubProcessorMetadata(WorkflowProcessor workflowProcessor)
Copyright © 1999-2015 Apache OODT. All Rights Reserved.