Package com.yworkflow.definition.model
Interface Fork
- All Superinterfaces:
CanCopy<Fork>,HasId<ForkId>,HasParent<Fork,,WorkflowDefinition> Model<Fork,,ForkId> Validatable
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 Summary
Modifier and TypeMethodDescriptionGets all the results that define the parallel execution paths of this fork.Creates a new BuildableForkBuilder initialized with the current fork definition.Methods inherited from interface com.yworkflow.definition.model.base.HasParent
withParentMethods inherited from interface com.yworkflow.definition.model.base.Model
getExtensions, getParent, getProperties, getPropertyDifferenceMethods inherited from interface com.yworkflow.definition.model.validation.Validatable
validate
-
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
BuildableForkBuilder 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:
-