public class LiteWorkflowInstance extends Object implements org.apache.hadoop.io.Writable, WorkflowInstance
WorkflowInstance.StatusNODE_VAR_SEPARATOR| Modifier | Constructor and Description |
|---|---|
protected |
LiteWorkflowInstance() |
|
LiteWorkflowInstance(LiteWorkflowApp def,
org.apache.hadoop.conf.Configuration conf,
String instanceId) |
|
LiteWorkflowInstance(LiteWorkflowApp def,
org.apache.hadoop.conf.Configuration conf,
String instanceId,
Map<String,Date> actionEndTimes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
void |
fail(String nodeName)
Fail the instance.
|
Map<String,String> |
getAllVars()
Return a map with all the variables in the context of the instance.
|
WorkflowApp |
getApp()
Return the workflow application that defines the instance.
|
org.apache.hadoop.conf.Configuration |
getConf()
Return the configuration of the instance.
|
String |
getId()
Return the ID of the instance.
|
NodeDef |
getNodeDef(String executionPath)
Get NodeDef from workflow instance
|
LiteWorkflowApp |
getProcessDefinition() |
WorkflowInstance.Status |
getStatus()
Return the current status of the instance.
|
Object |
getTransientVar(String name)
Return a transient variable from the context of the instance.
|
String |
getTransition(String node)
Return the transition a node did.
|
String |
getVar(String name)
Return a variable from the context of the instance.
|
boolean |
hasEnded() |
int |
hashCode() |
boolean |
hasTransientVar(String name) |
boolean |
isSuspended() |
void |
kill()
Kill the instance.
|
void |
readFields(DataInput dIn) |
void |
resume()
Resume the instance.
|
void |
setAllVars(Map<String,String> varMap)
Add a set of variables in the context of the instance.
|
void |
setStatus(WorkflowInstance.Status status) |
void |
setTransientVar(String name,
Object value)
Set a transient variable in the context of the instance.
|
void |
setVar(String name,
String value)
Set a variable in the context of the instance.
|
boolean |
signal(String executionPath,
String signalValue)
Signal the instance that a node has completed.
|
boolean |
start()
Start the instance.
|
void |
suspend()
Suspend the instance.
|
void |
write(DataOutput dOut) |
protected LiteWorkflowInstance()
public LiteWorkflowInstance(LiteWorkflowApp def, org.apache.hadoop.conf.Configuration conf, String instanceId)
public LiteWorkflowInstance(LiteWorkflowApp def, org.apache.hadoop.conf.Configuration conf, String instanceId, Map<String,Date> actionEndTimes)
public boolean start() throws WorkflowException
WorkflowInstancestart in interface WorkflowInstanceWorkflowException - thrown if the instance could not be started.public boolean signal(String executionPath, String signalValue) throws WorkflowException
WorkflowInstancesignal in interface WorkflowInstanceexecutionPath - execution path of the node that has completed.signalValue - signal value for the node.true if the instance has completed its execution, false otherwise.WorkflowExceptionpublic NodeDef getNodeDef(String executionPath)
getNodeDef in interface WorkflowInstanceexecutionPath - execution pathpublic void fail(String nodeName) throws WorkflowException
WorkflowInstancefail in interface WorkflowInstancenodeName - the name of the node to be failed.WorkflowException - thrown if the instance could not be failed.public void kill() throws WorkflowException
WorkflowInstancekill in interface WorkflowInstanceWorkflowException - thrown if the instance could not be killed.public void suspend() throws WorkflowException
WorkflowInstancesuspend in interface WorkflowInstanceWorkflowException - thrown if the instance could not be suspended.public boolean isSuspended()
public void resume() throws WorkflowException
WorkflowInstanceresume in interface WorkflowInstanceWorkflowException - thrown if the instance could not be resume.public void setVar(String name, String value)
WorkflowInstancesetVar in interface WorkflowInstancename - variable name.value - variable value, setting a null value removes the variable.public Map<String,String> getAllVars()
WorkflowInstancegetAllVars in interface WorkflowInstancepublic void setAllVars(Map<String,String> varMap)
WorkflowInstancesetAllVars in interface WorkflowInstancevarMap - map with the variables to add.public String getVar(String name)
WorkflowInstancegetVar in interface WorkflowInstancename - name of the variable.null if the variable is not in the context.public void setTransientVar(String name, Object value)
WorkflowInstancesetTransientVar in interface WorkflowInstancename - transient variable name.value - transient variable value, setting a null value removes the variable.public boolean hasTransientVar(String name)
public Object getTransientVar(String name)
WorkflowInstancegetTransientVar in interface WorkflowInstancename - name of the transient variable.null if the variable is not in the context.public boolean hasEnded()
public LiteWorkflowApp getProcessDefinition()
public WorkflowInstance.Status getStatus()
WorkflowInstancegetStatus in interface WorkflowInstancepublic void setStatus(WorkflowInstance.Status status)
public void write(DataOutput dOut) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput dIn) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic org.apache.hadoop.conf.Configuration getConf()
WorkflowInstancegetConf in interface WorkflowInstancepublic WorkflowApp getApp()
WorkflowInstancegetApp in interface WorkflowInstancepublic String getId()
WorkflowInstancegetId in interface WorkflowInstancepublic String getTransition(String node)
WorkflowInstancegetTransition in interface WorkflowInstancenode - the node name.null if the node didn't execute yet.Copyright © 2014 Apache Software Foundation. All Rights Reserved.