Package org.opencastproject.workflow.api
Class WorkflowOperationDefinitionImpl
java.lang.Object
org.opencastproject.workflow.api.WorkflowOperationDefinitionImpl
- All Implemented Interfaces:
Configurable,WorkflowOperationDefinition
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<JaxbWorkflowConfiguration> protected Stringprotected Stringprotected Stringprotected booleanprotected Stringprotected intprotected RetryStrategyprotected String -
Constructor Summary
ConstructorsConstructorDescriptionA no-arg constructor is needed by JAXBWorkflowOperationDefinitionImpl(String id, String description, String exceptionHandlingWorkflow, boolean failWorkflowOnException) -
Method Summary
Modifier and TypeMethodDescriptiongetConfiguration(String key) Returns the value of propertynameornullif no such property has been set.Gets the configuration keys that are currently set for this configurable entity.The workflow to run if an exception is thrown while this operation is running.Returns eithernullortrueto have the operation executed.getId()intReturns the number of attempts the workflow service will make to execute this operation.Return the retry strategyReturns eithernullortrueto have the operation skipped.booleanIf true, this workflow will be put into a failed (or failing, if getExceptionHandlingWorkflow() is not null) state when exceptions are thrown during an operation.voidRemoves thekeyconfiguration.voidsetConfiguration(String key, String value) Sets the configuration with namekeyto valuevalue, or adds it if it doesn't already exist.voidsetDescription(String description) voidsetExceptionHandlingWorkflow(String exceptionHandlingWorkflow) voidsetExecutionCondition(String condition) voidsetFailWorkflowOnException(boolean failWorkflowOnException) voidvoidsetMaxAttempts(int maxAttempts) voidsetRetryStrategy(RetryStrategy retryStrategy) voidsetSkipCondition(String condition) toString()
-
Field Details
-
id
-
description
-
failWorkflowOnException
protected boolean failWorkflowOnException -
executeCondition
-
skipCondition
-
exceptionHandlingWorkflow
-
configurations
-
maxAttempts
protected int maxAttempts -
retryStrategy
-
-
Constructor Details
-
WorkflowOperationDefinitionImpl
public WorkflowOperationDefinitionImpl()A no-arg constructor is needed by JAXB -
WorkflowOperationDefinitionImpl
public WorkflowOperationDefinitionImpl(String id, String description, String exceptionHandlingWorkflow, boolean failWorkflowOnException) - Parameters:
id- The unique name of this operationdescription- The description of what this operation doesexceptionHandlingWorkflow- The workflow to run when a workflow operation exception is thrownfailWorkflowOnException- Whether an exception thrown by this operation should fail the entireWorkflowInstance
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceWorkflowOperationDefinition
-
setId
-
getDescription
- Specified by:
getDescriptionin interfaceWorkflowOperationDefinition
-
setDescription
-
setExecutionCondition
-
getExecutionCondition
Description copied from interface:WorkflowOperationDefinitionReturns eithernullortrueto have the operation executed. Any other value is interpreted asfalseand will skip the operation.Usually, this will be a variable name such as
${foo}, which will be replaced with its acutal value once the workflow is executed.If both
getExecuteCondition()andgetSkipConditionreturn a non-null value, the execute condition takes precedence.- Specified by:
getExecutionConditionin interfaceWorkflowOperationDefinition- Returns:
- the excecution condition.
-
setSkipCondition
-
getSkipCondition
Description copied from interface:WorkflowOperationDefinitionReturns eithernullortrueto have the operation skipped. Any other value is interpreted asfalseand will execute the operation.Usually, this will be a variable name such as
${foo}, which will be replaced with its actual value once the workflow is executed.If both
getExecuteCondition()andgetSkipConditionreturn a non-null value, the execute condition takes precedence.- Specified by:
getSkipConditionin interfaceWorkflowOperationDefinition- Returns:
- the excecution condition.
-
getExceptionHandlingWorkflow
The workflow to run if an exception is thrown while this operation is running.- Specified by:
getExceptionHandlingWorkflowin interfaceWorkflowOperationDefinition- See Also:
-
setExceptionHandlingWorkflow
-
isFailWorkflowOnException
public boolean isFailWorkflowOnException()If true, this workflow will be put into a failed (or failing, if getExceptionHandlingWorkflow() is not null) state when exceptions are thrown during an operation.- Specified by:
isFailWorkflowOnExceptionin interfaceWorkflowOperationDefinition- See Also:
-
setFailWorkflowOnException
public void setFailWorkflowOnException(boolean failWorkflowOnException) -
getConfiguration
Returns the value of propertynameornullif no such property has been set.- Specified by:
getConfigurationin interfaceConfigurable- Parameters:
key- the configuration key- Returns:
- the configuration value
- See Also:
-
removeConfiguration
Removes thekeyconfiguration.- Specified by:
removeConfigurationin interfaceConfigurable- Parameters:
key- the configuration key- See Also:
-
setConfiguration
Sets the configuration with namekeyto valuevalue, or adds it if it doesn't already exist.- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
key- the configuration keyvalue- the configuration value- See Also:
-
getConfigurationKeys
Gets the configuration keys that are currently set for this configurable entity.- Specified by:
getConfigurationKeysin interfaceConfigurable- Returns:
- the configuration keys
- See Also:
-
getRetryStrategy
Return the retry strategy- Specified by:
getRetryStrategyin interfaceWorkflowOperationDefinition- Returns:
- the retry strategy
- See Also:
-
setRetryStrategy
- Parameters:
retryStrategy- the retry strategy to set
-
getMaxAttempts
public int getMaxAttempts()Returns the number of attempts the workflow service will make to execute this operation.- Specified by:
getMaxAttemptsin interfaceWorkflowOperationDefinition- Returns:
- the maximum number of retries before failing
- See Also:
-
setMaxAttempts
public void setMaxAttempts(int maxAttempts) - Parameters:
maxAttempts- the maxAttempts to set
-
toString
-