Package com.yworkflow.definition.model
Interface MutableWorkflowDefinition
- All Superinterfaces:
CanCopy<WorkflowDefinition>,HasId<WorkflowDefinitionId>,Model<WorkflowDefinition,,WorkflowDefinitionId> Validatable,WorkflowDefinition
Mutable version of a WorkflowDefinition that allows direct modification of workflow elements.
This interface extends WorkflowDefinition to provide methods for adding, removing, and updating
workflow components without using the builder pattern.
MutableWorkflowDefinition is useful for scenarios where direct manipulation of workflow elements is needed, such as:
- Runtime workflow modifications
- Workflow migration and updates
- Dynamic workflow configuration
- Testing and debugging scenarios
This interface provides direct access to the underlying workflow structure and allows for immediate modifications to states, transitions, forks, joins, and other workflow elements.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a fork to the workflow.voidAdds a join to the workflow.voidAdds a state to the workflow.copy(WorkflowDefinitionId workflowDefinitionId, Properties properties, ExtensionProvider extensionProvider) Creates a copy of this workflow definition with the specified parameters.voidremoveFork(ForkId forkId) Removes a fork from the workflow.voidremoveJoin(JoinId joinId) Removes a join from the workflow.voidremoveState(StateId stateId) Removes a state from the workflow.voidsetGlobalConditions(Conditions globalConditions) Sets the global conditions for the workflow.voidsetMetaAttributes(Map<String, String> metaAttributes) Sets the meta attributes for the workflow.voidSets the name of the workflow.voidsetRegisters(List<Register> registers) Sets the attribute registers for the workflow.voidsetTriggerFunction(String id, Function triggerFunction) Sets a trigger function for the workflow.Gets the transitions manager for this workflow.voidupdateFork(Fork fork) Updates an existing fork in the workflow.voidupdateJoin(Join join) Updates an existing join in the workflow.voidupdateState(State state) Updates an existing state in the workflow.Methods inherited from interface com.yworkflow.definition.model.base.Model
getExtensions, getParent, getProperties, getPropertyDifferenceMethods inherited from interface com.yworkflow.definition.model.validation.Validatable
validateMethods inherited from interface com.yworkflow.definition.model.WorkflowDefinition
canInitialize, diff, getAvailableGlobalTransition, getCommonTransition, getCommonTransitions, getFork, getForks, getGlobalConditions, getGlobalTransitions, getInitialTransition, getInitialTransitions, getJoin, getJoins, getMetaAttributes, getName, getRegisters, getState, getState, getStates, getTriggerFunction, getTriggerFunctions, toBuilder
-
Method Details
-
setGlobalConditions
Sets the global conditions for the workflow.- Parameters:
globalConditions- the global conditions to set
-
setMetaAttributes
Sets the meta attributes for the workflow.- Parameters:
metaAttributes- the meta attributes to set
-
setName
Sets the name of the workflow.- Parameters:
name- the workflow name
-
setRegisters
Sets the attribute registers for the workflow.- Parameters:
registers- the list of registers to set
-
setTriggerFunction
Sets a trigger function for the workflow.- Parameters:
id- the ID of the trigger functiontriggerFunction- the trigger function to set
-
addJoin
Adds a join to the workflow.- Parameters:
join- the join to add
-
removeJoin
Removes a join from the workflow.- Parameters:
joinId- the ID of the join to remove
-
addFork
Adds a fork to the workflow.- Parameters:
fork- the fork to add
-
removeFork
Removes a fork from the workflow.- Parameters:
forkId- the ID of the fork to remove
-
removeState
Removes a state from the workflow.- Parameters:
stateId- the ID of the state to remove
-
addState
Adds a state to the workflow.- Parameters:
state- the state to add
-
updateState
Updates an existing state in the workflow.- Parameters:
state- the updated state
-
updateFork
Updates an existing fork in the workflow.- Parameters:
fork- the updated fork
-
updateJoin
Updates an existing join in the workflow.- Parameters:
join- the updated join
-
transitions
Transitions transitions()Gets the transitions manager for this workflow.- Returns:
- the transitions manager
-
copy
WorkflowDefinition copy(WorkflowDefinitionId workflowDefinitionId, Properties properties, ExtensionProvider extensionProvider) Creates a copy of this workflow definition with the specified parameters.- Parameters:
workflowDefinitionId- the ID for the new workflow definitionproperties- the properties for the new workflowextensionProvider- the extension provider for the new workflow- Returns:
- a new WorkflowDefinition instance
-