eu.planets_project.ifr.core.wee.api.workflow
Interface WorkflowTemplate

All Superinterfaces:
java.io.Serializable

public interface WorkflowTemplate
extends java.io.Serializable

An implementation of this interface can extend the WorkflowTemplateHelper util object, which provides all methods that are required for the Factory for building a WorkflowInstance by reflection except execute() and describe() - which need to be implemented by a WorkflowTemplate provider.

Since:
12.02.2009

Nested Class Summary
static class WorkflowTemplate.ParameterType
          Defines the usage of a given parameter.
 
Field Summary
static java.lang.String SER_PARAM_MIGRATE_FROM
          External property key for original file format for migration
static java.lang.String SER_PARAM_MIGRATE_TO
          External property key for target file format for migration
static java.lang.String SER_PARAMS
          External property key for service parameters
 
Method Summary
 void addWFResultItem(WorkflowResultItem wfResultItem)
          Adds a workflow item to the workflowResult object that's used to record information for this call
 java.lang.String describe()
           
 WorkflowResult execute(DigitalObject dio)
          This method contains the workflow's logic: e.g.
 WorkflowResult finalizeExecution()
          Build and attache items for finalizing the execution overall execution for this template e.g.
 java.util.List<DigitalObject> getData()
          A getter for the workflow's payload to start upon.
 DataRegistry getDataRegistry()
          returns a handle to the DataRegistry which can then be used to subsequently storing digital objects in a workflow template
 java.util.List<java.lang.String> getDeclaredWFServiceNames()
          Reflects a list of all declared services names
 java.util.List<java.lang.reflect.Field> getDeclaredWFServices()
          Reflects a list of all declared services (used within the workflow template's wf) that are a) in the list of getSupportedServiceTypes(); b) use private or public modifiers within the implementing class no corresponding setDeclaredWFServices as this is information is extracted implicitly from the code
 ServiceCallConfigs getServiceCallConfigs(PlanetsService forService)
           
 java.util.List<java.lang.String> getSupportedServiceTypes()
          Returns a list of all supported PlanetsServiceTypes
 Agent getWEEAgent()
          Returns an Agent that describes the WEE the template is processed by
 WorkflowResult getWFResult()
          Get the workflowResult object that's used to record information for this call
 WorkflowContext getWorkflowContext()
           
 ReportingLog getWorkflowReportingLogger()
          Returns a ReportingLog object that's being used to record the workflow's execution
 java.util.UUID getWorklowInstanceID()
          Getter for the WorkflowInstance's UUID
 WorkflowResult initializeExecution()
          This method is used for setting up a workflow, used to avoid repetition in the execute method.
 boolean isServiceTypeSupported(java.lang.reflect.Field declaredServiceField)
          Checks if a given Object Type is in the range of valid PlanetsServiceTypes e.g.
 DigitalObject retrieveDigitalObjectDataRegistryRef(java.net.URI digitalObjectRef)
          a shortcut for retrieving a digital object stored within a data registry
 void setData(java.util.List<DigitalObject> data)
          A setter for the workflow's payload to start upon.
 void setServiceCallConfigs(PlanetsService forService, ServiceCallConfigs serCallConfigs)
          Adds all additional service call specific information for a service which cannot be captured within the Service stub itself but that are handed over by the xml config and that are required for invoking a certain operation.
 void setWEEAgent(Agent agent)
          SSet the Agent here
 void setWorkflowContext(WorkflowContext wfContext)
          Contains the workflowContext that's for this template
 void setWorkflowInstanceID(java.util.UUID id)
          Setter for the WorkflowInstance's java.util.UUID
 java.net.URI storeDigitalObject(DigitalObject digoToStore)
          a shortcut for storing a digital object in the default data registry takes a digital object and stores it within the default DataRegistry (i.e.
 java.net.URI storeDigitalObjectInRepository(DigitalObject digoToStore, java.net.URI repositoryID)
           
 java.net.URI storeDigitalObjectInRepository(java.net.URI objectLocation, DigitalObject digoToStore, java.net.URI repositoryID)
          a shortcut for storing a digital object in a specified data repository
 

Field Detail

SER_PARAM_MIGRATE_FROM

static final java.lang.String SER_PARAM_MIGRATE_FROM
External property key for original file format for migration

See Also:
Constant Field Values

SER_PARAM_MIGRATE_TO

static final java.lang.String SER_PARAM_MIGRATE_TO
External property key for target file format for migration

See Also:
Constant Field Values

SER_PARAMS

static final java.lang.String SER_PARAMS
External property key for service parameters

See Also:
Constant Field Values
Method Detail

isServiceTypeSupported

boolean isServiceTypeSupported(java.lang.reflect.Field declaredServiceField)
Checks if a given Object Type is in the range of valid PlanetsServiceTypes e.g. //e.g. eu.planets_project.services.identify.Identify This information is extracted by calling: f.getType().getCanonicalName();

Parameters:
declaredServiceField -
Returns:
true if service type is supported

getSupportedServiceTypes

java.util.List<java.lang.String> getSupportedServiceTypes()
Returns a list of all supported PlanetsServiceTypes

Returns:
a java.util.List of Strings denoting supported service types

getDeclaredWFServices

java.util.List<java.lang.reflect.Field> getDeclaredWFServices()
Reflects a list of all declared services (used within the workflow template's wf) that are a) in the list of getSupportedServiceTypes(); b) use private or public modifiers within the implementing class no corresponding setDeclaredWFServices as this is information is extracted implicitly from the code

Returns:
List of java.lang.reflect.Field; of the PlanetsService objects

getDeclaredWFServiceNames

java.util.List<java.lang.String> getDeclaredWFServiceNames()
Reflects a list of all declared services names

Returns:
A java.util.List of Strings giving the declared workflow service names
See Also:
getDeclaredWFServices()

setData

void setData(java.util.List<DigitalObject> data)
A setter for the workflow's payload to start upon.

Parameters:
data - The java.util.List of DigitalObjects to use as payload

getData

java.util.List<DigitalObject> getData()
A getter for the workflow's payload to start upon.

Returns:
the payload java.util.List of DigitalObjects

setWorkflowInstanceID

void setWorkflowInstanceID(java.util.UUID id)
Setter for the WorkflowInstance's java.util.UUID

Parameters:
id - the WorkflowInstance java.util.UUID to be used

getWorklowInstanceID

java.util.UUID getWorklowInstanceID()
Getter for the WorkflowInstance's UUID

Returns:
the WorkflowInstance's java.util.UUID

getWEEAgent

Agent getWEEAgent()
Returns an Agent that describes the WEE the template is processed by

Returns:
the Agent

setWEEAgent

void setWEEAgent(Agent agent)
SSet the Agent here

Parameters:
agent -

setServiceCallConfigs

void setServiceCallConfigs(PlanetsService forService,
                           ServiceCallConfigs serCallConfigs)
Adds all additional service call specific information for a service which cannot be captured within the Service stub itself but that are handed over by the xml config and that are required for invoking a certain operation. e.g. input/output format parameter for migration calls

Parameters:
forService -
serCallConfigs -

getServiceCallConfigs

ServiceCallConfigs getServiceCallConfigs(PlanetsService forService)
Parameters:
forService - the service for which call information requested
Returns:
the service call config information

setWorkflowContext

void setWorkflowContext(WorkflowContext wfContext)
Contains the workflowContext that's for this template

Parameters:
wfContext -

getWorkflowContext

WorkflowContext getWorkflowContext()
Returns:
the template's WorkflowContext

storeDigitalObject

java.net.URI storeDigitalObject(DigitalObject digoToStore)
                                throws DataRegistry.DigitalObjectManagerNotFoundException,
                                       DigitalObjectManager.DigitalObjectNotStoredException
a shortcut for storing a digital object in the default data registry takes a digital object and stores it within the default DataRegistry (i.e. default DigitalObjectManager)

Parameters:
digoToStore -
Returns:
the URI identifying the the Digital Object Stored
Throws:
DataRegistry.DigitalObjectManagerNotFoundException
DigitalObjectManager.DigitalObjectNotStoredException
See Also:
getDataRegistry()

storeDigitalObjectInRepository

java.net.URI storeDigitalObjectInRepository(java.net.URI objectLocation,
                                            DigitalObject digoToStore,
                                            java.net.URI repositoryID)
                                            throws DataRegistry.DigitalObjectManagerNotFoundException,
                                                   DigitalObjectManager.DigitalObjectNotStoredException
a shortcut for storing a digital object in a specified data repository

Parameters:
digoToStore -
repositoryID - the data repository identifier specified in the planets:// namespace. e.g. 'planets://localhost:8080/dr/planets-jcr'
objectLocation - The suggested URI to associate with the stored object
Returns:
The URI identifying the object stored
Throws:
DataRegistry.DigitalObjectManagerNotFoundException
DigitalObjectManager.DigitalObjectNotStoredException

storeDigitalObjectInRepository

java.net.URI storeDigitalObjectInRepository(DigitalObject digoToStore,
                                            java.net.URI repositoryID)
                                            throws DataRegistry.DigitalObjectManagerNotFoundException,
                                                   DigitalObjectManager.DigitalObjectNotStoredException
Parameters:
digoToStore -
repositoryID -
Returns:
The URI identifying the object stored
Throws:
DataRegistry.DigitalObjectManagerNotFoundException
DigitalObjectManager.DigitalObjectNotStoredException

getDataRegistry

DataRegistry getDataRegistry()
returns a handle to the DataRegistry which can then be used to subsequently storing digital objects in a workflow template

Returns:
a DataRegistry interface

retrieveDigitalObjectDataRegistryRef

DigitalObject retrieveDigitalObjectDataRegistryRef(java.net.URI digitalObjectRef)
                                                   throws DigitalObjectManager.DigitalObjectNotFoundException
a shortcut for retrieving a digital object stored within a data registry

Parameters:
digitalObjectRef - A java.net.URI identifying a DigitalObject
Returns:
a digital object stored within a data registry
Throws:
DigitalObjectManager.DigitalObjectNotFoundException

getWFResult

WorkflowResult getWFResult()
Get the workflowResult object that's used to record information for this call

Returns:
the workflowResult object that's used to record information for this call

addWFResultItem

void addWFResultItem(WorkflowResultItem wfResultItem)
Adds a workflow item to the workflowResult object that's used to record information for this call

Parameters:
wfResultItem -

getWorkflowReportingLogger

ReportingLog getWorkflowReportingLogger()
Returns a ReportingLog object that's being used to record the workflow's execution

Returns:
a ReportingLog object that's being used to record the workflow's execution

initializeExecution

WorkflowResult initializeExecution()
This method is used for setting up a workflow, used to avoid repetition in the execute method.

Returns:
the initialised WorkflowResult

execute

WorkflowResult execute(DigitalObject dio)
This method contains the workflow's logic: e.g. branching, decision making etc. is pre-defined within this method - mapping of service inputs and outputs - writing results to the registries and data model - calling workflow services on the available digitalObjects (data)

Parameters:
dio - a digital object
Returns:
the WorkflowResult post execution no Exceptions thrown - all information on execution success, etc. is contained within the WorkflowResult

finalizeExecution

WorkflowResult finalizeExecution()
Build and attache items for finalizing the execution overall execution for this template e.g. overall success statements, overall workflow execution time, log-references, etc.

Returns:
The final WorkflowResult

describe

java.lang.String describe()
Returns:
A java.lang.String description of the workflow


Copyright © 2007-2010 The Planets Consortium. All Rights Reserved.