Package com.yworkflow

Interface WorkflowEngine


public interface WorkflowEngine
The main entry point for the yWorkflow engine. This interface provides access to all workflow-related functionality including workflow definitions, instances, transactions, and global attributes.

The WorkflowEngine is the central component that orchestrates workflow execution. It manages workflow definitions, creates and manages workflow instances, and provides transactional support for workflow operations.

To create a WorkflowEngine instance, use the builder() method:


 WorkflowEngine engine = WorkflowEngine.builder()
     .withInstanceStore(instanceStore)
     .withExtensions(extensions)
     .build();
 

The engine provides access to:

Since:
1.0
See Also:
  • Method Details

    • globalAttributes

      Attributes globalAttributes()
      Returns the global attributes that are shared across all workflow instances. These attributes are available to all workflows and can be used to store configuration or shared data.
      Returns:
      the global attributes
    • instances

      WorkflowInstances instances()
      Returns the workflow instances manager for creating and managing workflow instances. This is the primary interface for workflow instance operations such as:
      • Creating new workflow instances
      • Retrieving existing instances
      • Executing transitions on instances
      Returns:
      the workflow instances manager
    • definitions

      WorkflowDefinitions definitions()
      Returns the workflow definitions manager for managing workflow definitions. This interface provides operations for:
      • Creating and saving workflow definitions
      • Retrieving existing definitions
      • Updating and removing definitions
      Returns:
      the workflow definitions manager
    • transaction

      WorkflowTransaction transaction()
      Returns the transaction manager for executing workflow operations within transactions. This ensures that workflow operations are executed atomically and can be rolled back if errors occur.
      Returns:
      the transaction manager
    • builder

      static WorkflowEngineBuilder builder()
      Creates a new WorkflowEngineBuilder instance for configuring and building a WorkflowEngine.
      Returns:
      a new WorkflowEngineBuilder instance