Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf ·...

44
Model Driven orchestration Composition Master thesis HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille Master Responsable: Pr ABOUTAJDINE Driss Mohammed V, Agdal University Rabat Morocco I3S Laboratory, Sophia-Antipolis University Nice France July 16, 2008

Transcript of Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf ·...

Page 1: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model Driven orchestration CompositionMaster thesis

HAMMOUCHE Douae

Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Master Responsable: Pr ABOUTAJDINE Driss

Mohammed V, Agdal University Rabat Morocco

I3S Laboratory, Sophia-Antipolis UniversityNice France

July 16, 2008

Page 2: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille
Page 3: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Acknowledgement

I would like to express my deep and sincere gratitude to my french supervisor, Madame Mireille Blay-Fornarino, Member of Rainbow team, at I3S Laboratory, University of Sophia-Antipolis de NICEin France. Her wide knowledge and her logical way of thinking have been of great value for me. Herunderstanding, encouraging and personal guidance have provided a good basis for the present report.

I owe my most sincere gratitude to Professor Salma Mouline, Member of GSCM research team atSciences Faculty of Mohammed V University of Rabat, and Professor Mounia Fredj from ENSIAS,engineering school at Mohammed V-Souissi Unviversity of Rabat, who gave me the opportunity towork with them during my third master semestre in Sciences Faculty, at the Mohammed V-AgdalUniversity of Rabat, and gave me important guidance during my first steps into computer sciencestudies. Their ideals and concepts have had a remarkable influence on my training in the field ofMDE research.

My sincere thanks are due to Professor Michel Riveill, Head of the ”Computer Science” depart-ment at the Engineering School of Technology of the University of Nice - France, who welcomed mein I3S Laboratory and helped me do this work.

I warmly thank Professor Driss Aboutajdine, head GSCM research team of Sciences faculty, Mo-hammed V-Agdal University of Rabat, for his kind support and guidance that have been of greatvalue in my study.

My warm thanks to Franck Chauvel, PHD student at I3S Laboratory and member of Faros project,who gave me a great support when I was working on Kermeta.

During this work I have collaborated with many colleagues for whom I have great regard, and Iwish to extend my warmest thanks to all those who have helped me with my work in the Rainbowteam at I3S Laboratory of Sophia-Antipolis University in France.

I owe my loving thanks to my Parents Amar et Souad, my fiance Tarik. They have been a greatsupport to my studies abroad.

The financial support of the scholarship given by ERASMUS MUNDUS EXTERNATL WINDOW,IMAGEEN project is gratefully acknowledged.

Nice, France, Juillet 2008Douae Hammouche

Page 4: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Contents

1 INTRODUCTION 71.1 Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2 General theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.2.1 FAROS project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.3 WS-BPEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.3.1 XML and BPEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.3.2 Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.4 ADORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.5 Objectif of My work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2 Merging two BPEL orchestrations: The problem 112.1 Behavior in BPEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 The problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Meta Models to transform 143.1 ADORE Meta Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3.1.1 ADORE formalism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.1.2 Adore behavior Meta Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.2 BPEL Meta Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4 BPEL Meta Model to ADORE Meta Model transformation 184.1 Kermeta language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.2 Navigating the Meta Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4.2.1 Visitor Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3 Building transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4.3.1 Building phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.3.2 Linking phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.3.3 Starting the transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4.4 Validating phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

5 Perspectives and Conclusion 295.1 Perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

4

Page 5: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

6 Annexe 316.1 Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316.2 Overview of WS-BPEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

6.2.1 Structure of a process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316.2.2 BPEL activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

6.3 Transformation kermeta files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.3.1 BPEL Visitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.3.2 The Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366.3.3 Aspect adding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396.3.4 Transformation main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

5

Page 6: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

List of Figures

1.1 Project platform. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2 BPEL main concepts [Mig05]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.1 orchestration Best Registration based on price comparison. . . . . . . . . . . . . . . 122.2 orchestration Best Registration based on the required date. . . . . . . . . . . . . . . 122.3 orchestration Best Registration based on all. . . . . . . . . . . . . . . . . . . . . . . . 13

3.1 BPEL and ADORE MM transformation. . . . . . . . . . . . . . . . . . . . . . . . . . 143.2 Adore behavior Meta Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.3 BPEL Meta Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.1 Kermeta positionning [DFF+08] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.2 White box reusing in our Visitor Pattern. . . . . . . . . . . . . . . . . . . . . . . . . 204.3 Simple mapping of final classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.4 simpleprocess.xmi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.5 simpleprocess.xmi transformed into ADORE. . . . . . . . . . . . . . . . . . . . . . . 234.6 Example of sequence composed of flow. . . . . . . . . . . . . . . . . . . . . . . . . . . 244.7 xmi file of process5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254.8 Generated file of process5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.9 Declaring aspect in a class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.10 Linking activities in a flow with OrderRelation classes. . . . . . . . . . . . . . . . . . 27

6.1 Project planification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

6

Page 7: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Chapter 1

INTRODUCTION

1.1 Context

The project I have been working on for my graduation in Master 2 for a period of six monthsis based on Faros research project with forteen permanent researchers team of I3S Laboratory atNice Sophia-Antipolis University. The purpose of my work is about Meta Models Transformation.More precisely, I contribute to Transformation to Platform used in Faros Project wich is basedon Meta Models Transformation concepts. Since plateforms I am working with are based on SOA(Adore and BPEL), my work handles web services orchestration matters especially orchestrationscompostion. That is why we used Model driven achitecture.

