#[non_exhaustive]pub enum WorkflowVersionPolicy {
Pinned,
ForwardCompatible,
Explicit(Vec<FormatVersion>),
}Expand description
Declares which BDEW format versions a Workflow implementation can
accept over the lifetime of in-flight processes.
BDEW releases two annual format updates. Processes that span a release
boundary (e.g. a MABIS billing process that starts in October and settles
in January) must accept inbound messages from both the old and the new
format version. WorkflowVersionPolicy makes this acceptance declaration
explicit and compiler-checked.
The engine can use this policy to validate that an incoming message’s format version is acceptable before constructing the command, surfacing the gap at dispatch time rather than during a runtime deserialization error.
§Default
The default implementation of Workflow::version_policy() returns
WorkflowVersionPolicy::ForwardCompatible, which accepts messages in any
format version ≥ the creation FV. This is the correct default for the
majority of BDEW MaKo processes, which routinely span annual release
boundaries. Override to Pinned only for strictly short-lived workflows
that are guaranteed to complete within a single BDEW release cycle.
§Example
use mako_engine::version::{FormatVersion, WorkflowVersionPolicy};
// A GPKE process that lives at most 24 hours — pinned to creation FV:
fn version_policy() -> WorkflowVersionPolicy {
WorkflowVersionPolicy::Pinned
}
// A MABIS billing process that spans the annual release boundary:
fn version_policy() -> WorkflowVersionPolicy {
WorkflowVersionPolicy::Explicit(vec![
FormatVersion::new("FV2025-10-01"),
FormatVersion::new("FV2026-10-01"),
])
}
// An open-ended process that accepts all FVs >= creation:
fn version_policy() -> WorkflowVersionPolicy {
WorkflowVersionPolicy::ForwardCompatible
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Pinned
Accept only the format version recorded at process creation.
Use for strictly short-lived workflows that are guaranteed to complete within a single BDEW release cycle (< 6 months). All counterparty messages must arrive before the next October-1 or April-1 FV boundary.
This is a stricter policy than the default
ForwardCompatible. Most
BDEW market-communication processes span release boundaries; prefer
ForwardCompatible unless you have an explicit reason to pin.
ForwardCompatible
Accept any format version greater than or equal to the creation FV.
This is the default (via #[default]) for all MaKo workflows.
MaKo processes routinely span BDEW annual release boundaries: a
Lieferbeginn process started on 2025-09-20 must still accept the
counterparty’s APERAK reply sent on 2025-11-10 under the new
FV2025-10-01 rules. ForwardCompatible handles this transparently.
Explicit(Vec<FormatVersion>)
Accept exactly the listed format versions.
Use when the set of acceptable format versions is known at compile time (e.g. a billing process that must handle exactly FV2025-10-01 and FV2026-10-01).
Implementations§
Source§impl WorkflowVersionPolicy
impl WorkflowVersionPolicy
Sourcepub fn accepts(&self, fv: &FormatVersion, creation_fv: &FormatVersion) -> bool
pub fn accepts(&self, fv: &FormatVersion, creation_fv: &FormatVersion) -> bool
Returns true if fv is acceptable under this policy given
creation_fv (the format version recorded in the process’s
WorkflowId).
§Behaviour
| Policy | Acceptance |
|---|---|
Pinned | fv == creation_fv |
ForwardCompatible | always (caller treats any FV as acceptable) |
Explicit(list) | fv is in list |
Trait Implementations§
Source§impl Clone for WorkflowVersionPolicy
impl Clone for WorkflowVersionPolicy
Source§fn clone(&self) -> WorkflowVersionPolicy
fn clone(&self) -> WorkflowVersionPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkflowVersionPolicy
impl Debug for WorkflowVersionPolicy
Source§impl Default for WorkflowVersionPolicy
impl Default for WorkflowVersionPolicy
Source§fn default() -> WorkflowVersionPolicy
fn default() -> WorkflowVersionPolicy
impl Eq for WorkflowVersionPolicy
Source§impl PartialEq for WorkflowVersionPolicy
impl PartialEq for WorkflowVersionPolicy
Source§fn eq(&self, other: &WorkflowVersionPolicy) -> bool
fn eq(&self, other: &WorkflowVersionPolicy) -> bool
self and other values to be equal, and is used by ==.