Class ConditionalFlow

java.lang.Object
com.redhat.parodos.workflows.workflow.ConditionalFlow
All Implemented Interfaces:
Work, WorkFlow

public class ConditionalFlow extends Object
A conditional flow is defined by 4 artifacts:
  • The work to execute first
  • A predicate for the conditional logic
  • The work to execute if the predicate is satisfied
  • The work to execute if the predicate is not satisfied (optional)
Author:
Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
See Also:
  • Method Details

    • execute

      public 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
    • getName

      public String getName()
      Description copied from interface: Work
      The name of the unit of work. The name must be unique within a workflow definition.
      Specified by:
      getName in interface Work
      Returns:
      name of the unit of work.
    • getProperties

      public WorkFlowPropertiesMetadata getProperties()
      Specified by:
      getProperties in interface WorkFlow
    • setProperties

      public void setProperties(WorkFlowPropertiesMetadata properties)
      Specified by:
      setProperties in interface WorkFlow