Package com.yworkflow.definition
Interface WorkflowDefinitionRepository
public interface WorkflowDefinitionRepository
Repository interface for managing workflow definitions. WorkflowDefinitionRepository provides
CRUD operations for workflow definitions, supporting persistence, retrieval, and deletion of
workflow definitions with proper access control and multi-tenancy support.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleandelete(WorkflowCallerContext callerContext, WorkflowDefinitionId workflowDefinitionId) Deletes a workflow definition from the repository.get(WorkflowCallerContext context, WorkflowDefinitionId workflowDefinitionId) Retrieves a workflow definition from the repository.voidinit(ExtensionProvider extensionProvider, Properties properties) Initializes the repository with the necessary dependencies and configuration.voidsave(WorkflowCallerContext callerContext, WorkflowDefinitionId workflowDefinitionId, WorkflowDefinition workflowDefinition) Saves a workflow definition to the repository.
-
Method Details
-
init
Initializes the repository with the necessary dependencies and configuration.- Parameters:
extensionProvider- the extension provider for resolving extensionsproperties- the configuration properties for the repository
-
save
void save(WorkflowCallerContext callerContext, WorkflowDefinitionId workflowDefinitionId, WorkflowDefinition workflowDefinition) Saves a workflow definition to the repository.- Parameters:
callerContext- the context of the caller performing the operationworkflowDefinitionId- the ID of the workflow to saveworkflowDefinition- the workflow definition to save
-
get
Optional<WorkflowDefinition> get(WorkflowCallerContext context, WorkflowDefinitionId workflowDefinitionId) throws WorkflowException Retrieves a workflow definition from the repository.- Parameters:
context- the context of the caller requesting the workflowworkflowDefinitionId- the ID of the workflow to retrieve- Returns:
- an Optional containing the workflow if found, empty otherwise
- Throws:
WorkflowException- if there's an error retrieving the workflow
-
delete
Deletes a workflow definition from the repository.- Parameters:
callerContext- the context of the caller performing the operationworkflowDefinitionId- the ID of the workflow to delete- Returns:
- true if the workflow was deleted, false if it didn't exist
-