@ControlBoundary public interface WorkflowInstanceFacade
TODO - we should probably have callbacks for failure states here, but that would need a decent definition (and maybe even ontology of) what failure means. It's less obvious in a data streaming world what a failure is. At the moment the dispatch stack can potentially treat unhandled error messages as failing the processor, how do we get this exception information back up to the workflow level?
Modifier and Type | Interface and Description |
---|---|
static class |
WorkflowInstanceFacade.State |
Modifier and Type | Field and Description |
---|---|
static WeakHashMap<String,WeakReference<WorkflowInstanceFacade>> |
workflowRunFacades
A weak hash map of all workflow run IDs mapped against the corresponding
WorkflowInstanceFacadeS.
|
Modifier and Type | Method and Description |
---|---|
void |
addFacadeListener(FacadeListener listener)
A failure listener reports on overall workflow failure.
|
void |
addResultListener(ResultListener listener)
The result listener is used to handle data tokens produced by the
workflow.
|
boolean |
cancelWorkflowRun()
Cancel the workflow run corresponding to this facade
|
void |
fire()
Where a workflow has no inputs this method will cause it to start
processing.
|
InvocationContext |
getContext()
Return the invocation context used by this facade
|
Dataflow |
getDataflow()
Return the dataflow this facade facades
|
String |
getIdentifier()
An identifier that is unique to this facade.
|
WeakHashMap<String,T2Reference> |
getPushedDataMap()
Return a map of the data pushed on the named port
|
WorkflowInstanceFacade.State |
getState()
Return the current workflow
WorkflowInstanceFacade.State . |
TypedTreeModel<MonitorNode> |
getStateModel()
Workflow state is available through a sub-tree of the monitor tree.
|
String |
getWorkflowRunId()
Get the unique id of the wf run inside the facede.
|
boolean |
pauseWorkflowRun()
Pause the workflow run corresponding to this facade
|
void |
pushData(WorkflowDataToken token,
String portName)
Push a data token into the specified port.
|
void |
removeFacadeListener(FacadeListener listener)
Remove a previously registered failure listener
|
void |
removeResultListener(ResultListener listener)
Remove a previously registered result listener
|
boolean |
resumeWorkflowRun()
Resume the workflow run corresponding to this facade
|
static final WeakHashMap<String,WeakReference<WorkflowInstanceFacade>> workflowRunFacades
void pushData(WorkflowDataToken token, String portName) throws TokenOrderException
token
- A WorkflowDataToken containing the data to be pushed to the
workflow along with its current owning process identifier and
indexportName
- Port name to useTokenOrderException
- if ordering constraints on the token stream to each input
port are violatedvoid fire() throws IllegalStateException
IllegalStateException
- if the workflow has already been fired or has had data pushed
to it.void addResultListener(ResultListener listener)
If the listener is registered after the workflow has already produced results it will be immediately called with any results previously produced. Where the workflow has completed a stream of results it may only message the listener with the highest level one, so for a case where a list of results is emited one at a time the listener may either get the individual items followed by the list token or if registered after the list token has been emited only receive the list token.
listener
- void removeResultListener(ResultListener listener)
listener
- void addFacadeListener(FacadeListener listener)
As with the result listener a failure listener registered after the workflow has already failed will be immediately called with the failure data.
void removeFacadeListener(FacadeListener listener)
TypedTreeModel<MonitorNode> getStateModel()
Uses the standard TreeModel-like mechanisms for registering change events and can be plugged into a JTree for display purposes through the TreeModelAdapter class.
Dataflow getDataflow()
InvocationContext getContext()
WeakHashMap<String,T2Reference> getPushedDataMap()
String getWorkflowRunId()
boolean cancelWorkflowRun() throws IllegalStateException
IllegalStateException
boolean pauseWorkflowRun() throws IllegalStateException
IllegalStateException
boolean resumeWorkflowRun() throws IllegalStateException
IllegalStateException
WorkflowInstanceFacade.State getState()
WorkflowInstanceFacade.State
.String getIdentifier()
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.