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)
  • Constructor Details

    • BaseWorkFlowTask

      public BaseWorkFlowTask()
  • Method Details

    • setBeanName

      public void setBeanName(String name)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • getWorkFlowCheckers

      public List<WorkFlow> getWorkFlowCheckers()
    • setWorkFlowCheckers

      public void setWorkFlowCheckers(List<WorkFlow> workFlowCheckers)
    • getProjectId

      public UUID getProjectId(WorkContext workContext)
    • getMainExecutionId

      public UUID getMainExecutionId(WorkContext workContext)
    • addParameter

      public void addParameter(WorkContext workContext, String key, String value)
    • getAllParameters

      public Map<String,String> getAllParameters(WorkContext workContext)
    • getRequiredParameterValue

      public String getRequiredParameterValue(WorkContext workContext, String parameterName) throws MissingParameterException
      Get Parameters specific to this WorkFlowTask, this is a required parameter
      Parameters:
      workContext -
      parameterName -
      Returns:
      String value for the Parameter name
      Throws:
      MissingParameterException
    • getOptionalParameterValue

      public String getOptionalParameterValue(WorkContext workContext, String parameterName, String defaultValue)
      Gets an optional parameter. Returns the defaultValue if not found
      Parameters:
      workContext -
      parameterName -
      defaultValue -
      Returns:
      Throws:
      MissingParameterException