You are on page 1of 2

CREATING AN ORDER PROCESS

In this document we will explain the order creation process, in the beginning simplified, but will be improved
as we go. Here, the sequence diagram will be presented and communication between different modules
will be elaborated. In the first draft, the main goal is creating an order and saving it into the database through
the blockchain.

SIMPLIFIED SEQUENCE DIAGRAM


In this diagram only the interaction between modules is shown, while the internal process of each module
is not addressed.

DETAILED VIEW OF THE METHODS


When the order is sent from one Actor to another, it must invoke a saveOrder method from the OrderProxy
class. This method will create an Order object and invoke the process of saving the order into the blockchain
by retrieving the blockchain from the BlockchainFactory class and using the addOrder method from the
Blockchain class. The Blockchain method addOrder is invoking the saveChain method provided by the
BlockchainRepository from the persistence layer. Following are the signatures of the methods:
• OrderProxy.saveOrder(sender: Actor, order_desc: String, date: Date): boolean
o sender is the Actor that is invoking order creation process,
o order_desc:
▪ “request for finished product” (Order type: request, retailer → factory)
▪ “request for raw materials” (Order type: request, factory → producer)
▪ “delivery of raw materials” (Order type: delivery, producer → factory)
▪ “delivery of finished product” (Order type: delivery, factory → retailer)
o date represents the date of order creation
• BlockchainFactory.retrieveChain(): Blockchain
• Blockchain.addOrder(order: Order): boolean.
o Order is the order that needs to be stored in the blockchain
• BlockchainRepository.saveChain(): boolean.

You might also like