1.2 General theme

Services Oriented Architectures (SOA) [MLM+06] use the concept of service as an elementary brickto assemble complex systems. Services are loosely coupled by definition, and complex services arebuild upon basics ones using composition mechanisms. The loose coupling methodology enablesthe separation of concerns and helps systems evolution.

Using these elementary services for web services and orchestrations [Pel03] as a composition mech-anism, web service Oriented Architectures (WSOA) provides a way to implement these looselycoupled architectures. W3C defines orchestrations as ”the pattern of interactions that a web ser-vice agent must follow in order to achieve its goal” [W3C04]. Specialized code is written insideweb services while business processes are described as an orchestration of those web services. Codemanipulations, such as refactoring operation, help software evolution support. In [MWD+05], au-thors identify some challenges for future research on software evolution and focus on the abstractionneed. Lehman identifies as his first ”Law of Software Evolution” [Leh96] that ”A program that isused must be continually adapted else it becomes progressively less satisfactory”. As Faros projectensures this vision, it is expected from this work to provide a solution to the orchestrations com-position in BPEL that allows evolution.

The platform to compose orchestrations is being developed by the Rainbow team ( see figure 1.1)

7

Page 8: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

[MBFR08]. Using this platform we have to transform BPEL orchestrations into ADORE Model inorder to compose them.

Figure 1.1: Project platform.

1.2.1 FAROS project

In [LMBBF+06], the objectif of FAROS project is to define a composition environment for a reli-able building of services oriented architecture. It aims at working on application integration usingcontractuel elements in order to provide a coherent services composition and also to define method-ology that makes contracts integration process productible from business Models to their projectioninto execution platforms.

The idea of this project began from converging points of view among different partners that theactual services integration solutions don’t provide way of expression neither to verify specificationswich are the garantee of a sufficient level of trust in assembling different elements of an architec-ture. Moreover, these solutions don’t follow a guiding methods and don’t account for the strongconstraints related to extra-functionnal environment properties.

The project proposes to express applications constraints by contracts. It defines contract as aproperty expression that entities have to respect when collaborating together independently of theirimplementation. During my training, I worked and participated in meetings concerned by this partand arround the delivrable 2.3 ”Meta Models of plateforms” that will be published soon.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

8

Page 9: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

1.3 WS-BPEL

1.3.1 XML and BPEL

web services Business Process Execution Language (WS-BPEL) is an XML based programminglanguage used to describe high level business processes. A ’business process’ is a term used todescribe the interaction between two businesses or two elements in some business [Mig05]. Anexample of this might be company A purchasing something from company B. BPEL allows thisinteraction to be described easily and thoroughly such that company B can provide a web serviceand company A can use it with a minimum of compatibility issues. Also, a web service is typicallydescribed using web service Description Language (WSDL). This is another XML based languagewhich allows one to describe the interface to the web service.

1.3.2 Binding

A common binding is SOAP/HTTP which uses the XML Simple Object Access Protocol (SOAP)over HTTP (standard web page fetching language) to talk to web services which are on the internet.Another common binding is the Java binding. This binding allows one to define local in-processjava implementations of web services. So if wanted to write a web service that allows clients toprint things (e.g. ’Hello World’) one could write it in Java and then expose it as a web service[Mig05]. Next figure 1.2 illustrates BPEL main concepts:

Figure 1.2: BPEL main concepts [Mig05].

1.4 ADORE

To perform high level composition and to allow reasoning on orchestrations and evolutions, wedefine a Model called Adore: ”Activity Model suppOrting orchestration Evolution”. We will developADORE description in farther paragraph.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

9

Page 10: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

1.5 Objectif of My work

In the context of Faros project, the expression of process orchestration is carried out using BPEL[AAA+07] since it is a standard of process oriented implementation of web services. Here we focuson BPEL activities processing order as defined in OASIS Standard.

The aim of this work is threefold. First, we identify the problem of merging two orchestrationsin BPEL. Second, we obtain our own BPEL Meta Model to simplify the transfomation process.The target of this Meta Model is an Adore Meta Model which already exists. Third, havingboth source and target Meta Models we proceed with the transfomation using the Visitor Pattern[GJHM94] and Kermeta language [BCF+05] within ECLIPSE.

we will focuse on a transformation between Meta Models and not Models in order to make thistransformation general to all instanciations of theses Meta Models. We would indeed use the VisitorPatten to cover the Meta Models as trees and entities as leaves.

Having described the context, reviewed concepts that will be involved and set the objectives toattain for this work the main methodology steps that wll be followed for this work are as follow:

1. Obtain both source and target Meta Models.

2. Write the transformation using the Visitor Pattern.

3. Implement the transformation with kermeta.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

10

Page 11: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Chapter 2

Merging two BPEL orchestrations:The problem

2.1 Behavior in BPEL

WS-BPEL wich stands for web services Business Process Execution Language is a language forspecifying business process behavior based on web services. Processes in WS-BPEL export andimport functionality by using web service interfaces exclusively [AAA+07]. It is integrated withinEclipse and provide a graphical interface to handle services orchestration. in this work we will focuson this part of BPEL.

2.2 The problem

As figures 2.1, 2.2 and 2.3 show, here we have the problem of merging two different BPEL orches-trations. First, 2.1, we have to orchestrate between two services: booking a hotel and booking aflight in order to build the cheapest trip.

