org.openemcee.microflow.frontend
Class MicroflowRunner

java.lang.Object
  extended byorg.openemcee.microflow.frontend.MicroflowRunner

public class MicroflowRunner
extends java.lang.Object

The Microflow runner is a Façade which makes execution of a Microflow more user friendly. It is produced by the MicroflowFactory, also in this package.

Author:
Scott Schenkein

Nested Class Summary
 class MicroflowRunner.BusinessException
          See documentation for "run()".
 class MicroflowRunner.DataIntegrityException
          See documentation for "run()".
 class MicroflowRunner.MicroflowException
          See documentation for "run()".
 class MicroflowRunner.MicroflowFailure
          See documentation for "run()".
 
Field Summary
protected  MicroflowExecutor exec
          This is the executor under which this Microflow will be run.
 
Constructor Summary
MicroflowRunner(JobDescriptor job)
          Creates a new instance of MicroflowExecution, given a JobDescriptor instance.
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.Object value)
          Add microflow data to the workflow.
 java.lang.Object getAttribute(java.lang.String name)
          Retrieve a named attribute.
 MicroflowExecutor getExec()
          Getter for property exec.
 void run()
          Run the microflow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exec

protected MicroflowExecutor exec
This is the executor under which this Microflow will be run.

Constructor Detail

MicroflowRunner

public MicroflowRunner(JobDescriptor job)
Creates a new instance of MicroflowExecution, given a JobDescriptor instance. This constructor is typically called from the MicroflowExecutor.

Parameters:
job - The Job which this Runner will execute.
Method Detail

run

public void run()
         throws MicroflowRunner.BusinessException,
                MicroflowRunner.DataIntegrityException,
                MicroflowRunner.MicroflowFailure
Run the microflow. Call this after you have set all the initial data attributes using "addAttribute".

Throws:
MicroflowRunner.BusinessException - The workflow completed with an "outcome" that maps to "failure".
MicroflowRunner.DataIntegrityException - Invalid data was introduced into the workflow.
MicroflowRunner.MicroflowFailure - The flow was unable to execute, see message and chained exception for more info.

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.Object value)
Add microflow data to the workflow. This should only be called prior to calling "run". The data is forced to be allowed if it is not defined in the microflow. It will use the actual class as the schematized type. If you wish it to be a wider type, set it explicitly in the XML.

Parameters:
name - The name for this attribute.
value - The initial value of the attribute.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Retrieve a named attribute. This can be set using "addAttribute", or by a task in the Microflow. If the attribute is unset, it returns null.

Parameters:
name - The name of the attribute to retrieve.
Returns:
The value of the name parameter, or null if unset.

getExec

public MicroflowExecutor getExec()
Getter for property exec.

Returns:
Value of property exec.


OpenEmcee Microflow Engine for Java: All software and content contained herein is subject to the Mozilla public license v1.1.
SourceForge.net Logo