Package com.yworkflow.definition.model
Interface State
- All Superinterfaces:
CanCopy<State>,HasId<StateId>,HasParent<State,,WorkflowDefinition> Model<State,,StateId> Validatable
Represents a state in a workflow definition. State is a fundamental component of workflows that
defines a specific stage or condition in a business process.
States can have:
- Transitions - Ways to move to other states
- Capabilities - Information associated with the state
- Pre-functions - Functions executed when entering the state
- Post-functions - Functions executed when leaving the state
- Common transitions - Transitions available from multiple states
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidExecutes all post-functions for this state with the given attributes.voidExecutes all pre-functions for this state with the given attributes.Gets all capabilities available in this state.Gets all common transition IDs available from this state.Gets the meta attributes for this state.Gets all post-functions for this state.Gets all pre-functions for this state.Gets a transition by its ID.Gets all transitions available from this state.booleanresultsInJoin(JoinId join) Checks if this state results in the specified join.Creates a new state builder initialized with the current state 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
-
getTransition
Gets a transition by its ID.- Parameters:
id- the ID of the transition to retrieve- Returns:
- an Optional containing the transition if found
-
resultsInJoin
Checks if this state results in the specified join.- Parameters:
join- the join to check- Returns:
- true if this state results in the join, false otherwise
-
executePreFunctions
Executes all pre-functions for this state with the given attributes.- Parameters:
context- the execution context- Throws:
WorkflowException- if there's an error executing the functions
-
executePostFunctions
Executes all post-functions for this state with the given attributes.- Parameters:
context- the execution context- Throws:
WorkflowException- if there's an error executing the functions
-
getTransitions
List<Transition> getTransitions()Gets all transitions available from this state.- Returns:
- a list containing all transitions
-
getCommonTransitionIds
Iterable<TransitionId> getCommonTransitionIds()Gets all common transition IDs available from this state.- Returns:
- an iterable of common transition IDs
-
getMetaAttributes
Gets the meta attributes for this state.- Returns:
- a map of meta attributes
-
getCapabilities
List<Capability> getCapabilities()Gets all capabilities available in this state.- Returns:
- a list containing all capabilities
-
getPostFunctions
Gets all post-functions for this state.- Returns:
- a list containing all post-functions
-
getPreFunctions
Gets all pre-functions for this state.- Returns:
- a list containing all pre-functions
-
toBuilder
BuildableStateBuilder toBuilder()Creates a new state builder initialized with the current state definition. This method allows for easy modification of existing state definitions by providing a builder that starts with the current state of the state.- Returns:
- a new BuildableStateBuilder initialized with this state's current state
- See Also:
-