Second, we carry out an orchestration (2.2) that allows to reuse an existing web service (book-FlightHotel) that provides different trips in different dates. The result of this orchestration is theselecion of the trip with the best date.

As we see BPEL provides complete tools to describe a business process and specially orderingservices. But having these two orchestrations done, can we know which booking gives the client thebest price and date? (Booking hotel and flight separately or booking their combination offer). Theanswer will be an orchestration ( see figure 2.3) wich is the composition of both the orchestrationsof 2.1 and 2.2.

Therefore, composing these different orchestrations in BPEL would not be automatic. Indeed, ifit is a big orchestrations composition it may be hardly done. Thus, we chose to use the ADORE plat-form that allows us to addresses the problem of the merging of different orchestrations [MBFR08].

11

Page 12: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 2.1: orchestration Best Registration based on price comparison.

Figure 2.2: orchestration Best Registration based on the required date.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

12

Page 13: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 2.3: orchestration Best Registration based on all.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

13

Page 14: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Chapter 3

Meta Models to transform

Taking advantage of ADORE to compose Activities, we aim to generate automatically BPEL orches-trations. In the opposite, to reuse existing orchestrations we need to transform BPEL orchestrationin ADORE. The first step of this work is to set up the Meta Models needed in the transformation,see figure 3.1. At the end, we want to reach a transformation Model that maps the BPEL MetaModel to the ADORE Meta Model so that we can propose automatic orchestrations compositionto the client. First let us introduce both of these Meta Models.

Figure 3.1: BPEL and ADORE MM transformation.

3.1 ADORE Meta Model

3.1.1 ADORE formalism

This section describes formally this Model based on [Mos07].

orchestration : An orchestration is a tuple (A∗, <∗) that defines a behavior. A∗ is a set ofActivities a1, ..., an and <∗ a partial ordering among these activities.

14

Page 15: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Activity : An activity is a tuple (uid,K,V ∗in,Vout,G∗). Each activity is unique inside an orches-

tration and identified by uid. K refers to the Kind of this activities. V ∗in (resp. Vout) represent

inputs (resp. output) Variables. G∗ represents conditional guards and allows conditional expres-sions (if/then/else). In order to respect the schedule of this work we didn’t include the guards inthe analysis and we worked only with behavior Meta Model of Adore.

Partial ordering (<, precedences rule): Activities are ordered using an operator <. The expres-sion a1 < a2 is called a precedence rule and means that a2 must wait the end of a1 before startingits own executing.

Kind : We use in ADORE behavior Meta Model a subset of ADORE specifications. We considerthe following kind of allowed activities:

* variable assignment (Assign)

* service invocation (Invocation)

* message reception (Receive)

* response sending (Reply)

* fault report (Throw)

Evolution : An Evolution can be considered as a piece of orchestration which can be plugged intoexisting orchestrations. Evolution is therefore as a superset of orchestrations.

We use then Adore formalism wich enables the automatic integration of n evolutions into anorchestration automatically.

3.1.2 Adore behavior Meta Model

Adore behavior Meta Model is derived from concepts defined in [Mos07], see figure 3.2. Because itis still in developement, we will use for this work the version of ADORE Meta Model made availablefor us at the beginning of this project. In this Meta Model we find the needed container entitynamed behavior that posseses activities and order entities.

3.2 BPEL Meta Model

Since BPEL is a large and complex language and in order to define a simple Bpel Meta Model,we used the concepts we need for the targeted transformation of this work, such as the behavioralconcepts from OASIS STANDARD of WS-BPEL. OASIS STANDARD introduce the behavioralnotion as follow: ”Executable business processes Model actual behavior of a participant in a busi-ness interaction” [AAA+07]. A basic structure of a process is given in the Annexe. This structuredefines the components of a process.

Since BPEL description has many concepts and in order to simplify carrying out a BPEL MetaModel we used only some of the principal concepts which are involved in an orchestration behavior.These concepts are:

* Process

* Partner Link

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

15

Page 16: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 3.2: Adore behavior Meta Model.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

16

Page 17: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

* Activity

* Variable

* Link

Based on these concepts we obtained an example of BPEL Process Meta Model as follows in figure3.3:

Figure 3.3: BPEL Meta Model.

This Meta Model will be used as the source of the transformation from BPEL Meta Model toADORE Meta Model.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

17

Page 18: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Chapter 4

BPEL Meta Model to ADOREMeta Model transformation

Now that we have both source and target Meta Models we can map them. To implement thetransformation between these two Meta Models we need a language wich permit their loading inorder to scan each source entity and bind it with the associated target. For the Faros project theKermeta language [BCF+05] has been chosen, so we will use this language for the transformation.

4.1 Kermeta language

Kermeta is a Triskell project of INRIA. It is a Meta Modeling language that defines both thestructure and the behavior of Meta Models. Kermeta has been designed to be fully compliant withthe OMG Meta Modeling language EMOF (part of the MOF 2.0 specification) and provides anaction language for specifying the behavior of Models. It is developped with an open source licenseEPL (Eclipse Public License). Figure 4.1 shows kermeta positionning.

Kermeta is intended to be used as the core language of a Model oriented platform. It has beendesigned to be a common basis to implement Metadata languages, action languages, constraintlanguages or transformation language. It intends so to provide useful Models manipulation tools.

4.2 Navigating the Meta Models

