- 11 minutes to read

O2C Demo — C4 Architecture Diagrams

The Order-to-Cash (O2C) demo generates log events that carry Repository Binding metadata. Each log event records the System, Domain, Service, and MessageType that handled the message. These four properties map directly to the building blocks of C4 architecture diagrams.

This page is a technical reference for developers and solution architects. It walks through L1, L2, and L3 C4 diagrams using the exact entities produced by the O2C PowerShell script, showing how an integration landscape recorded through log events translates into import-ready C4 views.

Info

Actors (Persons) do not appear in log events. They represent the business users and stakeholders who trigger and consume the integration. They are introduced at each level where they add meaningful context.

Warning

Import Wizard note: Name matching is exact during C4 import resolution. Use the same string as the existing Repository entity (for example, ERP-Finance, not ERP Finance) or the wizard may fail to resolve and link the node.

Info

Lane mapping note: In L2 imports, Boundary(...) lanes resolve against Domain names only (exact match required). L2 Container(...) nodes resolve as Service entities, not System entities, even if the names are identical to L1 systems.


Repository Binding → C4 Element Mapping

The table below summarises how each O2C log event field maps to a C4 diagram element at each level.

For consistency in this page: LogText is the source field, while "milestone" is used only as a readable label in diagram text.

Log Event Field O2C Example Value C4 Level C4 Element
System Portal, ERP, WMS, ERP-Finance L1 System(...) node
System Portal, ERP, WMS, ERP-Finance L2 Container(...) inside a Domain Boundary
Domain Sales, Planning, Logistics, Finance L2 Boundary(...) grouping
Service INT1337-RCV-Order-Incoming L2 Container(...) integration service
Service INT1337-RCV-Order-Incoming L3 Component(...) inside a System Boundary
MessageType O2C.Order.Received/1.0 L1/L2/L3 Protocol label on Rel(...) arrows
Format JSON, XML, CSV, PSV L2/L3 Technology label on Container(...) and Rel(...)
Direction Receive (0) / Send (1) L3 Component role in description
LogText Order Received from Customer L3 Component purpose description
(not in log events) Customer, Warehouse Staff, Finance Officer L1/L2/L3 Person(...) / Person_Ext(...)

L1 — System Context Diagram

The L1 diagram shows the four O2C systems and the three business actors who interact with them. Domain structure is not visible at this level — only the high-level system-to-system message flows are shown.

Key Points

  • Each System value from the log event becomes a C4 System(...) node. The O2C demo defines four: Portal, ERP, WMS, and ERP-Finance.
  • Business actors — Customer, Warehouse Staff, Finance Officer — are not captured by log events. They represent the humans triggering and consuming the integration flows and are modelled as Person(...) and Person_Ext(...) nodes.
  • The message formats (JSON, XML, CSV, PSV) from the log event Format field appear as the technology label on each relationship arrow.
  • The seven-step O2C process collapses to four high-level system-to-system flows at L1.
