org.embl.ebi.escience.scufl.enactor
Class WorkflowEventAdapter

java.lang.Object
  extended by org.embl.ebi.escience.scufl.enactor.WorkflowEventAdapter
All Implemented Interfaces:
WorkflowEventListener
Direct Known Subclasses:
RshellConnectionManager

public class WorkflowEventAdapter
extends java.lang.Object
implements WorkflowEventListener

An (abstract) adapter around the workflow event listener interface allowing for convenient implementation of a subset of the available event handlers.

Author:
Tom Oinn

Constructor Summary
WorkflowEventAdapter()
           
 
Method Summary
 void collectionConstructed(CollectionConstructionEvent e)
          Called when a data item is wrapped up inside a default collection prior to being passed to a service expecting a higher cardinality version of the same input type
 void dataChanged(UserChangedDataEvent e)
          Called when a user changes intemediate data (output).
 void nestedWorkflowCompleted(NestedWorkflowCompletionEvent e)
          Called when a nested workflow instance has completed its invocation successfully.
 void nestedWorkflowCreated(NestedWorkflowCreationEvent e)
          Called when a nested workflow instance is created and about to be invoked by the enactor instance.
 void nestedWorkflowFailed(NestedWorkflowFailureEvent e)
          Called when a nested workflow fails.
 void processCompleted(ProcessCompletionEvent e)
          Called when an individual processor within a workflow completes its invocation successfuly.
 void processCompletedWithIteration(IterationCompletionEvent e)
          Called when the iteration stage of the processor is completed the event carries details of the LSIDs of the component results which are now integrated into the result of the process
 void processFailed(ProcessFailureEvent e)
          Called when a process fails - typically this will be followed by a WorkflowFailed event.
 void workflowCompleted(WorkflowCompletionEvent e)
          Called when a previously scheduled workflow completes successfuly.
 void workflowCreated(WorkflowCreationEvent e)
          Called when a workflow instance has been submitted along with associated input data to an enactor instance.
 void workflowDestroyed(WorkflowDestroyedEvent event)
          This event is sent after workflowInstance.destroy() has been called.
 void workflowFailed(WorkflowFailureEvent e)
          Called when a workflow instance fails for some reason
 void workflowToBeDestroyed(WorkflowToBeDestroyedEvent event)
          Called right before workflowInstance.destroy() is to be called.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowEventAdapter

public WorkflowEventAdapter()
Method Detail

workflowCreated

public void workflowCreated(WorkflowCreationEvent e)
Called when a workflow instance has been submitted along with associated input data to an enactor instance. Methods on the WorkflowCreationEvent allow access to the underlying workflow instance, the user context and the enactor.

Specified by:
workflowCreated in interface WorkflowEventListener

workflowFailed

public void workflowFailed(WorkflowFailureEvent e)
Description copied from interface: WorkflowEventListener
Called when a workflow instance fails for some reason

Specified by:
workflowFailed in interface WorkflowEventListener

workflowCompleted

public void workflowCompleted(WorkflowCompletionEvent e)
Description copied from interface: WorkflowEventListener
Called when a previously scheduled workflow completes successfuly. This is called after results are available, so storage plugins may rely on the getResults method on the workflow instance references within the event being valid.

Specified by:
workflowCompleted in interface WorkflowEventListener

processCompleted

public void processCompleted(ProcessCompletionEvent e)
Description copied from interface: WorkflowEventListener
Called when an individual processor within a workflow completes its invocation successfuly. For cases where iteration is involved this is called once for each invocation of the processor task within the iteration.

Specified by:
processCompleted in interface WorkflowEventListener

processCompletedWithIteration

public void processCompletedWithIteration(IterationCompletionEvent e)
Description copied from interface: WorkflowEventListener
Called when the iteration stage of the processor is completed the event carries details of the LSIDs of the component results which are now integrated into the result of the process

Specified by:
processCompletedWithIteration in interface WorkflowEventListener

processFailed

public void processFailed(ProcessFailureEvent e)
Description copied from interface: WorkflowEventListener
Called when a process fails - typically this will be followed by a WorkflowFailed event.

Specified by:
processFailed in interface WorkflowEventListener

collectionConstructed

public void collectionConstructed(CollectionConstructionEvent e)
Description copied from interface: WorkflowEventListener
Called when a data item is wrapped up inside a default collection prior to being passed to a service expecting a higher cardinality version of the same input type

Specified by:
collectionConstructed in interface WorkflowEventListener

dataChanged

public void dataChanged(UserChangedDataEvent e)
Description copied from interface: WorkflowEventListener
Called when a user changes intemediate data (output).

Specified by:
dataChanged in interface WorkflowEventListener

nestedWorkflowCompleted

public void nestedWorkflowCompleted(NestedWorkflowCompletionEvent e)
Description copied from interface: WorkflowEventListener
Called when a nested workflow instance has completed its invocation successfully. The event carries with it details of the workflow instance invoked.

Specified by:
nestedWorkflowCompleted in interface WorkflowEventListener

nestedWorkflowCreated

public void nestedWorkflowCreated(NestedWorkflowCreationEvent e)
Description copied from interface: WorkflowEventListener
Called when a nested workflow instance is created and about to be invoked by the enactor instance. Where a nested workflow exists within an iteration, this will be called for each iteration.The event carries details of the workflow instance created.

Specified by:
nestedWorkflowCreated in interface WorkflowEventListener

nestedWorkflowFailed

public void nestedWorkflowFailed(NestedWorkflowFailureEvent e)
Description copied from interface: WorkflowEventListener
Called when a nested workflow fails. The event contains an referenece to the failed workflow instance.

Specified by:
nestedWorkflowFailed in interface WorkflowEventListener

workflowDestroyed

public void workflowDestroyed(WorkflowDestroyedEvent event)
Description copied from interface: WorkflowEventListener
This event is sent after workflowInstance.destroy() has been called.

This is the last message you receive about this workflow instance, which by now should not be accessed anymore.

event.getWorkflowInstance() on this event will therefore always return null, but you can access what would have been the result of workflowInstance.getID() by calling event.getWorkflowInstanceID().

If you would like to access the instance before it has been destroyed, do so from workflowToBeDestroyed(WorkflowToBeDestroyedEvent)

Specified by:
workflowDestroyed in interface WorkflowEventListener

workflowToBeDestroyed

public void workflowToBeDestroyed(WorkflowToBeDestroyedEvent event)
Description copied from interface: WorkflowEventListener
Called right before workflowInstance.destroy() is to be called. (Usually this has been triggered by the user clicking a "Close" button in the result window)

This is your last chance to access the workflow instance before it becomes unusable. workflowDestroyed(WorkflowDestroyedEvent) will be called after destroy() has been invoked, but at that point it will be too late to access the instance.

Note: This is the last chance to access workflowInstance before it is destroyed. If you have your own references to the instance or any of the data of workflowInstance (such as the input map), this is the time to remove such references.

Specified by:
workflowToBeDestroyed in interface WorkflowEventListener