public class WorkflowInstanceFacadeImpl extends Object implements WorkflowInstanceFacade
WorkflowInstanceFacade
Modifier and Type | Class and Description |
---|---|
protected class |
WorkflowInstanceFacadeImpl.FacadeResultListener |
class |
WorkflowInstanceFacadeImpl.StateProperty |
WorkflowInstanceFacade.State
Modifier and Type | Field and Description |
---|---|
protected List<FacadeListener> |
facadeListeners |
protected static AtomicLong |
owningProcessId |
protected List<ResultListener> |
resultListeners |
Date |
stateLastModified |
workflowRunFacades
Constructor and Description |
---|
WorkflowInstanceFacadeImpl(Dataflow dataflow,
InvocationContext context,
String parentProcess) |
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
|
protected void |
checkWorkflowFinished(org.apache.taverna.facade.impl.WorkflowInstanceFacadeImpl.WorkflowInstanceFacadeChange change) |
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
|
void |
setState(WorkflowInstanceFacade.State newState) |
void |
setWorkflowRunId(String workflowRunId) |
protected static AtomicLong owningProcessId
public Date stateLastModified
protected List<FacadeListener> facadeListeners
protected List<ResultListener> resultListeners
public WorkflowInstanceFacadeImpl(Dataflow dataflow, InvocationContext context, String parentProcess) throws InvalidDataflowException
InvalidDataflowException
public InvocationContext getContext()
WorkflowInstanceFacade
getContext
in interface WorkflowInstanceFacade
public void addFacadeListener(FacadeListener listener)
WorkflowInstanceFacade
As with the result listener a failure listener registered after the workflow has already failed will be immediately called with the failure data.
addFacadeListener
in interface WorkflowInstanceFacade
public void addResultListener(ResultListener listener)
WorkflowInstanceFacade
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.
addResultListener
in interface WorkflowInstanceFacade
public void fire() throws IllegalStateException
WorkflowInstanceFacade
fire
in interface WorkflowInstanceFacade
IllegalStateException
- if the workflow has already been fired or has had data pushed
to it.public Dataflow getDataflow()
WorkflowInstanceFacade
getDataflow
in interface WorkflowInstanceFacade
public TypedTreeModel<MonitorNode> getStateModel()
WorkflowInstanceFacade
Uses the standard TreeModel-like mechanisms for registering change events and can be plugged into a JTree for display purposes through the TreeModelAdapter class.
getStateModel
in interface WorkflowInstanceFacade
public void pushData(WorkflowDataToken token, String portName) throws TokenOrderException
WorkflowInstanceFacade
pushData
in interface WorkflowInstanceFacade
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 violatedpublic void removeFacadeListener(FacadeListener listener)
WorkflowInstanceFacade
removeFacadeListener
in interface WorkflowInstanceFacade
public void removeResultListener(ResultListener listener)
WorkflowInstanceFacade
removeResultListener
in interface WorkflowInstanceFacade
protected void checkWorkflowFinished(org.apache.taverna.facade.impl.WorkflowInstanceFacadeImpl.WorkflowInstanceFacadeChange change)
public WeakHashMap<String,T2Reference> getPushedDataMap()
WorkflowInstanceFacade
getPushedDataMap
in interface WorkflowInstanceFacade
public void setWorkflowRunId(String workflowRunId)
public String getWorkflowRunId()
WorkflowInstanceFacade
getWorkflowRunId
in interface WorkflowInstanceFacade
public WorkflowInstanceFacade.State getState()
WorkflowInstanceFacade
WorkflowInstanceFacade.State
.getState
in interface WorkflowInstanceFacade
public void setState(WorkflowInstanceFacade.State newState) throws IllegalStateException
IllegalStateException
public boolean cancelWorkflowRun()
WorkflowInstanceFacade
cancelWorkflowRun
in interface WorkflowInstanceFacade
public boolean pauseWorkflowRun()
WorkflowInstanceFacade
pauseWorkflowRun
in interface WorkflowInstanceFacade
public boolean resumeWorkflowRun()
WorkflowInstanceFacade
resumeWorkflowRun
in interface WorkflowInstanceFacade
public String getIdentifier()
WorkflowInstanceFacade
getIdentifier
in interface WorkflowInstanceFacade
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.