Package rife.workflow

Interface Work


public interface Work
Work can be executed in a Workflow.

Their execution will be done in a thread by invoking the execute(rife.workflow.Workflow) method on a new instance of the work class.

Afterwards, work can suspend its execution by pausing for particular event types. The thread will stop executing this work and no system resources will be used except for the memory required to maintain the state of the suspended work instance.

When a suitable event is triggered in the Workflow, a thread will resume the execution of the suspended work where it left off.

Since:
1.0
See Also:
API Note:
The workflow engine is still in an ALPHA EXPERIMENTAL STAGE and might change.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(Workflow workflow)
    The entry method of this work's execution.
    default Event
    Pause until a particular event type is triggered in the workflow.
  • Method Details

    • execute

      void execute(Workflow workflow)
      The entry method of this work's execution.
      Parameters:
      workflow - the workflow that is executing the work
      Since:
      1.0
    • pauseForEvent

      default Event pauseForEvent(Object type)
      Pause until a particular event type is triggered in the workflow.

      When an event is triggered with a suitable type, is will be returned through this method call.

      Parameters:
      type - the event type to wait for.
      Returns:
      the event that woke up the work
      Since:
      1.0