Skip to content

defining work

Mahmoud Ben Hassine edited this page Oct 8, 2020 · 5 revisions

The Work abstraction and its related APIs

A unit of work in Easy Flows is represented by the Work interface:

public interface Work {

    String getName();

    WorkReport execute(WorkContext workContext);
}

Implementations of this interface must:

  • catch any checked or unchecked exceptions and return WorkStatus#FAILED in the WorkReport
  • make sure the work is finished in a finite amount of time

A work name must be unique within a workflow definition. Each work must return a WorkReport at the end of execution. This report may serve as a condition to the next work in the workflow through a WorkReportPredicate.