Class JobDefinition


@JsonData public final class JobDefinition extends AbstractDefinition<JobDefinition>
Definition of a job for a TaskDefinition with the settings required for the job. A job does some work and often produces results that are then passed to the adjacent result actions.

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 extension name; there must be a JobFactory for this extension name.
      Since:
      taskplanner 3.0
    • JobDefinition

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

    • getCondition

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

      public void setCondition(@Nullable ConditionDefinition condition)
      Sets the condition of this job definition. The condition defines whether the result of this job must be handled.
      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>