Interface WorkflowTransaction


public interface WorkflowTransaction
Provides transactional support for workflow operations. The WorkflowTransaction interface allows workflow operations to be executed within a transaction context, ensuring atomicity and consistency.
Since:
1.0
See Also:
  • Method Details

    • execute

      <R, T extends Throwable> R execute(WorkflowTransactionalOperation<R,T> operation) throws T
      Executes a transactional operation that returns a value. The operation is executed within a transaction context, and the transaction is committed if the operation completes successfully, or rolled back if an exception is thrown.
      Type Parameters:
      R - the return type of the operation
      T - the type of exception that can be thrown
      Parameters:
      operation - the operation to execute
      Returns:
      the result of the operation
      Throws:
      T - if the operation throws an exception
    • execute

      <T extends Throwable> void execute(WorkflowTransactionalVoidOperation<T> operation) throws T
      Executes a transactional operation that returns void. The operation is executed within a transaction context, and the transaction is committed if the operation completes successfully, or rolled back if an exception is thrown.
      Type Parameters:
      T - the type of exception that can be thrown
      Parameters:
      operation - the operation to execute
      Throws:
      T - if the operation throws an exception
    • noOp

      static WorkflowTransaction noOp()
      Create a NoOp WorkflowTransaction that simply execute the passed operations.
      Returns:
      a noop WorkflowTransaction