Before mapping both Meta Models, we need to know each element and its associates (each elementcan have many targets). That is why we navigate in each of Meta Model to determine the differenttransformations needed. For exemple, a process, wich is the container in BPEL Meta Model, willbe mapped to ADORE Meta Model container Behavior. And so on we associate to each entitysource its entity (or entities) target, and make the transformation.

4.2.1 Visitor Pattern

To scan a Meta Model we programmed a Visitor Pattern, one of the Design Patterns defined in[GJHM94]. As Christopher Alexandre said: ”Each pattern describes a problem wich occurs over

18

Page 19: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 4.1: Kermeta positionning [DFF+08]

and over again in our environment, and then describes the core of the solution to that problem, insuch a way that you can use this solution a million times over, without ever doing it the same waytwice”, we can clearly find out that using a Visitor Pattern we will be able to provide the genericitywe want for our transformation. There are two ways of reuse: white box reuse and black box reuse.In our case we used white box reuse since we reuse by subclassing, wich means using inheritanceinstead of interface. We can see this in figure 4.2.

4.3 Building transformation

Building a transformation consists of determining generated elements for each source elements. Forthat, Kermeta permits loading the Meta Model and adding new properties that didn’t exist firstin this Meta Model, like the property generated that we need only at the transfomation process.Also, we need the Visitor Pattern to cover all elements in our Meta Model. After that we can mapeach found element to its generated element. We have then to link the generated elements amongthem to obtain the targeted Model. Finally, having a Visitor, a builder and a linker we can launchthe transformation process.

4.3.1 Building phase

In the beginning, we start working on final entities in our BPEL Meta Model, like all Activitysubclasses. We can map these entities simply since their targets are final entities in ADOREbehavior Meta Model too. As for the invoke class, in BPEL, its generated element is Invocationclass in ADORE. Same thing to all other subclasses of Activity except sequence and flow classes

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

19

Page 20: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 4.2: White box reusing in our Visitor Pattern.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

20

Page 21: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

which are complex types. The segment code below in figure 4.3 shows how we generate one classin ADORE:

Figure 4.3: Simple mapping of final classes.

To illustrate transforming this simple classes, we give in figure 4.4 a very simple example oforchestration simpleprocess:

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

21

Page 22: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 4.4: simpleprocess.xmi.

The transformed simpleprocess is shown in figure 4.5.

After determining generated classes for entities above, we go on to other more complex entities.For exemple, the class sequence. This class is defined in BPEL such as a collection of activities[AAA+07]. Here we show how Kermeta is useful since it provides all tools we need such as Collec-tionspackages. (See Annexe for more details).

The difficulty with sequence activity was when building transformation we needed to conserveorder between all its activities while building the generated class for each of these sequence activities.More importantly, since a sequence can also include a flow we have to conserve in the same time theorder sequence of activities and the parallelism of the flow activities. This was the major difficultyin the transformation because there isn’t a generated class for sequence neither for flow.

In the following example we have an orchestration named process5 composed of a sequence thathas simple activities and flow, see figure 4.6:

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

22

Page 23: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 4.5: simpleprocess.xmi transformed into ADORE.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

23

Page 24: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 4.6: Example of sequence composed of flow.

We instantiate our BPEL Meta Model to have this orchestration as .xmi file, see figure 4.7. Afterapplying the transformation on this orchestration Model we finally have the ADORE generatedorchestration. As we see in figure 4.8 it has more elements than the source orchestration:

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

24

Page 25: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 4.7: xmi file of process5.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

25

Page 26: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 4.8: Generated file of process5.

We had more elements in the generated file than the source file because, for every order in thesequence and every order in the flow, expressed by a link, we generate an orderRelation class inADORE. This difference is explained by the fact the order in a sequence in BPEL is defined as anordered list and as a relationship between two activities.

4.3.2 Linking phase

Now that we have all our element source and their generated elements we have to link elements inthe generated Model, in order to be conform to ADORE Meta Model. Here we need the ability ofkermeta to add new property, defined by the word aspect that we add when declaring a class, seefigure 4.9:

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

26

Page 27: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

Figure 4.9: Declaring aspect in a class.

Having the generated elements, we have to link them to have a Model conform to ADORE MetaModel. Such as behavior in Adore Meta Model is associated to OrderRelation by the reference order,that is linked to Activity with the reference before and after. For an illustration see figure 4.10 :

Figure 4.10: Linking activities in a flow with OrderRelation classes.

4.3.3 Starting the transformation

After having visited all source elements in BPEL Model, built their generated elements and linkedthem we can now begin the transformation. For this, we create a transformation file that call allthe files before by specifying the source and target files. Finally, by executing our kermeta file wereach the Adore Model, wich is the target. See the Annexe for the transformation files.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

27

Page 28: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

4.4 Validating phase

Although we can build our transformation, to validate it is an other matter. At first we are surethat the resulting Model conforms to ADORE Meta Model. And this since Eclipse environmentsupports such validation. However to check the equivalence of two Models, the generated and thereal ADORE Models, at present time we need to do the validation manually. But as we workedon examples, it isn’t easy in a general case. And since ADORE is still in developement we cannot perform yet a formel validation of the transformation. And as the ADORE Meta Model haschanged from the beginning of my work, we can’t for the moment use tools such as visualisation.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

28

Page 29: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Chapter 5

Perspectives and Conclusion

5.1 Perspectives

