Class JobDefinition


@JsonData public final class JobDefinition extends AbstractDefinition<JobDefinition>
Definition of a job for a TaskDefinition with settings required for the job. A job does some work and often produces some Results which is than passed to the adjacent ResultActions.

Jobs are created from the definition roughly as:

 JobDefinition ——extensionName—⟶ JobFactory ——createFrom()—⟶ Job
 

To map from a JobDefinition to a JobFactory the method AbstractDefinition.getExtensionName() has to return a name for which a JobFactory is registered in the ServerPluginManager.
This definition also includes settings for the job, i.e. for a report-job the path to the rpt-file. The extension name and the valid properties are usually defined and documented in the corresponding JobFactory.

Since:
taskplanner 3.0
  • Constructor Details

    • JobDefinition

      public JobDefinition(String extensionName)
      Creates a new JobDefinition instance.
      Parameters:
      extensionName - the unique extensionName, there must be a JobFactory for this extensionName.
      Since:
      taskplanner 3.0
    • JobDefinition

      public JobDefinition(String extensionName, @Nullable @Nullable Map<String,String> properties)
      Creates a new JobDefinition instance.
      Parameters:
      properties - the initial properties to be set, null will have no effect
      extensionName - the unique extensionName, there must be a JobFactory for this extensionName.
      Since:
      taskplanner 3.0
  • Method Details

    • getCondition

      @Nullable public @Nullable ConditionDefinition getCondition()
      Get the condition of this Job. The condition defines if the result of this job must be handled or not.
      Returns:
      the condition of this job, can be null.
      Since:
      taskplanner 3.0
    • setCondition

      public void setCondition(@Nullable @Nullable ConditionDefinition condition)
      Sets the condition of this JobDefinition. The condition defines if the result of this job must be handled or not.
      Parameters:
      condition - the condition to set, can be null
      Since:
      taskplanner 3.0
    • copyDefinition

      public JobDefinition copyDefinition()
      Makes a deep copy of this definition.
      Specified by:
      copyDefinition in class AbstractDefinition<JobDefinition>
      Returns:
      a deep copy of this definition.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractDefinition<JobDefinition>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class AbstractDefinition<JobDefinition>