#menu(Menu)
RIGHT:[[Japanese>Synthesis2(Jpn)]]

** Synthesis State-machines from a communication diagram [#qbf41a3f]

#ref(Synthesis2(Jpn)/purchaseordercol2.png,right,around)

[[Example1>Synthesis(Eng)]] describes a case where every communication is asynchronous.
This example explains a case where synchronous communications coexists.

*** Example [#e873c495]

The choreography of this example is shown right.
It is almost same with [[Example1>Synthesis(Eng)]]; shipReq becomes a synchronous message and the reply message from Shipping is changed from shipInfo to shipReq.
It is almost same with [[Example1>Synthesis(Eng)]]; &color(blue){shipReq}; becomes a synchronous message and the reply message from ''Shipping'' is changed from &color(blue){shipInfo}; to &color(blue){shipReq};.

*** Draw Class Diagram [#pe69aaa6]

Draw a class diagram in the same way with [[Example1>Synthesis(Eng)]].


*** Draw Communication Diagram [#t120ba7a]
#ref(Synthesis2(Jpn)/communicationDiagram.png,right,around)

Draw a communication diagram in the same way with [[Example1>Synthesis(Eng)]].
As shown in the figure right, the reply message to 3:shipReq is 4:shipReq.
As shown in the figure right, the reply message to &color(blue){3:shipReq}; is &color(blue){4:shipReq};.

Define ordering relation among messages.
- 4:shipReqへの先行メッセージとして shipReq を文書欄に登録して下さい.
- 2:orderReply, 6:shipType, 9:shipScheduleへの先行メッセージとしては rep_shipReq を登録して下さい.接頭語 rep_ は同期メッセージの返信メッセージを表します.
- Add "shipReq" in the Documentation of &color(blue){4:shipReq}.
- Add "rep_shipReq" in the Documentation of &color(blue){2:orderReply};, &color(blue){6:shipType}, and &color(blue){9:shipSchedule};.
The prefix "rep_" stands for a reply message of a synchronous message.


*** 状態機械の合成 [#r100e3cd]
*** synthesis state machine [#r100e3cd]

[[Example1>Synthesis(Eng)]]同様に状態機械を合成して下さい.
Synthesize state machines in the same way with [[Example1>Synthesis(Eng)]].

*** 実行結果 [#tba5403c]
*** Results [#i4c20ac7]

- Vendorの状態機械
- Vendor state machine

[[Example1>Synthesis(Eng)]]の実行結果では,VendorはメッセージshipReqをshippingに送信し,その後shipInfoを受信していました.
今回合成された状態機械では,shippingのshipReq()を呼び出しています.
The state machine of ''Vendor'' in [[Example1>Synthesis(Eng)]] sends &color(blue)(shipReq}; to ''shipping'' and then receives &color(blue){shipInfo}.
In this example, the state machine calls &color(blue){shipReq()}; of ''shipping''.


#ref(Synthesis2(Jpn)/stateMachine_vendor_sync.png,center)

- Shippingの状態機械
- Shipping state machine

ShippingはshipReqを受信し,shipReqに返信しています.
''Shipping'' receives &color(blue){shipReq}; and replies to &color(blue){shipReq};

#ref(Synthesis2(Jpn)/stateMachine_shipping_sync.png,center)

cbUMLでは,同期通信があると送信側の実行が停止します.
この例では,Venderの状態V2内の初期疑似状態V7を持つ領域において,状態V8からV9への遷移(同期メッセージshipReqを送信している)において,この領域の実行が停止されます.
ShippingがshipReqへの返信を送信し,Vendorが返信を受信すると,実行の停止が解除され,V9が活性状態となります.
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 &color(blue){shipReq}; and ''vendor'' receives it, the suspended region is released and state V9 becomes active.


RIGHT:[[CSCB Home>CSCB(Eng)]]

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS