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 Details

    • get

      WorkflowInstance get(WorkflowInstanceId workflowInstanceId) throws WorkflowException
      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 definition
      initialTransitionId - 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 definition
      initialTransitionId - the ID of the initial transition
      inputs - 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 definition
      initialTransition - 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 definition
      initialTransition - the initial transition to execute
      inputs - 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