BPEL Meta Model transformation into ADORE Meta Model is an important part of the Modeldriven composition orchestration. Having it done, we have completed the main part of making or-chestrations composition automatic. And while working on our transformation , between differenttechnologies Meta Model, we thought about what would be next. Consequently, more work hasto be done to make the composition process automatic now that we have the main transformationachieved.

Possible transformations may be as follows:

* From Adore to BPEL (T−1 of our work).

* From .bpel to .xmi files.

* From .xmi to .bpel files.

The first transformation will be clearly done after having our generated orchestrations composedin one orchestration in ADORE. This step would also be an elegant solution to validate the trans-fomation we proposed, as soon as we will be able to check if two orchestrations are equivalent. Incase we would like to transform a sequence in ADORE, we will need to know if it will be generatedin BPEL as a sequence or as a flow that has activities linked as a sequence. However, it will permitcoming back to our source language BPEL, but at this stade, it will provide an .xmi file that isconforme to our BPEL Meta Model.

That is why, the second transformation will then be needed to provide our final .bpel file andmake all of the orchestration composition process an automatic one. Finally, the third transforma-tion is clearly the first one that gives the orchestrations we want to combine in one, they are thesource for our transformation.

Some ideas have been put forward to handle these next transformations will be handled. Of course,there are many ways to answer these questions. Some of these answers are:First, the reverse transformation, from ADORE to BPEL, will be inspired from the transformation

29

Page 30: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

discussed in this work, since they both use the same Meta Models. Nevertheless, it doesn’t meanthat it will we the same or easier, because we don’t know if it is an bijective transformation. Second,for second and third transformation (BPEL to XMI, XMI to BPEL), we thought of using an XMLparser since both of these languages are based on XML files. For that, there are many tools thatpermit a XML to XML transformation.

5.2 Conclusion

My work in this training can be summerized into two main parts. The first one consisted of dis-covering BPEL language and working with its Meta Model for which an example of BPEL MetaModel has been developed. While the second part was about building the transformation in thecontext of FAROS project using MDA concepts and Meta Model transformations.

By finding out how to realise a Meta Model of BPEL, I had the opportunity to discover andwork with this language. With this part of my work, I had the opportunity to develop the requiredknowledge of all BPEL concepts and web services technologies related to it. And these are fromprogramming services with JAVA to deploying them on a web page, by using all sort of technolgieslike: JETTY, AXIS 2 and ODE.

Moreover, while realising the Meta Model I worked with the MDE side. And this is when I usedEMF to write my Meta Model since it is a graphic tool like Modelising with UML. Finally, bymaking a small BPEL Meta Model, I provide to every one interested in transformation from BPELlanguage to any other language a Meta Model source. Also, will be an sample for Faros as a MetaModel for future platform transformations from BPEL.

The Meta Model transformation is a major concern for the FAROS project. Since this transfor-mation provides a bridge between different platforms and technologies, the rainbow that I workedduring this project is undoubtedly enlarging possiblities of using multiple platforms and reusingthem. Also, providing transformation from BPEL to ADORE is to give the first and importantstep for orchestrations composition to become automatic. And it can be an openning to ADOREdevelopers or users to use anything from BPEL in order to reuse its concepts or ideas.

To conclude this work, I must say that this training allowed me to improve my knowledge withdifferent new concepts and technolgies. It also allowed me to enhanced my computer science compe-tencies by working with a highly skilled team of computer science professionnals and by participatingin many discussions and meetings of the Faros project.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

30

Page 31: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Chapter 6

Annexe

6.1 Planning

Before concluding, next figure 6.1 represents a Gantt diagram of the project planning:

Figure 6.1: Project planification

6.2 Overview of WS-BPEL

6.2.1 Structure of a process

OASIS STANDARD provides this basic structure of a process [AAA+07]:

31

Page 32: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

<process name="NCName" targetNamespace="anyURI"queryLanguage="anyURI"?expressionLanguage="anyURI"?suppressJoinFailure="yes|no"?exitOnStandardFault="yes|no"?xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"><extensions>?

<extension namespace="anyURI" mustUnderstand="yes|no" />+</extensions><import namespace="anyURI"?

location="anyURI"?importType="anyURI" />*

<partnerLinks>?<!-- Note: At least one role must be specified. --><partnerLink name="NCName"

partnerLinkType="QName"myRole="NCName"?partnerRole="NCName"?initializePartnerRole="yes|no"?>+

</partnerLink></partnerLinks><messageExchanges>?<messageExchange name="NCName" />+

</messageExchanges><variables>?

<variable name="BPELVariableName"messageType="QName"?type="QName"?element="QName"?>+from-spec?

</variable></variables><correlationSets>?

<correlationSet name="NCName" properties="QName-list" />+</correlationSets><faultHandlers>?

<!-- Note: There must be at least one faultHandler --><catch faultName="QName"?

faultVariable="BPELVariableName"?( faultMessageType="QName" | faultElement="QName" )? >*

activity</catch><catchAll>?

activity</catchAll>

</faultHandlers>

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

32

Page 33: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

<eventHandlers>?<!-- Note: There must be at least one onEvent or onAlarm. --><onEvent partnerLink="NCName"

portType="QName"?operation="NCName"( messageType="QName" | element="QName" )?variable="BPELVariableName"?messageExchange="NCName"?>*<correlations>?

<correlation set="NCName" initiate="yes|join|no"? />+</correlations><fromParts>?

