public class WorkflowLifecycleManager extends Object
A Manager interface for the WorkflowLifecycles to
determine status for a WorkflowInstance.
| Constructor and Description |
|---|
WorkflowLifecycleManager(String lifecyclesFilePath)
Constructs a new WorkflowLifecycleManager with the
WorkflowLifecycles identified in the provided file path. |
| Modifier and Type | Method and Description |
|---|---|
static String |
formatPct(double pct)
Formats a double percent number to a 2 decimal place String.
|
WorkflowLifecycle |
getDefaultLifecycle() |
int |
getLastCompletedStageNum(WorkflowInstance inst)
Gets the last completed stage for the given
WorkflowInstance. |
WorkflowLifecycle |
getLifecycleForWorkflow(Workflow workflow)
Gets the
WorkflowLifecycle associated with the provided
Workflow model. |
int |
getNumStages(Workflow workflow)
Gets the total number of
WorkflowLifecycleStages for the
provided Workflow model. |
double |
getPercentageComplete(WorkflowInstance inst)
Gets the percentage complete that this
WorkflowInstance is based
on its WorkflowLifecycle. |
WorkflowLifecycleStage |
getStage(WorkflowInstance inst)
Gets the current
WorkflowLifecycleStage for the provided
WorkflowInstance based on its
WorkflowInstance.getStatus() value. |
int |
getStageNum(WorkflowInstance inst)
Gets the number of the current
WorkflowLifecycleStage for the
provided WorkflowInstance. |
public WorkflowLifecycleManager(String lifecyclesFilePath) throws InstantiationException
WorkflowLifecycles identified in the provided file path.lifecyclesFilePath - InstantiationExceptionpublic int getStageNum(WorkflowInstance inst)
WorkflowLifecycleStage for the
provided WorkflowInstance.inst - The WorkflowInstance to get the current stage num for.WorkflowLifecycleStage for the provided
WorkflowInstance.public int getNumStages(Workflow workflow)
WorkflowLifecycleStages for the
provided Workflow model.workflow - The Workflow model to get the number of
WorkflowLifecycleStages for. Only the identifier
parameter fromWorkflowLifecycleStages for the
provided Workflow model.public WorkflowLifecycleStage getStage(WorkflowInstance inst)
WorkflowLifecycleStage for the provided
WorkflowInstance based on its
WorkflowInstance.getStatus() value.inst - The WorkflowInstance to get the current stage for.WorkflowLifecycleStage for the provided
WorkflowInstance based on its
WorkflowInstance.getStatus() value.public double getPercentageComplete(WorkflowInstance inst)
WorkflowInstance is based
on its WorkflowLifecycle.inst - The WorkflowInstance to get the completion percentage
for.WorkflowInstance.public static String formatPct(double pct)
pct - The double percent number to format.public WorkflowLifecycle getDefaultLifecycle()
WorkflowLifecycle managed by this
WorkflowLifecycleManager.public WorkflowLifecycle getLifecycleForWorkflow(Workflow workflow)
WorkflowLifecycle associated with the provided
Workflow model.workflow - The Workflow to obtain the WorkflowLifecycle
for.WorkflowLifecycle associated with the provided
Workflow model.public int getLastCompletedStageNum(WorkflowInstance inst)
WorkflowInstance.inst - The WorkflowInstance to obtain the last completed
stage number for.WorkflowInstance.Copyright © 1999–2017 Apache OODT. All rights reserved.