Document Message
The document message — a fact that flows, not a command.
Problem
How to transmit a business document (invoice, catalogue) without confusing it with a command?
Forces
- EDI documents carry legal responsibility (INVOIC = fiscal proof).
- The recipient applies their own processing rules — the sender does not dictate.
- Expected acknowledgement differs (receipt confirmed vs action performed).
Solution
Distinguish Document Message from Command Message in the typing. Conventions: (1) noun naming (Invoice, Catalogue), (2) acknowledgement = receipt and successful integration, not action execution, (3) immutable document once sent (correction = new document).
EDI implementation
In EDI, Document Messages include: INVOIC (invoice), DESADV (despatch advice), PRICAT (price catalogue), REMADV (remittance advice). The recipient integrates, does not "execute". The acknowledgement (CONTRL/997, AS2 MDN) confirms receipt, not business action — which can be async and independent (paying the INVOIC).
Anti-patterns
- Document Message expecting an immediate action — role confusion.
- Ephemeral document — a document must be archivable (10 years for fiscal).
- Document modified in place — prefer issuing a correction document.
Related patterns
- Command Message — complementary pattern.
- Event Message — third style.
Sources
- Hohpe G., Woolf B. — EIP, Document Message (p. 147). www.enterpriseintegrationpatterns.com/patterns/messaging/DocumentMessage.html