Online retail: order fulfilment
Order, payment, inventory and shipping – specification versus BPMN processes and Kafka microservices.
Profile
Source documents and findings are in German.
How this example came about
Choice
A well-known reference example for event-driven microservices: flowing-retail by Bernd Rücker, Kafka variant with Java and Zeebe. Six services (checkout, order, payment, inventory, shipping, monitor) talk via a Kafka topic; order and payment run as BPMN processes. This makes it possible to compare specification, process models and distributed code at the same time.
Preparation
We wrote the order-handling specification ourselves for this demo: roles, terms, processes from order to shipment, rules, requirements, domain model and a message table. Fixed were the variant and commit of the code, the project's three BPMN files and a list of expected gaps as test oracle. The language-model extraction was reviewed and accepted; after that everything runs without a language model.
What Kanonik did
Kanonik translated the specification into a knowledge graph, derived BPMN and a domain model, and read the existing BPMN processes and the code of all services: Kafka messages, Zeebe workers, process starts, correlations. From the code it generated an OpenAPI and an AsyncAPI description – which service sends or receives which message over which topic, pointing to every place in the code. The comparison specification ↔ BPMN ↔ code yields the gap list, measured against the test oracle.
Guided tour
- The specification
Main order fulfilment process and payment sub-process with requirements and business rules. →
- The gaps
For example: no reservation before payment, a failed payment is not reported. →
- Checked against a test oracle
The expected gaps are fixed independently of the comparison; the recall is shown above the list. →
View the specification
Gaps
24 gaps between specification, BPMN and code
Architecture (ArchiMate)
Enterprise architecture of the domain in ArchiMate 3.2, derived from specification and interfaces: 316 elements, 1002 relationships.
Download model.xml for Archi (File → Import → Open Exchange XML Model)
Interfaces from the code
The project has no interface description. Kanonik generated it from the source code: OpenAPI for REST, AsyncAPI for events and messages. Every element points to its place in the code (x-kanonik-code).
3 REST operations, 15 event operations, 8 messages →
Graph and search (reader)
Sources and rights
Specification written for this demo; processes and code from flowing-retail (Bernd Rücker, Apache-2.0).