public class WorkflowLifecycle extends Object
Workflow
, identifying what
WorkflowStatus
es belong to a particular phase.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_LIFECYCLE |
static String |
NO_WORKFLOW_ID |
Constructor and Description |
---|
WorkflowLifecycle()
Default Constructor.
|
WorkflowLifecycle(String name,
String workflowId)
Constructs a new WorkflowLifecycle with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addStage(WorkflowLifecycleStage stage)
Adds a
WorkflowStage to this WorkflowLifecycle. |
void |
clearStages()
Clears the
WorkflowStage s in this WorkflowLifecycle. |
WorkflowState |
createState(String name,
String category,
String message) |
WorkflowLifecycleStage |
getCategoryByName(String category) |
String |
getName() |
WorkflowLifecycleStage |
getStageForWorkflow(String status)
Deprecated.
|
SortedSet |
getStages() |
WorkflowState |
getStateByName(String stateName)
Looks up an associated
WorkflowState by scanning the
WorkflowLifecycleStage s present in this lifecycle (aka, by scanning
its "Categories", in Workflow2 terminology). |
WorkflowState |
getStateByNameAndCategory(String stateName,
String category)
Gets a
WorkflowState by its name and WorkflowLifecycleStage
(or Category in Workflow2 terminology). |
String |
getWorkflowId() |
boolean |
removeStage(WorkflowLifecycleStage stage)
Removes the given
WorkflowStage from this WorkflowLifecycle. |
void |
setName(String name) |
void |
setWorkflowId(String workflowId) |
public static final String DEFAULT_LIFECYCLE
public static final String NO_WORKFLOW_ID
public String getName()
public void setName(String name)
name
- the name to setpublic SortedSet getStages()
public void addStage(WorkflowLifecycleStage stage)
WorkflowStage
to this WorkflowLifecycle.stage
- The WorkflowStage
to add to this WorkflowLifecycle.public boolean removeStage(WorkflowLifecycleStage stage)
WorkflowStage
from this WorkflowLifecycle.stage
- The WorkflowStage
to remove.public void clearStages()
WorkflowStage
s in this WorkflowLifecycle.public String getWorkflowId()
public void setWorkflowId(String workflowId)
workflowId
- the workflowId to set@Deprecated public WorkflowLifecycleStage getStageForWorkflow(String status)
WorkflowLifecycleStage
for a
WorkflowInstance
with a given status.status
- The status of the WorkflowInstance
to get the
WorkflowLifecycleStage
for.WorkflowLifecycleStage
for the
WorkflowInstance
with the given status, or null if that
status does not exist in any defined WorkflowLifecycleStage
.public WorkflowState getStateByName(String stateName)
WorkflowState
by scanning the
WorkflowLifecycleStage
s present in this lifecycle (aka, by scanning
its "Categories", in Workflow2 terminology). Since no Category is provided,
the first instance of a WorkflowState
found in the given
WorkflowLifecycleStage
being scanned is returned, even if there are
multiple instances of that state (e.g., others present in another
category).
If found, the WorkflowState
is returned, otherwise null is
returned.stateName
- The name of the WorkflowState
to locate and return.WorkflowState
if found, otherwise null.public WorkflowState getStateByNameAndCategory(String stateName, String category)
WorkflowState
by its name and WorkflowLifecycleStage
(or Category in Workflow2 terminology). If the state is found within that
category, then it is returned, otherwise null is returned.stateName
- The name of the WorkflowState
to locate and return.category
- The provided WorkflowLifecycleStage
name to categorize the
state by.WorkflowState
if found, otherwise null.public WorkflowLifecycleStage getCategoryByName(String category)
public WorkflowState createState(String name, String category, String message)
Copyright © 1999–2017 Apache OODT. All rights reserved.