<fromPart part="NCName" toVariable="BPELVariableName" />+</fromParts><scope ...>...</scope>

</onEvent><onAlarm>*

<!-- Note: There must be at least one expression. -->(<for expressionLanguage="anyURI"?>duration-expr</for>|<until expressionLanguage="anyURI"?>deadline-expr</until>)?<repeatEvery expressionLanguage="anyURI"?>

duration-expr</repeatEvery>?<scope ...>...</scope>

</onAlarm></eventHandlers>activity

</process>}

6.2.2 BPEL activities

A WS-BPEL activity can be any of the following:

. <receive>

. <reply>

. <invoke>

. <assign>

. <throw>

. <exit>

. <wait>

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

33

Page 34: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

. <empty>

. <sequence>

. <if>

. <while>

. <repeatUntil>

. <forEach>

. <pick>

. <flow>

. <scope>

. <compensate>

. <compensateScope>

. <rethrow>

. <validate>

. <extensionActivity>

6.3 Transformation kermeta files

6.3.1 BPEL Visitor� �1 package ProcessModel2;

2

3 require kermeta

4 require "platform:/resource/MBPELBis/ProcessModel2.ecore"

5 using kermeta::standard

6

7 abstract class BPELVisitor

8 {

9 operation visitProcess (p: Process) : Void is abstract

10 operation visitInvoke (i: invoke) : Void is abstract

11 operation visitReceive (r: receive) : Void is abstract

12 operation visitFlow (f: flow) : Void is abstract

13 operation visitSequence (s: sequence) : Void is abstract

14 operation visitReply (r: reply) : Void is abstract

15 operation visitLink (l: link) : Void is abstract

16 }

17

18 abstract class VisitableElement

19 {

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

34

Page 35: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

20 operation accept(visitor : BPELVisitor) : Void is abstract

21 }

22

23 aspect abstract class Activity inherits VisitableElement{}

24

25

26 aspect class Process inherits VisitableElement

27 {

28 method accept(visitor : BPELVisitor) : Void is

29 do

30 visitor.visitProcess(self)

31 end

32 }

33

34 aspect class invoke inherits VisitableElement

35 {

36 method accept(visitor : BPELVisitor) : Void is

37

38 do

39 visitor.visitInvoke(self)

40 end

41 }

42

43 aspect class receive inherits VisitableElement

44 {

45 method accept(visitor :BPELVisitor) : Void is

46 do

47 visitor.visitReceive(self)

48 end

49 }

50

51 aspect class flow inherits VisitableElement

52 {

53 method accept(visitor : BPELVisitor) : Void is

54 do

55 visitor.visitFlow(self)

56 end

57 }

58

59 aspect class sequence inherits VisitableElement

60 {

61 method accept(visitor : BPELVisitor) : Void is

62 do

63 visitor.visitSequence(self)

64

65 end

66 }

67

68 aspect class receive inherits VisitableElement

69 {

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

35

Page 36: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

70 method accept(visitor : BPELVisitor) : Void is

71 do

72 visitor.visitReceive(self)

73 end

74 }

75

76 aspect class reply inherits VisitableElement

77 {

78 method accept(visitor : BPELVisitor) : Void is

79 do

80 visitor.visitReply(self)

81 end

82 }

83

84 aspect class link inherits VisitableElement

85 {

86 method accept(visitor : BPELVisitor) : Void is

87 do

88 visitor.visitLink(self)

89 end

90 }� �6.3.2 The Builder� �

1 package ProcessModel2;

2

3 require "platform:/resource/MBPELBis/Simulation/Adorelinkage.kmt"

4 require "platform:/resource/MBPELBis/Simulation/BPELVisitor.kmt"

5

6 require kermeta

7

8 using kermeta::standard

9

10

11 class ADOREBuilder inherits BPELVisitor

