The Supply Chain application demonstrates a generic example between a Buyer, Seller, Supplier, two Warehouses, and two independent Transport Companies. The process includes:
- Creating a quote request from Buyer to Seller for a given product
- Supplier collecting quotes for product and transportation from the Warehouses and Transport Companies
- Aggregating delivery details with price, adding margin, and sending a quote to Buyer
- Upon acceptance by Buyer of the quote, order creation and initiation of goods delivery from the Warehouses
- Upon delivery of goods, payment from Buyer to Seller, either in full or partially, and creation of a payment obligation through the supply chain
Be sure you have the following installed:
- DAML SDK 0.12.21
- Docker
- Java
- Maven
Type:
mvn clean package
Note: If you change the DAML models locally, you need to run re-run this command before starting the application.
Running on local machine requires three terminal tabs:
- Run Sandbox and Navigator:
daml start
- Run bots:
java -jar target/supplychain-0.0.1-SNAPSHOT.jar -p 7600
You can now navigate to the URL: localhost:7500 with a browser to interact with the application.
Important: "localhost" on which the application is run should not have a web-facing IP address assigned to it.
Note: This works on Linux, but, on MacOS, the Docker configuration needs to be changed to use at least 6 CPUs, due to a bug in the platform.
After a Maven build, you can start with
docker-compose up --build
and stop with
docker-compose down
Reset the application by following these steps:
-
Stop the App by following the steps above.
-
Start the App in Docker or Standalone mode by following the steps in the relevant section.
-
Stop the running application on each of the terminal tabs (using CTRL+C) and start again.
This User Guide will take you step-by-step through the whole supply chain process described in the Overview.
Note: This demo is designed to show successful conclusion of the supply chain workflow without exceptions or error conditions. A full production implementation would include additional features, handle errors and exceptions, and incorporate appropriate security controls.
Roles and Responsibilities
Role | Responsibilities |
Buyer | Buyer places a request for price and delivery for a quantity of goods with Seller. Once trade details are received from Seller, Buyer can review and accept trade details. After confirmation of trade details, the delivery process can begin. Buyer is responsible for making full or partial payments upon delivery of goods. |
Seller | Seller receives an order for goods. Seller is responsible for providing the price and delivery date confirmation to Buyer. Once the order is finalized, Seller is responsible for delivering the goods. Seller is in relationships with Supplier. Seller does not need to know the full details on inventories or how orders are allocated. |
Supplier | In the example, we model Supplier as a logistics provider with established contractual relationship with warehouse owners and transport companies. It is responsible for allocating orders to warehouses and finding transport companies for delivery. Suppliers need to be notified of issues during order fulfillment and transportation. Warehouses are directly owned by Supplier. |
Warehouse | Warehouse keeps records of inventory and is responsible for fulfilling orders. In our simplified workflow, once goods are handed off to Transport Companies, its responsibilities are complete. |
Transport Company | Transport Company is in possession of goods during transportation. It notifies relevant participants of any changes in the status of the delivery. |
Steps
The Supply Chain application includes the following steps:
-
Market Setup: The application starts with an automated market setup process. Participants and their roles are created, and relationships are set up.
-
Quote Request: Buyer requests a trade quote from Seller for the price and delivery date for a quantity of goods. Seller reviews the quote request and starts the pricing and delivery collection process.
Supplier receives notification of the new trade quote request from Seller.
-
Inventory Management: Supplier starts the quote collection process by selecting Warehouses to fulfill the product order request. At the same time, Supplier also sends a quote request for delivery from Transport Company 1 and 2. Transport Companies give a quote for price and estimated time of arrival for the delivery.
-
Delivery Management: Supplier uses an automated algorithm optimized for best price to calculate and finalize delivery. The algorithm computes quantities to be delivered from the Warehouses and calculates the amount of goods Transport Company needs to deliver from the Warehouses.
-
Order Finalization: Supplier sends an aggregated quote to Seller. Seller can review the quote details (quantity of goods, place of shipment, transport company, price) and can add margin to the price. Seller then sends the quote to Buyer. Buyer can review the quote and approve the order. Once the order is finalized, delivery of goods can start.
-
Transport: Transport companies pick up product from Warehouses. Pickup of goods is affirmed by the Warehouse. Transport companies then deliver goods to Buyer.
-
Delivery and Payment: Buyer needs to acknowledge the delivery. When a successful delivery is acknowledged by Buyer, an automated payment obligation is created between Buyer and Seller for the amount of goods delivered. If goods are arriving separately, then partial delivery and partial payment occurs. Consecutive payment obligations can also be initiated between Seller, Supplier, Warehouses, and Transport Companies.
When you launch the Supply Chain application, you will see the Navigator screen with the option to choose your role.
To log in:
- On the home screen, select the party from the list.
To switch users:
- Click the name of the current party at the top of the screen.
- On the home screen, select a different party.
The system date is visible in the top-right corner after you log in. The application starts with the example system date of June 3, 2019.
To change the system date:
- Log in as any role.
- Click on current date.
- Select the new date in the calendar view.
- Choose the Set button.
During Navigator startup, the basic buyer-seller relationship and other reference data is set up.
To request a quote:
- Log in as Buyer.
- Choose the Seller Relationships tab.
- Click on the relationship contract.
- Select the BuyerSellerRelationship_SendQuoteRequest choice.
- Click on Add new element
- Fill in the parameters:
- productName: the name of the ordered product (must match an existing inventory item)
- quantity: the ordered quantity
- deliveryFrom: the start of the acceptable delivery period
- deliveryTo: the end of the acceptable delivery period
- More products can be added by clicking on Add new element
- Choose Submit.
- Log in as Seller.
- Choose the Quote Requests tab.
- Click on the contract.
- Select the QuoteRequest_Accept choice.
- Fill in the parameter:
- workflowId: unique identifier of the order workflow
- Choose Submit.
- Log in as Seller.
- Choose the Accepted Quote Request tab.
- Click on the contract.
- Select the QuoteRequestAccepted_SendToSupplier choice.
- Fill in the parameter:
- supplier: the Supplier party
- Choose Submit.
- Log in as Supplier.
- Choose the Supply Invitation tab.
- Click on the contract.
- Select the QuoteRequestSupplyInvitation_Accept choice.
- Choose Submit.
- Log in as Supplier.
- Choose the Supply Request tab.
- Click on the contract.
- Select the SupplyRequest_StartPriceCollection choice.
- Fill in the parameters:
- warehouses: list of Warehouse parties from which to collect the products
- transportCompanies: list of Transport Companies from whom to request transport quotes
- Choose Submit.
Note that Supplier can see the available quantity of goods in each warehouse, as they are owned by Supplier.
- Log in as any Transport Company (TransportCompany1, TransportCompany2).
- Choose the Transport Quote Request tab.
- Click on the contract.
- Select the TransportQuoteRequest_Accept choice.
- Fill in the parameters:
- transportableQuantity: the quantity this transport company is able to deliver from the given location (Warehouse)
- price: the total price of transportableQuantity
- pickUpDate: date of pickup at Warehouse
- deliveryDate: date of delivery to Buyer
- Choose Submit.
- Log in as Supplier.
- Choose the Pending Quote Request tab.
- Click on the contract.
- Select the TransportQuoteRequestPending_ChooseTransport choice.
- Choose Submit.
- Log in as Supplier.
- Choose the Aggregated Pending Quote tab.
- Click on the contract.
- Select the AggregatedQuotePending_SendQuoteToSeller choice.
- Choose Submit.
- Log in as Seller.
- Choose the Aggregated Quote tab.
- Click on the contract.
- Select the AggregatedQuote_AddMargin choice.
- Fill in the parameter:
- margin: a decimal number describing the margin (e.g.
0.1
means 10% margin)
- margin: a decimal number describing the margin (e.g.
- Choose Submit.
- Log in as Buyer.
- Choose the Received Quote tab.
- Click on the contract.
- Select the QuoteForBuyer_Accept choice.
- Choose Submit.
- Log in as Seller.
- Choose the Confirmed Order tab.
- Click on the contract.
- Select the ConfirmedOrder_StartDelivery choice.
- Choose Submit.
- Log in as a Transport Company (TransportCompany1, TransportCompany2).
- Choose the Delivery Instruction tab.
- Click on the contract.
- Set the ledger date to the pickup date of the delivery instruction.
- Select the DeliveryInstruction_PickUp choice.
- Choose Submit.
- Log in as a Warehouse (Warehouse1, Warehouse2).
- Choose the Pickup Request tab.
- Click on the contract.
- Select the PickUpRequest_Accept choice.
- Choose Submit.
- Log in as a Transport Company (TransportCompany1, TransportCompany2).
- Choose the Pending Transport tab.
- Click on the contract.
- Select the TransportPending_Deliver choice.
- Choose Submit.
- Log in as Buyer.
- Choose the Delivery tab.
- Click on the contract.
- Set the ledger date to the delivery date.
- Select the Delivery_Acknowledge choice.
- Choose Submit.
- Log in as Supplier.
- Choose the Delivery Payment tab.
- Click on the contract.
- Select the DeliveryPayment_Accept choice.
- Choose Submit.
- Log in as Supplier.
- Choose the Supplier Payment tab.
- Click on the contract.
- Select the DeliverySupplierPayment_Pay choice.
- Choose Submit.
CONFIDENTIAL © 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. Any unauthorized use, duplication or distribution is strictly prohibited.