ationComplete PlayRole (consult administrator) G: svcAccessed Figure 5.20 Local PESM diagram for the TeleSvcDsk composite role. Step 6: Create and distribute service role implementations For each elementary role state machine taken from the repository or created in Step 4: 1. From the elementary role state machine, generate the code if this is not already done. Such code generation may be performed automatically as described in Kraemer [19, 20]. 2. Distribute the relevant code to each of the subscribing components of the system. By subscribing components, we mean the system components interested in playing this role. Exactly which system components the roles should be How to Model Dynamic Service Composition Using UML 2.x distributed to is platform-specific information and not a part of the methodology described here. Step 6 applied to the tele-consultation service: A schematic diagram showing the tele-consultation system deployment is given in Figure 5.21. The figure shows the distributed parts of the system: the patient TE located in the patient's home, the doc- tor TE located at the doctor's office, and the electronic tele-consultation service desk and the receptionist TE, each located in the hospital. Local policy manage- ment is deployed on each of the distributed parts of the system which are connected to the central policy management via the network. Although not described in this chapter, we have defined an architectural framework for a policy-based dynamic composition system; for information on this, we refer to [10]. For each elementary role state machine, the code is generated and distributed to each of the subscribing components. In this example, the code for the roles to be played by the PatientT composite role are distributed to the patient's terminal, the roles to be played by the ReceptionistT composite role are distributed to the receptionist's terminal, and the roles to be played by the TeleSvcDsk composite role are distributed to the tele-service desk terminal. Local policy management Local pol