Order Processing Revised
Definitions:
Purchase(customer,order) = customer!order . customer?(bank,bill) . bank!bill . customer?(product)
// Send order along a customer channel, wait for bank where to pay bill, pay a bill and wait for a product
Sale(client) = client?(spec) . (spec! | (bmw? . BMW(client, spec) + honda? . Honda(client,spec))
// if spec = bmw then BMW(client, bmw) or if spec = honda then Honda(client, honda)
BMW(client,spec)
= (production!<client,spec> . client?(car) | client!<swiss,invoice> ) . swiss?(payment) . client!car
// Produce specified car , send an invoice to the client, wait for payment and then ship a car
Honda(client,spec)
= (warehouse!<client, spec> . client?(car) | client!<nomura,invoice> ) . nomura?(payment) . client!car
// Find specified car , send an invoice to the client, wait for payment and then ship a car
Production() = production?(client, specification) . (client!car | Production())
// Wait for specification, start production for a client and continue waiting for a new specification
Warehouse() = warehouse?(client, specification) . (client!car | Warehouse())
// Wait for a specification, start searching the car for a client and continue waiting for a new specification
Execution
(new steve, bmw, mary, honda)
Purchase(steve, bmw) | Purchase(mary, honda) | Sale(steve) | Sale(mary) | Production() | Warehouse()