12 {

13 reference resultBehaviour: behaviour::Behaviour

14

15 operation getResultBehaviour() : behaviour::Behaviour is

16 do

17 result := resultBehaviour

18 end

19

20

21 method visitProcess(target : Process) : Void is

22 do

23 var resultElement : behaviour::Behaviour init behaviour::Behaviour.new

24 resultElement.name := String.clone(target.name)

25 target.generated := resultElement

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

36

Page 37: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

26 resultBehaviour:= resultElement

27

28 target.activity.accept(self)

29

30 end

31

32 method visitSequence(target : sequence) : Void is

33 do

34 var s : Integer init 0

35 s:=target.inorder.size()

36 target.inorder.each{s | s.accept(self)}

37

38 //stdio.writeln(target.inorder.at(0).initialElements().at(0).name)

39

40 from var i : Integer init 0

41 until i == s-1

42 loop

43

44 if target.inorder.at(i).finalElements().size == 1

45 then

46 var t: Integer init 0

47 t:=target.inorder.at(i+1).initialElements.size()

48

49 from var j: Integer init 0

50 until j == t

51 loop

52 var resultOrder : behaviour::OrderRelation init behaviour::OrderRelation

.new

53 resultBehaviour.order.add(resultOrder)

54 resultOrder.before:=target.inorder.at(i).finalElements().at(0).

abstractGenerated

55 resultOrder.after:=target.inorder.at(i+1).initialElements().at(j).

abstractGenerated

56

57 j:=j+1

58 end

59

60 else //target.inorder.at(i+1).initialElements().size == 1

61

62 var t: Integer init 0

63 t:=target.inorder.at(i).finalElements.size()

64

65 from var j: Integer init 0

66 until j == t

67 loop

68 var resultOrder : behaviour::OrderRelation init behaviour::OrderRelation.new

69 resultBehaviour.order.add(resultOrder)

70 resultOrder.before:=target.inorder.at(i).finalElements().at(j).

abstractGenerated

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

37

Page 38: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

71 resultOrder.after:=target.inorder.at(i+1).initialElements().at(0).

abstractGenerated

72 j:=j+1

73 end

74 end

75

76 i:=i+1

77 end

78

79 end

80

81 method visitFlow(target : flow) : Void is

82 do

83 target.inparallel.each{s|s.accept(self)}

84 target.links.each{s|s.accept(self)}

85 end

86

87 method visitInvoke(target : invoke) : Void is

88 do

89 var resultElement : behaviour::Invocation init behaviour::Invocation.new

90 resultElement.uid := String.clone(target.name)

91 target.abstractGenerated := resultElement

92 resultBehaviour.activity.add(resultElement)

93 end

94

95 method visitReceive(target : receive) : Void is

96 do

97 var resultElement : behaviour::Receive init behaviour::Receive.new

98 resultElement.uid := String.clone(target.name)

99 target.abstractGenerated := resultElement

100 resultBehaviour.activity.add(resultElement)

101 end

102

103 method visitReply(target : reply) : Void is

104 do

105 var resultElement : behaviour::Reply init behaviour::Reply.new

106 resultElement.uid := String.clone(target.name)

107 target.abstractGenerated := resultElement

108 resultBehaviour.activity.add(resultElement)

109 end

110

111 method visitLink(target : link) : Void is

112 do

113 var resultElement : behaviour::OrderRelation init behaviour::OrderRelation.new

114

115 target.generated := resultElement

116 resultBehaviour.order.add(resultElement)

117 target.generated.before :=target.source.abstractGenerated

118 target.generated.after:=target.istarget.abstractGenerated

119 end

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

38

Page 39: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

120 }� �6.3.3 Aspect adding� �

1 package ProcessModel2;

2

3 require "platform:/resource/MBPELBis/Simulation/BPELVisitor.kmt"

4 require "platform:/resource/MBPELBis/MADORE/behaviour.ecore"

5 require kermeta

6

7 using kermeta::standard

8

9 aspect class Process

10 {

11 reference generated : behaviour::Behaviour

12 }

13

14 aspect class Activity

15 {

16 reference abstractGenerated : behaviour::Activity

17

18 operation initialElements() : Sequence<Activity> is

19 do

20 result := Sequence<Activity>.new

21 result.add(self)

22 end

23

24 operation finalElements() : Sequence<Activity> is

25 do

26 result := Sequence<Activity>.new

27 result.add(self)

28 end

29 }

30 aspect class invoke

31 {

32

33 }

34

35 aspect class receive

36 {

37

38 }

39 aspect class flow

40 {

41 method initialElements() : Sequence<Activity> is

42 do

43 result := self.inparallel.select{ a | not self.links.exists{ l | l.istarget.equals(

a)}}

44 end

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

39

Page 40: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

45

46 method finalElements() : Sequence<Activity> is

47 do

48 result := self.inparallel.select{ a | not self.links.exists{ l | l.source.equals(a)}}

49 end

50

51 }

52 aspect class sequence

53 {

54 method initialElements() : Sequence<Activity> is

55 do

56 result := Sequence<Activity>.new

57 result.add(self.inorder.first)

58 end

59

60 method finalElements() : Sequence<Activity> is

61 do

62 result := Sequence<Activity>.new

63 result.add(self.inorder.last)

64 end

65 }

66 aspect class reply

67 {

68

69 }

70 aspect class link

71 {

72 reference generated : behaviour::OrderRelation

73 }� �6.3.4 Transformation main� �

1 @mainClass "ProcessModel2::Bpel2Adore"

2 @mainOperation "main"

3

4

5 package ProcessModel2;

6

7

8 require kermeta

9

10

11 require "platform:/resource/MBPELBis/Simulation/AdoreBuilder.kmt"

12 require "platform:/resource/MBPELBis/Simulation/Adorelinker.kmt"

13

14 using kermeta::standard

15 using kermeta::persistence

16

17

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

40

Page 41: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

18 class Bpel2Adore

