ure 5.18, SO that each mes- sage sent/received in the sequence diagram results in a send/receive signal in the state machine, and the three mandatory alternatives in the sequence diagram is reflected by three alternative paths in the state machine. Similarly, the elementary role state machine for callee is generated from the callee lifeline in the sequence diagram. Step 5: Create the local PESM diagrams Based on the transformation rules specified in Rossebo and Runde [4]: 1. From the global PESM diagram, create one local PESM diagram for each composite role involved in the service (as given in Step 1). 2. From the global policy rules, create the local policy rules to be associated with each PDP in the local PESM diagrams. Again, this step should be applied recursively to each composite service speci- fied as part of the composed service. Step 5 applied to the tele-consultation service: We illustrate this step by using the transformation rules specified in Rossebo and Runde [4] to derive the local PESM diagram and local policy rules for the TeleSvcDsk composite role. How to Model Dynamic Service Composition Using UML 2.x sm caller sm callee CallRequest CallRequest Calling RingingFromA Ringing Ringing RingingAtB BusyatB NoAnswer Answer ConnectedToA NoAnswer Answer ConnectedToB Hangup Hangup Disconnected Disconnected Figure 5.19 Role state machines for the caller and callee roles. (With kind permission from Springer Science+Business Media: J. E. Y. Rossebo and R. K. Runde. Specifying service composition using UML 2.0 and composition policies. In MoDELS 2008, Vol. 5301, LNCS, pp. 520-536. Springer, Berlin, 2008.) As shown in Figure 5.20, the hierarchical structure of the tele-consultation global PESM diagram is preserved. The right side of Figure 5.20 shows the assisting registrar and consult administrator composite roles, derived from the aided Registration and consultation PESMs, respectively. As for the global PESM diagram, the policy rules to be associated with each PDP in the local PESM diagrams are illustrated 