|
ORE Studio 0.0.4
|
Abstract base for saga workflow executors. More...
#include <workflow_executor.hpp>


Public Member Functions | |
| virtual bool | execute (ores::database::context ctx, ores::nats::service::nats_client &nats)=0 |
| Execute all saga steps in order. | |
| virtual void | compensate (ores::database::context ctx, ores::nats::service::nats_client &nats)=0 |
| Compensate completed steps in reverse order. | |
| virtual const std::string & | failure_reason () const =0 |
| Human-readable reason for a failed execution. | |
Abstract base for saga workflow executors.
An executor encapsulates one named workflow type. The handler calls execute(); on failure it calls compensate() to roll back completed steps.
Each concrete executor:
The nats_client passed in should already have the end-user JWT set as the delegation token (via nats_client::with_delegation) so that downstream services receive the original caller's context.
|
pure virtual |
Execute all saga steps in order.
| ctx | Per-request database context for writing step records. |
| nats | Authenticated NATS client (with delegation) for calling downstream services. |
Implemented in provision_parties_workflow.
|
pure virtual |
Compensate completed steps in reverse order.
Called by the handler when execute() returns false. Must be idempotent.
| ctx | Per-request database context. |
| nats | Authenticated NATS client (with delegation). |
Implemented in provision_parties_workflow.
|
pure virtual |
Human-readable reason for a failed execution.
Valid only after execute() returns false.
Implemented in provision_parties_workflow.