How to map a rather complex Business Process like Order to Cash to Corda Flow(s)

49 Views Asked by At

Imagine a real world business process which can take weeks shall be mapped to single or multiple Corda Flows. As long living flows have impact of SW lifecycle (see https://docs.corda.net/upgrading-cordapps.html#flow-drains) I wonder if there are design guidelines for flows regarding time to life or other aspects like versioning/compatibility/dependencies to sub-flows/ ...).

1

There are 1 best solutions below

0
On

You would typically model each document to states i.e SalesOrder, Goods, Delivery, Bill

Then for each action, it's just a flow within Corda.i.e ApproveSalesOrderFlow, IssueGoodsFlow, ReceiveGoodsFlow, FulfillShipmentFlow, SettleBillFlow etc.

Because some process may takes weeks, you'll need to model lifecycle/status in the states. i.e SalesOrder may have lifecycle such as ISSUED, APPROVED, DELIVERED, PAID. Upon each action (flow), you're transitioning the state from an initial status to its respective new statuses to track its lifecycle. i.e an ApproveSalesOrderFlow may move the state from ISSUED to APPROVED, and you would track the lastApprovedDate, durationOfSLA, etc as fields in the state.