Preview Mermaid Code
C4Context title Order-to-Cash (O2C) - L1 System Context Diagram Person(customer, "Customer", "Places orders and receives confirmations") Person_Ext(warehouse_staff, "Warehouse Staff", "Confirms packing and delivery in WMS") Person_Ext(finance_officer, "Finance Officer", "Reviews and approves generated invoices") System(portal, "Portal", "Receives customer orders and delivers order confirmations") System(erp, "ERP", "Processes orders, schedules production, and manages planning") System(wms, "WMS", "Controls warehouse operations: packing and delivery") System(erp_finance, "ERP-Finance", "Generates invoices upon delivery confirmation") Rel(customer, portal, "Places orders", "JSON") Rel(portal, erp, "Forwards order for entry", "XML") Rel(erp, portal, "Sends order confirmation", "CSV") Rel(erp, wms, "Triggers fulfillment and packing", "XML/JSON") Rel(wms, erp_finance, "Delivers confirmation for invoicing", "PSV/JSON") Rel(warehouse_staff, wms, "Manages packing and delivery", "Web") Rel(finance_officer, erp_finance, "Reviews invoices", "Web")
C4Context
    title Order-to-Cash (O2C) - L1 System Context Diagram

    Person(customer, "Customer", "Places orders and receives confirmations")
    Person_Ext(warehouse_staff, "Warehouse Staff", "Confirms packing and delivery in WMS")
    Person_Ext(finance_officer, "Finance Officer", "Reviews and approves generated invoices")

    System(portal, "Portal", "Receives customer orders and delivers order confirmations")
    System(erp, "ERP", "Processes orders, schedules production, and manages planning")
    System(wms, "WMS", "Controls warehouse operations: packing and delivery")
    System(erp_finance, "ERP-Finance", "Generates invoices upon delivery confirmation")

    Rel(customer, portal, "Places orders", "JSON")
    Rel(portal, erp, "Forwards order for entry", "XML")
    Rel(erp, portal, "Sends order confirmation", "CSV")
    Rel(erp, wms, "Triggers fulfillment and packing", "XML/JSON")
    Rel(wms, erp_finance, "Delivers confirmation for invoicing", "PSV/JSON")
    Rel(warehouse_staff, wms, "Manages packing and delivery", "Web")
    Rel(finance_officer, erp_finance, "Reviews invoices", "Web")

Import Mapping for L1

With the Mapify feature flag enabled, import the Mermaid definition directly. No manual entity creation is required.

Entity Name C4 Classification Origin
Portal InternalSystem O2C log event System
ERP InternalSystem O2C log event System
WMS InternalSystem O2C log event System
ERP-Finance InternalSystem O2C log event System
Customer Person Added actor context
Warehouse Staff PersonExt Added actor context
Finance Officer PersonExt Added actor context

L2 — Container Diagram

The L2 diagram reveals the Domain structure and the individual integration services within each domain. This is the level where the full Repository Binding richness of the O2C log events becomes visible.

Key Points

  • Each Domain value in the log event becomes a C4 Boundary(...) swimlane. The O2C demo defines four: Sales, Planning, Logistics, and Finance.
  • Each System becomes a Container(...) placed inside the matching Domain boundary.
  • Each integration Service (INT1337-xxx) also becomes a Container(...) inside that same boundary. The service name, message format, and step direction are all visible here.
  • Only the seven business-visible services (where IsBiz = true in the script) are shown. Their displayed milestone labels are sourced from LogText.
  • The MessageType field (e.g., O2C.Order.Received/1.0) is included as the protocol label on the relationship arrows connecting services across domains.
