A supply chain consists of a sequence of agents: A1, A2, ... An.
Ai consumes products from his successor, Ai+1 in order to produce products for his predecessor, Ai-1.
A1 is the initiator of the chain and consumes the end product. An only produces.
Products can be goods or services.
Example: as a consumer of computers, A1 orders a computer from A2, a producer of computers. However, A2 is a consumer of computer chips, which he orders from A3, who produces computer chips.
Example: web browser A1 consumes (displays) web pages from web server A2. A2 requests analysis from application server A3. A3 requests data from database server A4.
Of course an agent may participate in many supply chains. For example, the computer producer in the first example will also need keyboards, monitors, and other components, all from different producers, before he can assemble the finished product.
A consumer requests a product from a producer. If the producer agrees, the product is produced, then returned to the consumer where it is consumed:
In his consumer role, agent A1 requests a product from agent A2 in his producer role. Switching to his consumer role, A2 requests a needed component from agent A3 in his producer role. Switching to his consumer role, A3 requests a needed sub-component from agent A4 in his producer role. Upon receiving the sub-component from A4, A3 assembles a component and returns it to A2. A2 assembles the finished product and returns it to A1.
Assuming all agents agree to their requests, we can represent this scenario as follows:
We can also use reference frames to more accurately represent the scenario:
In a contractual supply chain the producer is not fixed in advance. Instead, the consumer broadcasts a request for proposals. Several producers may respond with proposals. After a period of time, the consumer selects the best proposal. If there isn't a best proposal, the process repeats, otherwise the consumer sends an acceptance to the producer with the selected proposal and a rejection to the other producers:
This protocol is called the Contract Net Protocol (CNP).
After a producer is accepted, the supply protocol is enacted:
We can model the consumer's behavior using a statechart diagram: