Skip to main content

WorkflowVersionPolicy

Enum WorkflowVersionPolicy 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

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
PolicyAcceptance
Pinnedfv == creation_fv
ForwardCompatiblealways (caller treats any FV as acceptable)
Explicit(list)fv is in list

Trait Implementations§

Source§

impl Clone for WorkflowVersionPolicy

Source§

fn clone(&self) -> WorkflowVersionPolicy

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkflowVersionPolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WorkflowVersionPolicy

Source§

fn default() -> WorkflowVersionPolicy

Returns the “default value” for a type. Read more
Source§

impl Eq for WorkflowVersionPolicy

Source§

impl PartialEq for WorkflowVersionPolicy

Source§

fn eq(&self, other: &WorkflowVersionPolicy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for WorkflowVersionPolicy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more