Interface Fork

All Superinterfaces:
CanCopy<Fork>, HasId<ForkId>, HasParent<Fork,WorkflowDefinition>, Model<Fork,ForkId>, Validatable

public interface Fork extends Model<Fork,ForkId>, HasParent<Fork,WorkflowDefinition>
Represents a fork in a workflow definition that allows parallel execution paths. Fork enables a workflow to split into multiple concurrent branches, where each branch can execute independently and potentially rejoin later through a Join.

Forks are essential for modeling complex business processes that require parallel processing, such as approval workflows where multiple approvers need to review a request simultaneously, or processing workflows where different tasks can be performed concurrently.

When a fork is executed, the workflow engine creates multiple active states simultaneously, one for each result defined in the fork. Each branch can then proceed independently until they either complete or reach a join point.

Since:
1.0
See Also:
  • Method Details

    • getResults

      List<DefaultResult> getResults()
      Gets all the results that define the parallel execution paths of this fork.
      Returns:
      a list containing all results that define the fork paths
    • toBuilder

      Creates a new BuildableForkBuilder initialized with the current fork definition. This method allows for easy modification of existing fork definitions by providing a builder that starts with the current state of the fork.

      The returned builder can be used to modify the fork definition by adding, removing, or modifying results and other fork elements. After making the desired changes, call BuildableForkBuilder.build() to create a new Fork instance.

      Returns:
      a new BuildableForkBuilder initialized with this fork's current state
      See Also: