JBoss.orgCommunity Documentation
This chapter presents some examples using the protocol notation.
This example shows how a Buyer participant and Seller participant may interact in an ordering process.
protocol BuyerSeller { participant Buyer, Seller; Order from Buyer to Seller; choice from Seller to Buyer; { when Invoice { } when Rejected { } } }
This example shows how a Client participant performs a credit check against a CreditAgency participant.
protocol CreditCheck { participant Client, CreditAgency; CheckCredit from Client to CreditAgency; choice from CreditAgency to Client { when CreditOk { } when NoCredit { } } }
This example shows how a protocol can be defined that 'implements' the previous two protocol examples.
protocol BuyerSellerCreditCheck { participant Buyer, Seller, CreditAgency; Order from Buyer to Seller; CheckCredit from Seller to CreditAgency; choice from CreditAgency to Seller { when CreditOk { Invoice from Seller to Buyer; } when NoCredit { Rejected from Seller to Buyer; } } }