Templates / Order to cash / order-to-cash
Order to Cash
Takes an order from receipt to cash in the bank. A DMN table sets the credit decision, stock is reserved in a sub-process that throws OUT_OF_STOCK when it cannot be, invoicing and shipping run in parallel, and the instance waits for the payment message correlated on the order id before closing the order. An out-of-stock order is cancelled and the customer is told why.
Scenarios · 3
- Valid order in stock is invoiced, shipped and paid credit-decision → reserve-items → create-invoice → await-payment → order-closed
- Out-of-stock order is cancelled through the error boundary out-of-stock → on-out-of-stock → cancel-order → order-cancelled
- Order from a customer rated C is declined credit-decision → notify-declined → order-declined
Job types · 8
-
customer-notifyNotify customer: declined, Notify customer: out of stock -
inventory-checkCheck stock -
inventory-reserveReserve items -
invoice-createCreate invoice -
order-cancelCancel order -
order-closeClose order -
order-validateValidate order -
shipment-createShip order
Files · 3
- order-to-cash.bpmn Process model
- order-to-cash.bpmn.tests.json Test scenarios (runScenario format)
- credit-decision.dmn DMN decision
Every scenario passes on @bpmnkit/engine's runScenario in the
package's tests. casen template use order-to-cash [dir] writes the files above
into your project — see the templates guide for running
the scenarios and deploying.