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 { role Buyer, Seller; Order from Buyer to Seller; choice from Seller to Buyer; { Invoice { } Rejected { } } }
This example shows how a Client role performs a credit check against a CreditAgency role.
protocol CreditCheck { role Client, CreditAgency; CheckCredit from Client to CreditAgency; choice from CreditAgency to Client { CreditOk { } NoCredit { } } }
This example shows how a protocol can be defined that 'implements' the previous two protocol examples.
protocol BuyerSellerCreditCheck { role Buyer, Seller, CreditAgency; Order from Buyer to Seller; CheckCredit from Seller to CreditAgency; choice from CreditAgency to Seller { CreditOk { Invoice from Seller to Buyer; } NoCredit { Rejected from Seller to Buyer; } } }