Package com.yworkflow.instance
Interface WorkflowInstances
public interface WorkflowInstances
Manages workflow instances within the yWorkflow engine. This interface provides operations for
creating, retrieving, and managing workflow instances.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanInit(WorkflowDefinitionId workflowDefinitionId, TransitionId initialTransitionId) Checks if a workflow can be initialized with the specified workflow definition ID and initial transition.booleancanInit(WorkflowDefinitionId workflowDefinitionId, TransitionId initialTransitionId, Attributes inputs) Checks if a workflow can be initialized with the specified workflow definition ID, initial transition, and input attributes.get(WorkflowInstanceId workflowInstanceId) Retrieves a workflow instance by its ID.default WorkflowInstanceinit(WorkflowDefinitionId workflowDefinitionId, TransitionId initialTransition) Creates a new workflow instance with the specified workflow definition ID and initial transition.init(WorkflowDefinitionId workflowDefinitionId, TransitionId initialTransition, Attributes inputs) Creates a new workflow instance with the specified workflow definition ID, initial transition, and input attributes.with(WorkflowCallerContext callerContext) Creates a new WorkflowInstances instance that operates with the specified caller context.
-
Method Details
-
get
Retrieves a workflow instance by its ID.- Parameters:
workflowInstanceId- the unique identifier of the workflow instance- Returns:
- the workflow instance
- Throws:
WorkflowException- if an error occurs while retrieving the workflow instance
-
canInit
default boolean canInit(WorkflowDefinitionId workflowDefinitionId, TransitionId initialTransitionId) throws WorkflowException Checks if a workflow can be initialized with the specified workflow definition ID and initial transition. This is a convenience method that uses empty attributes.- Parameters:
workflowDefinitionId- the ID of the workflow definitioninitialTransitionId- the ID of the initial transition- Returns:
- true if the workflow can be initialized, false otherwise
- Throws:
WorkflowException- if an error occurs while checking initialization capability
-
canInit
boolean canInit(WorkflowDefinitionId workflowDefinitionId, TransitionId initialTransitionId, Attributes inputs) throws WorkflowException Checks if a workflow can be initialized with the specified workflow definition ID, initial transition, and input attributes.- Parameters:
workflowDefinitionId- the ID of the workflow definitioninitialTransitionId- the ID of the initial transitioninputs- the input attributes for the workflow instance- Returns:
- true if the workflow can be initialized, false otherwise
- Throws:
WorkflowException- if an error occurs while checking initialization capability
-
init
default WorkflowInstance init(WorkflowDefinitionId workflowDefinitionId, TransitionId initialTransition) throws WorkflowException Creates a new workflow instance with the specified workflow definition ID and initial transition. This is a convenience method that uses empty attributes.- Parameters:
workflowDefinitionId- the ID of the workflow definitioninitialTransition- the initial transition to execute- Returns:
- the newly created workflow instance
- Throws:
WorkflowException- if an error occurs while creating the workflow instance
-
init
WorkflowInstance init(WorkflowDefinitionId workflowDefinitionId, TransitionId initialTransition, Attributes inputs) throws WorkflowException Creates a new workflow instance with the specified workflow definition ID, initial transition, and input attributes.- Parameters:
workflowDefinitionId- the ID of the workflow definitioninitialTransition- the initial transition to executeinputs- the input attributes for the workflow instance- Returns:
- the newly created workflow instance
- Throws:
WorkflowException- if an error occurs while creating the workflow instance
-
with
Creates a new WorkflowInstances instance that operates with the specified caller context. This allows for access control and audit trails for workflow instance operations.- Parameters:
callerContext- the caller context to use for operations- Returns:
- a new WorkflowInstances instance with the specified caller context
-