SMILA (incubation) API documentation

org.eclipse.smila.jobmanager
Class WorkflowDefinition

java.lang.Object
  extended by org.eclipse.smila.jobmanager.DefinitionBase
      extended by org.eclipse.smila.jobmanager.WorkflowDefinition

public class WorkflowDefinition
extends DefinitionBase

Definition of a workflow. JSON format:

 {
   "name": "indexUpdate",
   "parameters":
     {
       "paramName": "paramValue"
     },
   "startAction":
     {
        "worker": "sfrIndexOptimizer",
        "parameters":
           {
              "index": "indexName"
           },
        "input":
           {
              "partitionsToMerge": "indexPartitionsBucket"
           },
        "output":
           {
              "newPartition": "indexPartitionsBucket"
           }
     },
   "actions": [
        {
           "worker": "sfrRecordDeleter",
           "parameters":
              {
                  "index": "indexName"
              },
           "input":
              {
                  "partition": "indexPartitionsBucket",
                  "deletedRecords": "indexDeletesBucket"
              }
        } ]
 }
 


Field Summary
static java.lang.String KEY_ACTIONS
          name of JSON property for actions.
static java.lang.String KEY_PARAMETERS
          name of JSON property for parameters.
static java.lang.String KEY_START_ACTION
          name of JSON property for startAction.
static java.lang.String KEY_VALUE
          name of JSON property for parameter value.
static java.lang.String KEY_WORKFLOWS
          name of JSON property for lists of buckets.
 
Fields inherited from class org.eclipse.smila.jobmanager.DefinitionBase
_anyMap, _name, _readOnly, _timestamp, KEY_NAME, KEY_READ_ONLY, KEY_TIMESTAMP
 
Constructor Summary
WorkflowDefinition(AnyMap workflow)
          parse workflow definition from Any object.
 
Method Summary
 java.util.Collection<WorkflowAction> getActions()
           
 AnyMap getParameters()
           
 java.util.Collection<java.lang.String> getReferencedBuckets()
          Returns the names of all buckets this workflow references.
 java.util.Collection<java.lang.String> getReferencedWorkers()
          Returns the names of all workers this workflow references.
 WorkflowAction getStartAction()
           
static WorkflowDefinition parseWorkflow(AnyMap workflowAny)
          Parse on single workflow from an Any object containing a workflow description:
static java.util.Collection<WorkflowDefinition> parseWorkflows(AnyMap workflowsAny, boolean setReadOnly)
          Parse workflow list from an Any object containing a sequence of workflow descriptions:
 AnyMap toAny(boolean includingAdditionalAttributes)
          Returns object information as an Any representation.
 
Methods inherited from class org.eclipse.smila.jobmanager.DefinitionBase
getName, getTimestamp, isReadOnly, toAny, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_WORKFLOWS

public static final java.lang.String KEY_WORKFLOWS
name of JSON property for lists of buckets.

See Also:
Constant Field Values

KEY_PARAMETERS

public static final java.lang.String KEY_PARAMETERS
name of JSON property for parameters.

See Also:
Constant Field Values

KEY_VALUE

public static final java.lang.String KEY_VALUE
name of JSON property for parameter value.

See Also:
Constant Field Values

KEY_START_ACTION

public static final java.lang.String KEY_START_ACTION
name of JSON property for startAction.

See Also:
Constant Field Values

KEY_ACTIONS

public static final java.lang.String KEY_ACTIONS
name of JSON property for actions.

See Also:
Constant Field Values
Constructor Detail

WorkflowDefinition

public WorkflowDefinition(AnyMap workflow)
                   throws java.lang.Exception
parse workflow definition from Any object.

Parameters:
workflow - see class comment for format of Any object
Throws:
java.lang.Exception - An exception that occurred while converting the object.
Method Detail

parseWorkflows

public static java.util.Collection<WorkflowDefinition> parseWorkflows(AnyMap workflowsAny,
                                                                      boolean setReadOnly)
                                                               throws InvalidConfigException
Parse workflow list from an Any object containing a sequence of workflow descriptions:
 {
   "workflows": [
     {
       // see class comment for job format.
     }
   ]
 }
 

Parameters:
workflowsAny - workflow sequence as Any.
setReadOnly - if 'true' the resulting definitions will have the readOnly flag set to 'true'
Returns:
list of parsed workflow definitions.
Throws:
InvalidConfigException - error parsing Any.

parseWorkflow

public static WorkflowDefinition parseWorkflow(AnyMap workflowAny)
                                        throws InvalidConfigException
Parse on single workflow from an Any object containing a workflow description:
 {
 // see class comment for workflow format.
 }
 

Parameters:
workflowAny - workflow as Any.
Returns:
parsed workflow definition.
Throws:
InvalidConfigException - error parsing Any.

getParameters

public AnyMap getParameters()
Returns:
the parameters

getStartAction

public WorkflowAction getStartAction()
Returns:
the startAction

getActions

public java.util.Collection<WorkflowAction> getActions()
Returns:
the actions. (Does not include start action)

toAny

public AnyMap toAny(boolean includingAdditionalAttributes)
Returns object information as an Any representation.

Overrides:
toAny in class DefinitionBase
Parameters:
includingAdditionalAttributes - 'true' if also any additional information in the AnyMap should be returned, 'false' if only the (minimal set of) relevant information should be returned.
Returns:
Any object describing this workflow definition.

getReferencedBuckets

public java.util.Collection<java.lang.String> getReferencedBuckets()
Returns the names of all buckets this workflow references.

Returns:
The referenced buckets.

getReferencedWorkers

public java.util.Collection<java.lang.String> getReferencedWorkers()
Returns the names of all workers this workflow references.

Returns:
The referenced workers.

SMILA (incubation) API documentation