SMILA 1.0 API documentation

org.eclipse.smila.jobmanager.definitions
Class WorkflowDefinition

java.lang.Object
  extended by org.eclipse.smila.common.definitions.DefinitionBase
      extended by org.eclipse.smila.jobmanager.definitions.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_MODES
          name of JSON property for modes.
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 workflows.
 
Fields inherited from class org.eclipse.smila.common.definitions.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()
           
 JobRunMode getDefaultJobRunMode()
          return the default job run mode for this workflow: either the first of the configured list of modes or null.
 java.util.List<JobRunMode> getJobRunModes()
          get allowed job run modes for this workflow: either the configured ones or null, if not configured.
 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:
 AnyMap toAny(boolean includingAdditionalAttributes)
          Returns object information as an Any representation.
 
Methods inherited from class org.eclipse.smila.common.definitions.DefinitionBase
getName, getTimestamp, isReadOnly, toAny, toString, validateName
 
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 workflows.

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

KEY_MODES

public static final java.lang.String KEY_MODES
name of JSON property for modes.

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

parseWorkflow

public static WorkflowDefinition parseWorkflow(AnyMap workflowAny)
                                        throws InvalidDefinitionException
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:
InvalidDefinitionException - error parsing Any.

getParameters

public AnyMap getParameters()
Returns:
the parameters

getJobRunModes

public java.util.List<JobRunMode> getJobRunModes()
get allowed job run modes for this workflow: either the configured ones or null, if not configured.


getDefaultJobRunMode

public JobRunMode getDefaultJobRunMode()
return the default job run mode for this workflow: either the first of the configured list of modes or null.


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 1.0 API documentation