Expand description
Workflow step and context traits for saga-pattern workflows.
Phase 0 generic base for the flow.rs generator (Category C).
Every generated {Name}Workflow used to re-define the same
structural boilerplate. This module provides the single generic version so
that generated files collapse to type aliases:
ⓘ
use backbone_core::flow::{
FlowError, FlowStatus, FlowInstance, FlowExecutor,
WorkflowStep, WorkflowContext,
};
use crate::application::workflows::order_processing_workflow::OrderProcessingFlowStep;
pub type OrderProcessingFlowError = FlowError;
pub type OrderProcessingFlowStatus = FlowStatus;
pub type OrderProcessingFlowInstance = FlowInstance<OrderProcessingFlowStep>;
pub struct OrderProcessingFlowExecutor<H>(FlowExecutor<H>);
// impl execute_step() — the only unique part — stays in the generated fileStructs§
- Flow
Executor - Generic executor shell — holds the handler, provides cancel/fail helpers.
- Flow
Instance - Generic workflow instance parametrised over the step enum
S.
Enums§
- Flow
Error - Common workflow execution error — identical for every workflow.
- Flow
Status - Workflow execution status — identical for every workflow.
Traits§
- Workflow
Context - Workflow execution context for an entity
E. - Workflow
Step - A named step within a workflow.