Package com.yworkflow.transaction
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 Summary
Modifier and TypeMethodDescription<R,T extends Throwable>
Rexecute(WorkflowTransactionalOperation<R, T> operation) Executes a transactional operation that returns a value.<T extends Throwable>
voidexecute(WorkflowTransactionalVoidOperation<T> operation) Executes a transactional operation that returns void.static WorkflowTransactionnoOp()Create a NoOp WorkflowTransaction that simply execute the passed operations.
-
Method Details
-
execute
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 operationT- 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
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
Create a NoOp WorkflowTransaction that simply execute the passed operations.- Returns:
- a noop WorkflowTransaction
-