19 {

20 reference process: Process

21 reference behaviour1: behaviour::Behaviour

22

23 operation transform(processModel : String, behaviour1Model : String) : Void is

24 do

25 loadProcessModel(processModel)

26

27 stdio.writeln(">>> Building the behaviour Model ... ")

28 var builder : ADOREBuilder init ADOREBuilder.new

29 process.accept(builder)

30 behaviour1 := builder.getResultBehaviour()

31 stdio.writeln("Done.")

32

33 stdio.writeln(">>> Linking the behaviour Model ... ")

34 var linker : Adorelinker init Adorelinker.new

35 process.accept(linker)

36 stdio.writeln("Done.")

37

38 savebehaviourModel(behaviour1Model)

39 end

40

41

42 // Helpers

43 operation loadProcessModel(processModel : String) : Void is

44 do

45 stdio.writeln(">>> Loading Process Model " + processModel )

46 var repository : EMFRepository init EMFRepository.new

47 var resource : EMFResource

48 resource ?= repository.getResource(processModel)

49 resource.load

50 process ?= resource.instances.one

51 end

52

53

54 operation savebehaviourModel(behaviour1Model : String) : Void is

55 do

56 stdio.writeln(">>> Saving behaviour model ... ")

57 var resourceToSave : Resource

58 var repository : EMFRepository init EMFRepository.new

59 resourceToSave := repository.createResource(behaviour1Model, "platform:/resource/

MBPELBis/MADORE/behaviour.ecore")

60 resourceToSave.add(behaviour1)

61 resourceToSave.save

62 stdio.writeln("Done.")

63 end

64

65

66 // Launcher

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

41

Page 42: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

67

68

69

70

71 operation main() : Void is

72

73 do

74

75 //var process : String init "platform:/resource/MBPELBis/Test2Process.xmi"

76 //var behaviour1 : String init "platform:/resource/MBPELBis/MADORE/TestProcess_Adore.

xmi"

77

78 //var process : String init "platform:/resource/MBPELBis/Test1Process.xmi"

79 //var behaviour1 : String init "platform:/resource/MBPELBis/MADORE/Test1Process_Adore.

xmi"

80

81 //var process : String init "platform:/resource/MBPELBis/Process3.xmi"

82 //var behaviour1 : String init "platform:/resource/MBPELBis/MADORE/Process3_Adore.xmi"

83

84 //var process : String init "platform:/resource/MBPELBis/Process4.xmi"

85 //var behaviour1 : String init "platform:/resource/MBPELBis/MADORE/Process4_Adore.xmi"

86

87

88 //var process : String init "platform:/resource/MBPELBis/Process5.xmi"

89 //var behaviour1 : String init "platform:/resource/MBPELBis/MADORE/Process5_Adore.xmi"

90

91 transform(process, behaviour1)

92 end

93 }� �

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

42

Page 43: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Bibliography

[AAA+07] Alexandre Alves, Assaf Arkin, Sid Askary, Charlton Barreto, Ben Bloch, Fran-cisco Curbera, Mark Ford, Yaron Goland, Neelakantan Guzar, Alejandroand Kartha,Canyang Kevin Liu, Rania Khalaf, Dieter Knig, Mike Marin, Vinkesh Mehta, SatishThatte, Danny van der Rijn, Prasad Yendluri, and Alex Yiu. Web services businessprocess execution language version 2.0. Technical report, OASIS, 2007.

[BCF+05] Olivier Barais, Franck Chauvel, Franck Fleurey, Cyril Faucher Jean-Marc JezequelJean-Marie Mottu, Pierre-Alain Muller, Jim Steel, Fraois Tanguy, David Touzet, andDidier Vojtisek. Kernel metamodeling. Technical report, INRIA, 2005.

[DFF+08] Zo Drey, Cyril Faucher, Franck Fleurey, Vincent Mah, and Didier Vojtisek. Kermetalanguage, reference manual. Technical report, 2008.

[GJHM94] Erich Gamma, Ralph Johnson, Richard Helm, and John M.Vlissides. Design Pat-terns: Elements of Reusable Object Oriented Software. Addison-Wesley Professional,November 1994. ISBN-10: 0201633612 ISBN-13: 978-0201633610.

[Leh96] M. M. Lehman. Laws of software evolution revisited. In EWSPT ’96: Proceedings ofthe 5th European Workshop on Software Process Technology, pages 108–124, London,UK, 1996. Springer-Verlag.

[LMBBF+06] Anne-Francoise Le Meur, Fabien Balligand, Mireille Blay-Fornarino, Philippe Collet,and Nicolas Rivierre. Chapitre Service dans Livrable Faros: Etat de l’art sur lacontractualisation et composition. Technical report, October 2006.

[MBFR08] Sebastien Mosser, Mireille Blay-Fornarino, and Michel Riveill. Web Services Orches-tration Evolution : A Merge Process For Behavioral Evolution. In 2nd EuropeanConference on Software Architecture (ECSA’08), Paphos, Cyprus, September 2008.Springer LNCS.

[Mig05] Antony Miguel. Ws-bpel 2.0 tutorial. Technical report, 2005.

[MLM+06] Matthew MacKenzie, Ken Laskey, Francis McCabe, Peter Brown, and Rebekah Metz.Reference Model for Service Oriented Architecture 1.0. Technical Report wd-soa-rm-cd1, OASIS, February 2006.

[Mos07] Sebastien Mosser. Motifs d’Orchestrations : vers une evolution par fusion. Master’sthesis, EPU Polytech’Sophia, Sophia Antipolis, September 2007.

43

Page 44: Model Driven orchestration Composition Master thesisnyx.unice.fr/publis/hammouche:2008.pdf · HAMMOUCHE Douae Directed by: Prs MOULINE Salma, FREDJ Mounia and BLAY-FORNARINO Mireille

Model driven orchestration composition Master Info Telecom

[MWD+05] Tom Mens, Michel Wermelinger, Stephane Ducasse, Serge Demeyer, RobertHirschfeld, and Mehdi Jazayeri. Challenges in software evolution. In IWPSE ’05:Proceedings of the Eighth International Workshop on Principles of Software Evolu-tion, pages 13–22, Washington, DC, USA, 2005. IEEE Computer Society.

[Pel03] Chris Peltz. Web services orchestration and choreography. Computer, 36(10):46–52,2003.

[W3C04] W3C. Web service glossary. Technical report, 2004.

University Mohammed V, Agdal Sciences FacultyDouae HAMMOUCHE

44