Class SequentialJob

All Implemented Interfaces:
ICompositeJob, IJob, Iterable<IJob>, Collection<IJob>, List<IJob>
Direct Known Subclasses:
DynamicSequentialJob, MWE2SequentialJob, SequentialBlackboardInteractingJob, Workflow

public class SequentialJob extends AbstractCompositeJob
Implementation of a composite job that guarantees the execution of it's jobs in the order they were added.
  • Constructor Details

    • SequentialJob

      public SequentialJob()
      Instantiates a new order preserving composite job.
    • SequentialJob

      public SequentialJob(String name)
      Instantiates a new order preserving composite job with a specific name.
      Parameters:
      name - The name of the job sequence.
    • SequentialJob

      public SequentialJob(boolean cleanUpImmediately)
      Instantiates a new sequential job.
      Parameters:
      cleanUpImmediately - Flag if jobs should be cleaned up immediately or not.
    • SequentialJob

      public SequentialJob(String name, boolean cleanUpImmediately)
      Instantiates a new model workflow job with a specific name and specifying the clean up strategy.
      Parameters:
      name - The name of the job sequence.
      cleanUpImmediately - Flag if jobs should be cleaned up immediately or not.
  • Method Details

    • execute

      public void execute(IProgressMonitor monitor) throws JobFailedException, UserCanceledException
      Executes all contained jobs, i.e. call execute() for them. Contained jobs can thus re-implement this method with functionality that should be executed.
      Specified by:
      execute in interface IJob
      Specified by:
      execute in class AbstractCompositeJob
      Parameters:
      monitor - the monitor
      Throws:
      JobFailedException - the job failed exception
      UserCanceledException - the user canceled exception
    • executeWithDelayedCleanUp

      protected void executeWithDelayedCleanUp(IProgressMonitor monitor) throws JobFailedException, UserCanceledException
      Executes all contained jobs, and runs their clean up methods when all jobs are finished.
      Parameters:
      monitor - the monitor
      Throws:
      JobFailedException - the job failed exception
      UserCanceledException - the user canceled exception
    • executeWithImmediateCleanUp

      protected void executeWithImmediateCleanUp(IProgressMonitor monitor) throws JobFailedException, UserCanceledException
      Specialty: Calls cleanup after the execution of each nested job and deletes the reference to that nested job. Thus, you need to make sure that no later jobs depend on these jobs intermediate results that are deleted during cleanup.
      Parameters:
      monitor - The monitor to report the progress to.
      Throws:
      JobFailedException - identifies a failed job execution.
      UserCanceledException - Identifies a user has canceled the execution of the job.
    • cleanup

      public void cleanup(IProgressMonitor monitor) throws CleanupFailedException
      If the sequential job is configured to not clean up immediately, the parents behavior is triggered. Otherwise, the clean up has already be done. Clean up all temporary side effects of this job. This method will always be called after executing this job to remove automatically created files and to leave the environment in a state in which the whole workflow run can be started again with the same results (i.e. in which executed can be called again). Usually, cleanup is called after the whole workflow is completed to allow other jobs to use intermediate results. In some cases, cleanup can be called earlier. However, in those cases, later jobs might not be able to access the intermediate data anymore.

      This method ensures to clean up all child jobs in the reverse order in which they were added.
      Specified by:
      cleanup in interface IJob
      Overrides:
      cleanup in class AbstractCompositeJob
      Parameters:
      monitor - the monitor
      Throws:
      CleanupFailedException - Thrown if a critical error occurred during clean up so that the whole workflow should abort cleaning up further jobs.