public interface WorkflowInstance
WorkflowApp
.Modifier and Type | Interface and Description |
---|---|
static class |
WorkflowInstance.Status
Defines the possible stati of a
WorkflowInstance . |
Modifier and Type | Field and Description |
---|---|
static String |
NODE_VAR_SEPARATOR
Separator to qualify variables belonging to a node.
|
Modifier and Type | Method and Description |
---|---|
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
|
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.
|
void |
kill()
Kill the instance.
|
void |
resume()
Resume the instance.
|
void |
setAllVars(Map<String,String> varMap)
Add a set of variables in the context of the instance.
|
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 path,
String signaValue)
Signal the instance that a node has completed.
|
boolean |
start()
Start the instance.
|
void |
suspend()
Suspend the instance.
|
static final String NODE_VAR_SEPARATOR
Variables names should be compossed as nodeName +
.NODE_VAR_SEPARATOR
+ varName
org.apache.hadoop.conf.Configuration getConf()
WorkflowApp getApp()
boolean start() throws WorkflowException
WorkflowException
- thrown if the instance could not be started.boolean signal(String path, String signaValue) throws WorkflowException
path
- execution path of the node that has completed.signaValue
- signal value for the node.true
if the instance has completed its execution, false
otherwise.WorkflowException
void fail(String nodeName) throws WorkflowException
All executing nodes will be be signaled for fail.
nodeName
- the name of the node to be failed.WorkflowException
- thrown if the instance could not be failed.void kill() throws WorkflowException
All executing nodes will be be signaled for kill.
WorkflowException
- thrown if the instance could not be killed.void suspend() throws WorkflowException
WorkflowException
- thrown if the instance could not be suspended.void resume() throws WorkflowException
WorkflowException
- thrown if the instance could not be resume.WorkflowInstance.Status getStatus()
void setVar(String name, String value)
Variables are persisted with the instance.
name
- variable name.value
- variable value, setting a null
value removes the variable.String getVar(String name)
name
- name of the variable.null
if the variable is not in the context.Map<String,String> getAllVars()
void setAllVars(Map<String,String> varMap)
Variables are persisted with the instance.
varMap
- map with the variables to add.void setTransientVar(String name, Object value)
Transient variables are not persisted with the instance.
name
- transient variable name.value
- transient variable value, setting a null
value removes the variable.Object getTransientVar(String name)
name
- name of the transient variable.null
if the variable is not in the context.String getTransition(String node)
This is meaninful only for action and decision nodes.
node
- the node name.null
if the node didn't execute yet.NodeDef getNodeDef(String executionPath)
executionPath
- execution pathCopyright © 2018 Apache Software Foundation. All rights reserved.