Synthesis State-machines from a communication diagram

purchaseordercol2.png

Example1 describes a case where every communication is asynchronous. This example explains a case where synchronous communications coexists.

Example

The choreography of this example is shown right. It is almost same with Example1; shipReq becomes a synchronous message and the reply message from Shipping is changed from shipInfo to shipReq.

Draw Class Diagram

Draw a class diagram in the same way with Example1.

Draw Communication Diagram

communicationDiagram.png

Draw a communication diagram in the same way with Example1. As shown in the figure right, the reply message to 3:shipReq is 4:shipReq.

Define ordering relation among messages.

  • Add "shipReq" in the Documentation of &color(blue){4:shipReq}.
  • Add "rep_shipReq" in the Documentation of 2:orderReply, 6:shipType}, and &color(blue){9:shipSchedule. The prefix "rep_" stands for a reply message of a synchronous message.

synthesis state machine

Synthesize state machines in the same way with Example1.

Results

  • Vendor state machine

The state machine of Vendor in Example1 sends &color(blue)(shipReq}; to shipping and then receives &color(blue){shipInfo}. In this example, the state machine calls shipReq() of shipping.

stateMachine_vendor_sync.png
  • Shipping state machine

Shipping receives shipReq and replies to shipReq

stateMachine_shipping_sync.png

In cbUML, execution of caller process is suspended when the communication is synchronous. In this example, the execution of the region that is in the composite state V2 and has initial pseudo state V7 is suspended on the transition from V8 to V9. When shipping replies to shipReq and vendor receives it, the suspended region is released and state V9 becomes active.


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2014-06-11 (水) 12:33:36 (3610d)