Package com.redhat.parodos.workflow.task
Class BaseWorkFlowTask
java.lang.Object
com.redhat.parodos.workflow.task.BaseWorkFlowTask
- All Implemented Interfaces:
WorkFlowTask,Work,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
BaseAssessmentTask,BaseInfrastructureWorkFlowTask,BaseWorkFlowCheckerTask,ShellRunnerTask
public abstract class BaseWorkFlowTask
extends Object
implements WorkFlowTask, org.springframework.beans.factory.BeanNameAware
Base Class for a WorkFlowTask.
This includes logic for getting Parameter values from the WorkContext. The bean name is used when Reading from the WorkContextDelegate as more than one WorkflowTask might have the same ParameterName
- Author:
- Luke Shannon (Github: lshannon), Richard Wang (Github: richardW98)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdditionInfo(String key, String value) voidaddParameter(String key, String value) getAllParameters(WorkContext workContext) getOptionalParameterValue(String parameterName, String defaultValue) Gets an optional parameter.getOptionalParameterValue(String parameterName, String defaultValue, Boolean isNullable) Gets an optional parameter and nullable or not.getProjectId(WorkContext workContext) getRequiredParameterValue(String parameterName) Get Parameters specific to this WorkFlowTask, this is a required parametervoidpreExecute(WorkContext workContext) method runs before @see execute()voidsetBeanName(String name) voidsetWorkFlowCheckers(List<WorkFlow> workFlowCheckers) booleanvalidateWorkflowParameters(WorkContext workContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.redhat.parodos.workflow.task.WorkFlowTask
getAsJsonSchema, getWorkFlowTaskOutputs, getWorkFlowTaskParameters
-
Field Details
-
taskLogger
-
-
Constructor Details
-
BaseWorkFlowTask
public BaseWorkFlowTask()
-
-
Method Details
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
preExecute
Description copied from interface:WorkFlowTaskmethod runs before @see execute()- Specified by:
preExecutein interfaceWorkFlowTask
-
getWorkFlowCheckers
-
setWorkFlowCheckers
-
getProjectId
-
getMainExecutionId
-
addParameter
-
getAllParameters
-
addAdditionInfo
-
getRequiredParameterValue
Get Parameters specific to this WorkFlowTask, this is a required parameter- Parameters:
parameterName-- Returns:
- String value for the Parameter name
- Throws:
MissingParameterException
-
validateWorkflowParameters
-
getOptionalParameterValue
Gets an optional parameter. Returns the defaultValue if not found- Parameters:
parameterName-defaultValue-- Returns:
- Throws:
MissingParameterException
-
getOptionalParameterValue
public String getOptionalParameterValue(String parameterName, String defaultValue, Boolean isNullable) Gets an optional parameter and nullable or not. Returns the defaultValue if not found- Parameters:
parameterName- parameter namedefaultValue- default valueisNullable- is nullable- Returns:
- parameter value
- Throws:
MissingParameterException- exception
-