org.embl.ebi.escience.scufl.enactor
Interface WorkflowInstance

All Known Implementing Classes:
WorkflowInstanceImpl

public interface WorkflowInstance

This interface is implemented by any returned object that represents the state of a running workflow instance within an enactment system. It includes methods to pause and resume the workflow, get the status and any result documents that may be available, get intermediate results and other state querying operations. It is intended to act as an abstraction over classes such as the TavernaFlowReceipt.

Author:
Tom Oinn

Method Summary
 void cancelExecution()
          Cancel the currently running workflow, freeing any resources used
 boolean changeOutputPortTaskData(java.lang.String processorId, java.lang.String OutputPortName, java.lang.Object newData)
          Changes intermediate output data on the output porttask.
 void destroy()
          Signal that any allocated resources should be cleaned up because the workflow instance is no longer required.
 java.lang.String getErrorMessage()
          Returns a human readable string containing details of errors that occurred during execution of this WorkflowInstance
 java.lang.String getID()
          Return the identifier for this workflow instance assigned by the workflow enactor
 java.util.Map<java.lang.String,DataThing>[] getIntermediateResultsForProcessor(java.lang.String processorName)
          Return an array of Maps containing intermediate results for the named processor.
 java.util.Map<java.lang.String,DataThing> getOutput()
          Return the Map of DataThing objects for all known workflow outputs, keys are the output names and values are the DataThing objects.
 java.lang.String getProgressReportXMLString()
          Return the XML string of the status document
 java.lang.String getProvenanceXMLString()
          Return the XML string containing the provenance report, this document is currently poorly defined but will in the future contain the set of RDF statements generated by the knowledge collection code.
 java.lang.String getStatus()
          This method can be used to get a simple String that describes the current state of this workflow instance object.
 UserContext getUserContext()
          Get the user context for this workflow instance in the form of a UserContext implementation
 ScuflModel getWorkflowModel()
          Get the workflow model (may be offline mode!) for this workflow instance
 boolean isDataNonVolatile(java.lang.String processorId)
          Checks if task's output is allowed to be editied.
 boolean isPaused()
          Return whether the workflow is currently paused
 void pause(java.lang.String processorId)
          Add breakoint to the specific processor.
 void pauseExecution()
          Pause the workflow enactment.
 void resume(java.lang.String processorId)
          Remove breakoint to the specific processor and resume it.
 void resumeExecution()
          Resume the workflow enactment.
 void run()
          Start this workflow istance running.
 void setInputs(java.util.Map inputMap)
          Set workflow inputs.
 

Method Detail

getUserContext

UserContext getUserContext()
Get the user context for this workflow instance in the form of a UserContext implementation


run

void run()
         throws uk.ac.soton.itinnovation.freefluo.main.InvalidInputException
Start this workflow istance running.

Throws:
uk.ac.soton.itinnovation.freefluo.main.InvalidInputException - if the input is doesn't map to source in the dataflow.

getStatus

java.lang.String getStatus()
This method can be used to get a simple String that describes the current state of this workflow instance object. The possible values for the return value are enumerated in FlowStateDefinition.

Returns:
simple string to that describes the workflow status see uk.ac.soton.itinnovation.freefluo.main.FlowStateDefinition

getIntermediateResultsForProcessor

java.util.Map<java.lang.String,DataThing>[] getIntermediateResultsForProcessor(java.lang.String processorName)
                                                                               throws UnknownProcessorException
Return an array of Maps containing intermediate results for the named processor. The array is always exactly two items long, and each item is a Map containing scufl port names as keys and DataThing objects as the values present on those ports. The Map at position 0 in the array contains the input values to the processor, that at position 1 the output values. If the processor has no output or input values populated then these maps will be empty but will still be returned.

Throws:
UnknownProcessorException - thrown if the named processor is not present in the ScuflModel that this workflow instance is derived from.

getProgressReportXMLString

java.lang.String getProgressReportXMLString()
Return the XML string of the status document

Returns:
XML progress report document

getOutput

java.util.Map<java.lang.String,DataThing> getOutput()
Return the Map of DataThing objects for all known workflow outputs, keys are the output names and values are the DataThing objects.

Returns:
Map of DataThing objects

getID

java.lang.String getID()
Return the identifier for this workflow instance assigned by the workflow enactor


getErrorMessage

java.lang.String getErrorMessage()
Returns a human readable string containing details of errors that occurred during execution of this WorkflowInstance


getProvenanceXMLString

java.lang.String getProvenanceXMLString()
Return the XML string containing the provenance report, this document is currently poorly defined but will in the future contain the set of RDF statements generated by the knowledge collection code.

Returns:
XML provenance doument

pauseExecution

void pauseExecution()
Pause the workflow enactment. This consists of setting the paused boolean flag, then cancelling all running workflow processes. Be aware therefore that calling this is not always safe as it may interrupt processes that maintain some kind of external state.


resumeExecution

void resumeExecution()
Resume the workflow enactment.


isPaused

boolean isPaused()
Return whether the workflow is currently paused

Returns:
boolean true if the workflow is paused

cancelExecution

void cancelExecution()
Cancel the currently running workflow, freeing any resources used


pause

void pause(java.lang.String processorId)
Add breakoint to the specific processor. This consists of setting the hasBreakpoint boolean flag. The procesor will pause when it is about to run.


resume

void resume(java.lang.String processorId)
Remove breakoint to the specific processor and resume it. This consists of setting the hasBreakpoint boolean flag.


isDataNonVolatile

boolean isDataNonVolatile(java.lang.String processorId)
Checks if task's output is allowed to be editied.


changeOutputPortTaskData

boolean changeOutputPortTaskData(java.lang.String processorId,
                                 java.lang.String OutputPortName,
                                 java.lang.Object newData)
Changes intermediate output data on the output porttask.

Returns:
true if data is non volatile and the changes can be performed.

setInputs

void setInputs(java.util.Map inputMap)
Set workflow inputs. Takes a Map of DataThing objects, with the keys in the map being String objects corresponding to the named workflow inputs within the workflow that this instance represents the state of.


destroy

void destroy()
Signal that any allocated resources should be cleaned up because the workflow instance is no longer required.


getWorkflowModel

ScuflModel getWorkflowModel()
Get the workflow model (may be offline mode!) for this workflow instance