I am going to post some examples of how you can use commitments to describe various real-world situations. Remember that a commitment is a promise by a set of debtor agents to a set of creditor agents. By explicitly modeling the commitments through out an interaction, the agents involved can better understand, at each step, what they have done in the past and what they still need to do in the future.
Today’s post is about a protocol called OrderPayShip. I use it so often that I call it The Workhorse. This example shows a “classic” interaction pattern for incrementally creating and satisfying commitments in a business transaction. It’s an interaction—or protocol (more about protocols in upcoming posts)—between a Buyer (she) and a Seller (he). The protocol incrementally creates two commitments, and then incrementally satisfies those two commitments.
Let’s look at a common sequence of messages exchanged between these two agents using the OrderPayShip protocol. I’m only going to talk about the “happy path” of this protocol for now—the one that both agents hope will happen—and skip any error conditions for now. Five messages are exchanged:
- Buyer requests a price quote on some good. Suppose Buyer wants a pizza, walks up to Seller’s counter and she asks how much a pizza would cost.
- Seller returns his price quote. That is, Seller tells Buyer that a pizza costs $10. This message also means Seller commits to Buyer that he will give the pizza to Buyer, if Buyer pays the quoted price: C(Seller, Buyer, $10, pizza). Typically this information is implied by the interaction, but we track commitments explicitly.
- Buyer likes the idea of a $10 pizza, and she places an order. Placing the order also means Buyer commits to Seller that she will pay, if Seller gives her a pizza: C(Buyer, Seller, pizza, $10).
At this point, there are two reciprocal commitments: one from Seller to Buyer and one from Buyer to Seller, and both commitments are conditional. The protocol could stall at this point, because neither agent is required to do anything more. But since both agents are interested completing the order, one of them will typically make a move. - Here, I assume Buyer sends her payment first. This satisfies Buyer’s commitment and also makes Seller’s commitment unconditional.
- To satisfy his unconditional commitment, Seller gives her a pizza. This satisfies Seller’s commitment.
At this point both commitments are satisfied and the protocol is complete.