Skip to main content

Module pid_router

Module pid_router 

Source
Expand description

PID-to-workflow routing table.

Every inbound EDIFACT message carries a Prüfidentifikator (PID) that identifies the MaKo process family and operation. The PidRouter maps numeric PID values to workflow names, enabling dispatchers to instantiate the correct Workflow implementation without ad-hoc match chains.

§Mutability contract — build-time only

PidRouter uses &mut self for all registrations. In normal engine usage the router is populated once during EngineBuilder::build() and is subsequently sealed inside EngineContext behind a shared &PidRouter reference. There is no runtime mutation path — all PIDs must be registered before the engine starts serving messages.

This is intentional: mutation after startup would race with concurrent dispatch calls and require a RwLock. The read-only runtime path is therefore always lock-free.

§BDEW PID ranges (incomplete — register all PIDs for your process families)

RangeProcess family
11001–11099WiM Gerätewechsel (UTILMD)
13003MABIS Bilanzkreisabrechnung (MSCONS)
13002–13028Messwerte Gas/Strom/Redispatch (MSCONS) — fragmented across GaBi Gas, Redispatch, GPKE support
17001–17011WiM MSB commissioning (ORDERS)
17101–17135WiM Stammdaten / Konfiguration (ORDERS)
31001–31002, 31004–31008GPKE Netznutzungsabrechnung / MMM-Rechnung (INVOIC)
31003, 31009WiM-Rechnung / MSB-Rechnung (INVOIC) — WiM domain
31010Kapazitätsrechnung (INVOIC) — Kapazitätsabrechnung Ausspeisepunkte Gas
31011Rechnung sonstige Leistung (INVOIC) — AWH Sperrprozesse Gas
33001–33004REMADV Bestätigung/Abweisung — paired with INVOIC workflows
37000–37006PARTIN Kommunikationsdaten Strom (GPKE Teil 4)
37008–37014PARTIN Kommunikationsdaten Gas (GeLi Gas 2.0)
39000–39001ORDCHG Stornierung Sperr-/Entsperrauftrag (AWH Sperrprozesse Gas)
39002ORDCHG Stornierung Bestellung (WiM Strom Teil 2)
44001–44018GeLi Gas Lieferantenwechsel (UTILMD G)
55001–55018GPKE Lieferantenwechsel / Kündigung (UTILMD Strom)
55555GPKE Teil 4 — Anfrage Daten der individuellen Bestellung (UTILMD Strom)

§Usage

use mako_engine::pid_router::PidRouter;

let mut router = PidRouter::new();
router.register(55001, "GpkeSupplierChange");
router.register(55002, "GpkeSupplierChange"); // Same workflow, different step

assert_eq!(router.route(55001), Some("GpkeSupplierChange"));
assert_eq!(router.route(99999), None);
assert_eq!(router.len(), 2);

Structs§

PidRouter
A static mapping from Prüfidentifikator (PID) values to workflow names.