Package com.yworkflow.definition.model
Interface Transitions
public interface Transitions
Manages transitions within a workflow definition. Transitions represent the possible state
changes and actions that can be executed in a workflow.
This interface provides methods to manage different types of transitions:
- Global Transitions - Available from any state
- Initial Transitions - Used to start workflow instances
- Common Transitions - Available from states referencing them
- State Transitions - Specific to individual states
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommonTransition(Transition transition) Adds a common transition to the workflow.voidaddGlobalTransition(Transition transition) Adds a global transition to the workflow.voidaddInitialTransition(Transition transition) Adds an initial transition to the workflow.getCommonTransition(TransitionId transitionId) Gets a common transition by its ID.Gets a global transition by its ID.Gets an initial transition by its ID.Gets a state transition by its ID.voidremoveCommonTransition(TransitionId transitionId) Removes a common transition by its ID.voidremoveInitialTransition(TransitionId transitionId) Removes an initial transition by its ID.booleanremoveTransition(Transition transitionToRemove) Removes a transition from the workflow.voidupdateInitialTransition(Transition transition) Updates an existing initial transition.
-
Method Details
-
getGlobalTransition
Gets a global transition by its ID. Global transitions are available from any state in the workflow.- Parameters:
id- the ID of the global transition to retrieve- Returns:
- an Optional containing the transition if found
-
getInitialTransition
Gets an initial transition by its ID. Initial transitions are used to start workflow instances.- Parameters:
id- the ID of the initial transition to retrieve- Returns:
- an Optional containing the transition if found
-
addCommonTransition
Adds a common transition to the workflow. Common transitions are available from multiple states but not all states.- Parameters:
transition- the transition to add
-
getCommonTransition
Gets a common transition by its ID.- Parameters:
transitionId- the ID of the common transition to retrieve- Returns:
- an Optional containing the transition if found
-
removeCommonTransition
Removes a common transition by its ID.- Parameters:
transitionId- the ID of the common transition to remove
-
getStateTransition
Gets a state transition by its ID. State transitions are specific to individual states.- Parameters:
id- the ID of the state transition to retrieve- Returns:
- an Optional containing the transition if found
-
addGlobalTransition
Adds a global transition to the workflow.- Parameters:
transition- the global transition to add
-
addInitialTransition
Adds an initial transition to the workflow.- Parameters:
transition- the initial transition to add
-
updateInitialTransition
Updates an existing initial transition.- Parameters:
transition- the updated initial transition
-
removeInitialTransition
Removes an initial transition by its ID.- Parameters:
transitionId- the ID of the initial transition to remove
-
removeTransition
Removes a transition from the workflow.- Parameters:
transitionToRemove- the transition to remove- Returns:
- true if the transition was successfully removed, false otherwise
-