現今的Web services技術是最適合被利用來建構複合式服務 (composite service),而BPEL (Web Services Business Process Execution Language) 是被廣泛應用的服務組合的工業標準。然而,BPEL型態的複合式服務是典型的透過串接web services來進行全自動運行的服務流程,並無包含使用者互動(user interaction),而使用者互動是服務遞送 (service delivery) 機制所需的主要特性但目前並不含括於BPEL的標準中。OSGi (Open Service Gateway Initiative)已經被廣泛地應用在合作型軟體元件 (collaborative software components) 的部署與執行並支援服務導向隨處運算(service-oriented pervasive computing) 於各種嵌入式設備中的發展。然而,如何在分散的OSGi服務 (distributed OSGi services) 間進行合作溝通模式並不含括在目前的OSGi規格中。這篇論文提出了對BPEL的擴充來達成將使用者互動模式引入到複合服務中並著重於以下三方面:(1) 發展兩種新的BPEL擴充活動 (extension activity) 來分別描述使用者互動於BPEL流程服務中的內部運作模式與服務使用者介面 (service user interface) 的展現方式 (rendering);(2) 提供精靈模式 (wizard-style) 的使用機制來導引使用者依據流程執行的順序與服務流程進行互動;(3) 設計了一個使用介面服務的溝通協定(UI service communication protocol) 來達成安全的跨網域 (cross-domain) 資料溝通。因此,我們亦依據以上的要點開發了加強型的BPEL執行引擎。本研究亦提出了一個以BPEL為基底的分散式OSGi服務組合的方法並結合智慧型代理人服務架構 (agent service framework) 來促進跨移動設備間分散式的OSGi服務組合,並著重以下三個方面:(1) 與智慧型代理人服務架構進行系統合作來存取那些分散的OSGi服務;(2) 提出以BPEL為基底的智慧型代理人路線規劃 (BPEL-based agent itinerary) 來自動導引智慧型代理人服務進行移動 (migration) 與存取服務;(3) 說明並解釋各項發展輕量化BPEL執行引擎 (light-weight BPEL engine) 的設計原理。 Web service technologies are best exploited by composing services, and BPEL (Web Services Business Process Execution Language) is adopted industrial-wide as the de facto service composition standard. However, a BPEL composite service is typically treated as a fully automated service flow that orchestrates multiple web services and involves no user interactions – a desirable feature for service delivery, and is presently not included in the BPEL standard. Open Service Gateway Initiative (OSGi) has been widely adopted in the deployment and execution of collaborative software components and the development of service-oriented pervasive computing applications in a variety of embedded devices. However, how to collaboratively communicate among the distributed OSGi service bundles is not considered in current OSGi specifications. In this work, we propose an extension to BPEL to infuse user interactions into composite services along three dimensions: (1) to develop two BPEL extension activities to describe the inner workings of user interactions in BPEL service and the rendering of service user interfaces; (2) to provide a wizard-style mechanism to guide the user to interact with the service flow in accordance with the sequence of service execution; and (3) to devise a UI service communication protocol to facilitate secure cross-domain communication among UI services from various domains. Thus, an enhanced BPEL engine with a service UI rendering engine has been accordingly developed. The work also proposes a BPEL-based decentralized OSGi service composition approach to integrating our previous work on agent service framework to facilitate decentralized OSGi service composition across the resource-limited embedded devices along three dimensions: (1) to cooperate with the agent services to access distributed OSGi services; (2) to provide an BPEL-based agent itinerary to guide the agent service where to migrate and what services are available for access on current site; and (3) to elucidate the design principles for the development of light-weight BPEL engine.