Interface Work

All Known Subinterfaces:
WorkFlow
All Known Implementing Classes:
ConditionalFlow, NoOpWork, ParallelFlow, RepeatFlow, SequentialFlow

public interface Work
This interface represents a unit of work. Implementations of this interface must:
  • catch any checked or unchecked exceptions and return a WorkReport instance with a status of WorkStatus.FAILED and a reference to the exception
  • make sure the work is finished in a finite amount of time
Work name must be unique within a workflow definition.
Author:
Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
  • Method Summary

    Modifier and Type
    Method
    Description
    execute(WorkContext workContext)
    Execute the unit of work and return its report.
    default String
    The name of the unit of work.
  • Method Details

    • getName

      default String getName()
      The name of the unit of work. The name must be unique within a workflow definition.
      Returns:
      name of the unit of work.
    • execute

      WorkReport execute(WorkContext workContext)
      Execute the unit of work and return its report. Implementations are required to catch any checked or unchecked exceptions and return a WorkReport instance with a status of WorkStatus.FAILED and a reference to the exception.
      Parameters:
      workContext - context in which this unit of work is being executed
      Returns:
      the execution report