Preview Mermaid Code
C4Container title Order-to-Cash (O2C) - L2 Container Diagram Person(customer, "Customer", "Places orders and receives confirmations") Person_Ext(finance_officer, "Finance Officer", "Reviews invoices in ERP-Finance") Boundary(sales, "Sales", "Domain") { Container(portal, "Portal", "Customer Web App", "Receives orders and delivers confirmations to customers") Container(rcv_order, "INT1337-RCV-Order-Incoming", "Integration / JSON", "Receives inbound order from Portal. Step 0 — LogText (Milestone): Order Received from Customer") Container(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Integration / CSV", "Sends order confirmation back to customer. Step 2 — LogText (Milestone): Order Confirmation Delivered") } Boundary(planning, "Planning", "Domain") { Container(erp, "ERP", "Enterprise Resource Planning", "Order entry, inventory management, and production scheduling") Container(ent_order, "INT1337-ENT-Order-Entry", "Integration / XML", "Creates order entry record in ERP. Step 1 — LogText (Milestone): Order Entry in ERP Finished") Container(pln_scheduled, "INT1337-PLN-Order-Scheduled", "Integration / JSON", "Publishes production schedule confirmation. Step 3 — LogText (Milestone): Production Scheduled") } Boundary(logistics, "Logistics", "Domain") { Container(wms, "WMS", "Warehouse Management System", "Warehouse packing and delivery operations") Container(pkg_packed, "INT1337-PKG-Order-Packed", "Integration / XML", "Confirms order is packed and ready for transport. Step 4 — LogText (Milestone): Order Completed for Transport") Container(dlv_delivered, "INT1337-RCV-Order-Delivered", "Integration / PSV", "Records final delivery confirmation. Step 5 — LogText (Milestone): Order Delivered") } Boundary(finance, "Finance", "Domain") { Container(erp_finance, "ERP-Finance", "Finance Module", "Invoice generation and revenue recognition") Container(inv_invoiced, "INT1337-INV-Order-Invoiced", "Integration / JSON", "Issues final invoice upon delivery. Step 6 — LogText (Milestone): Order Invoiced") } Rel(customer, portal, "Places order", "HTTPS / JSON") Rel(portal, rcv_order, "Drops order file", "JSON / O2C.Order.Received/1.0") Rel(rcv_order, ent_order, "Forwards to ERP", "XML / O2C.Order.Entry/1.0") Rel(ent_order, erp, "Enters order record", "ERP API") Rel(ent_order, snd_confirm, "Triggers confirmation", "CSV") Rel(snd_confirm, portal, "Delivers confirmation", "CSV / O2C.Order.Confirmation/1.0") Rel(erp, pln_scheduled, "Confirms production schedule", "JSON / O2C.Order.Scheduled/1.0") Rel(pln_scheduled, pkg_packed, "Triggers packing", "XML / O2C.Order.Ready/1.0") Rel(pkg_packed, wms, "Updates WMS state", "WMS API") Rel(wms, dlv_delivered, "Confirms delivery", "PSV / O2C.Order.Delivered/1.0") Rel(dlv_delivered, inv_invoiced, "Triggers invoicing", "JSON") Rel(inv_invoiced, erp_finance, "Creates invoice", "JSON / O2C.Order.Invoice/1.0") Rel(finance_officer, erp_finance, "Reviews invoices", "Web")
C4Container
    title Order-to-Cash (O2C) - L2 Container Diagram

    Person(customer, "Customer", "Places orders and receives confirmations")
    Person_Ext(finance_officer, "Finance Officer", "Reviews invoices in ERP-Finance")

    Boundary(sales, "Sales", "Domain") {
        Container(portal, "Portal", "Customer Web App", "Receives orders and delivers confirmations to customers")
        Container(rcv_order, "INT1337-RCV-Order-Incoming", "Integration / JSON", "Receives inbound order from Portal. Step 0 — LogText (Milestone): Order Received from Customer")
        Container(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Integration / CSV", "Sends order confirmation back to customer. Step 2 — LogText (Milestone): Order Confirmation Delivered")
    }

    Boundary(planning, "Planning", "Domain") {
        Container(erp, "ERP", "Enterprise Resource Planning", "Order entry, inventory management, and production scheduling")
        Container(ent_order, "INT1337-ENT-Order-Entry", "Integration / XML", "Creates order entry record in ERP. Step 1 — LogText (Milestone): Order Entry in ERP Finished")
        Container(pln_scheduled, "INT1337-PLN-Order-Scheduled", "Integration / JSON", "Publishes production schedule confirmation. Step 3 — LogText (Milestone): Production Scheduled")
    }

    Boundary(logistics, "Logistics", "Domain") {
        Container(wms, "WMS", "Warehouse Management System", "Warehouse packing and delivery operations")
        Container(pkg_packed, "INT1337-PKG-Order-Packed", "Integration / XML", "Confirms order is packed and ready for transport. Step 4 — LogText (Milestone): Order Completed for Transport")
        Container(dlv_delivered, "INT1337-RCV-Order-Delivered", "Integration / PSV", "Records final delivery confirmation. Step 5 — LogText (Milestone): Order Delivered")
    }

    Boundary(finance, "Finance", "Domain") {
        Container(erp_finance, "ERP-Finance", "Finance Module", "Invoice generation and revenue recognition")
        Container(inv_invoiced, "INT1337-INV-Order-Invoiced", "Integration / JSON", "Issues final invoice upon delivery. Step 6 — LogText (Milestone): Order Invoiced")
    }

    Rel(customer, portal, "Places order", "HTTPS / JSON")
    Rel(portal, rcv_order, "Drops order file", "JSON / O2C.Order.Received/1.0")
    Rel(rcv_order, ent_order, "Forwards to ERP", "XML / O2C.Order.Entry/1.0")
    Rel(ent_order, erp, "Enters order record", "ERP API")
    Rel(ent_order, snd_confirm, "Triggers confirmation", "CSV")
    Rel(snd_confirm, portal, "Delivers confirmation", "CSV / O2C.Order.Confirmation/1.0")
    Rel(erp, pln_scheduled, "Confirms production schedule", "JSON / O2C.Order.Scheduled/1.0")
    Rel(pln_scheduled, pkg_packed, "Triggers packing", "XML / O2C.Order.Ready/1.0")
    Rel(pkg_packed, wms, "Updates WMS state", "WMS API")
    Rel(wms, dlv_delivered, "Confirms delivery", "PSV / O2C.Order.Delivered/1.0")
    Rel(dlv_delivered, inv_invoiced, "Triggers invoicing", "JSON")
    Rel(inv_invoiced, erp_finance, "Creates invoice", "JSON / O2C.Order.Invoice/1.0")
    Rel(finance_officer, erp_finance, "Reviews invoices", "Web")

Import Mapping for L2

With the Mapify feature flag enabled, import the Mermaid definition directly. No manual entity creation is required.

Domain Boundary Entity Name C4 Type Technology Label Source
Sales Portal Container (WebApp) Customer Web App O2C log event System
Sales INT1337-RCV-Order-Incoming Container (None) Integration / JSON O2C log event Service
Sales INT1337-SND-Confirm-Outgoing Container (None) Integration / CSV O2C log event Service
Planning ERP Container (API) Enterprise Resource Planning O2C log event System
Planning INT1337-ENT-Order-Entry Container (None) Integration / XML O2C log event Service
Planning INT1337-PLN-Order-Scheduled Container (None) Integration / JSON O2C log event Service
Logistics WMS Container (API) Warehouse Management System O2C log event System
Logistics INT1337-PKG-Order-Packed Container (None) Integration / XML O2C log event Service
Logistics INT1337-RCV-Order-Delivered Container (None) Integration / PSV O2C log event Service
Finance ERP-Finance Container (API) Finance Module O2C log event System
Finance INT1337-INV-Order-Invoiced Container (None) Integration / JSON O2C log event Service

L3 — Component Diagram

The L3 diagram zooms into a single domain boundary and exposes the individual receive and send components that make up each step. This is the level where per-step message types, LogText milestone labels, and the processing module names from log events are all visible.

The example below zooms into the Sales Domain (Portal), which handles Steps 0 and 2 — order reception and order confirmation.

Key Points

  • Each Service (INT1337-xxx) from the log event becomes a C4 Component(...) inside a Container_Boundary.
  • The Module property from the log event (e.g., Portal.OrderService.Receiver) maps to the technology label on each component, identifying the code module that processes the message.
  • The MessageType (e.g., O2C.Order.Received/1.0) appears as the protocol label on Rel(...) arrows, making the exact message contract visible at the component level.
  • The Direction field (0 = Receive, 1 = Send) distinguishes inbound receivers from outbound senders and forwarders in each component's role description.
  • The log event LogText value for IsBiz = true events is used as the component's purpose description, directly linking each technical component to the emitted business event text.
  • Two O2C steps are covered here: Step 0 (Order Received / Order Forwarded to ERP) and Step 2 (Confirmation Received / Confirmation Delivered to Customer).
Preview Mermaid Code
C4Component title Portal – Sales Domain - L3 Component Diagram Person(customer, "Customer", "Places orders and receives order confirmations") System_Ext(erp, "ERP", "Receives forwarded orders and returns order confirmations") Container_Boundary(portal_sales, "Portal – Sales Domain") { Component(rcv_order, "INT1337-RCV-Order-Incoming", "Receiver / Portal.OrderService.Receiver", "Receives inbound order from Portal drop folder. Step 0 — LogText: Order Received from Customer") Component(snd_order, "INT1337-SND-Order-Incoming", "Forwarder / Portal.OrderService.Forwarder", "Forwards received order to ERP for entry. Step 0 — LogText: Order Forwarded to ERP") Component(rcv_confirm, "INT1337-RCV-Confirm-Incoming", "Receiver / Portal.ConfirmationService.Receiver", "Receives order confirmation returned by ERP. Step 2 — LogText: Confirmation Received") Component(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Sender / Portal.ConfirmationService.Sender", "Delivers final order confirmation to customer. Step 2 — LogText: Order Confirmation Delivered to Customer") } Rel(customer, rcv_order, "Places order", "JSON / O2C.Order.Received/1.0") Rel(rcv_order, snd_order, "Routes to forwarder", "In-process") Rel(snd_order, erp, "Sends order entry request", "XML / O2C.Order.Entry/1.0") Rel(erp, rcv_confirm, "Returns order confirmation", "CSV / O2C.Order.Confirmation/1.0") Rel(rcv_confirm, snd_confirm, "Routes to sender", "In-process") Rel(snd_confirm, customer, "Delivers order confirmation", "CSV / O2C.Order.Confirmation/1.0")
C4Component
    title Portal – Sales Domain - L3 Component Diagram

    Person(customer, "Customer", "Places orders and receives order confirmations")
    System_Ext(erp, "ERP", "Receives forwarded orders and returns order confirmations")

    Container_Boundary(portal_sales, "Portal – Sales Domain") {
        Component(rcv_order, "INT1337-RCV-Order-Incoming", "Receiver / Portal.OrderService.Receiver", "Receives inbound order from Portal drop folder. Step 0 — LogText: Order Received from Customer")
        Component(snd_order, "INT1337-SND-Order-Incoming", "Forwarder / Portal.OrderService.Forwarder", "Forwards received order to ERP for entry. Step 0 — LogText: Order Forwarded to ERP")
        Component(rcv_confirm, "INT1337-RCV-Confirm-Incoming", "Receiver / Portal.ConfirmationService.Receiver", "Receives order confirmation returned by ERP. Step 2 — LogText: Confirmation Received")
        Component(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Sender / Portal.ConfirmationService.Sender", "Delivers final order confirmation to customer. Step 2 — LogText: Order Confirmation Delivered to Customer")
    }

    Rel(customer, rcv_order, "Places order", "JSON / O2C.Order.Received/1.0")
    Rel(rcv_order, snd_order, "Routes to forwarder", "In-process")
    Rel(snd_order, erp, "Sends order entry request", "XML / O2C.Order.Entry/1.0")
    Rel(erp, rcv_confirm, "Returns order confirmation", "CSV / O2C.Order.Confirmation/1.0")
    Rel(rcv_confirm, snd_confirm, "Routes to sender", "In-process")
    Rel(snd_confirm, customer, "Delivers order confirmation", "CSV / O2C.Order.Confirmation/1.0")

Import Mapping for L3

With the Mapify feature flag enabled, import the Mermaid definition directly. No manual entity creation is required.

Component Name C4 Type Technology Label Step Coverage Source
INT1337-RCV-Order-Incoming Component (None) Receiver / Portal.OrderService.Receiver Step 0 (Receive) O2C log event Service + Module
INT1337-SND-Order-Incoming Component (None) Forwarder / Portal.OrderService.Forwarder Step 0 (Send) O2C log event Service + Module
INT1337-RCV-Confirm-Incoming Component (None) Receiver / Portal.ConfirmationService.Receiver Step 2 (Receive) O2C log event Service + Module
INT1337-SND-Confirm-Outgoing Component (None) Sender / Portal.ConfirmationService.Sender Step 2 (Send) O2C log event Service + Module

The same pattern applies to all other domains. Zoom into the Planning Domain to see the four ERP integration components (Steps 1 and 3), the Logistics Domain for the four WMS components (Steps 4 and 5), and the Finance Domain for the two ERP-Finance components (Step 6).


Next Steps