DSML-Based Customization with �Eclipse Papyrus 3.0
A guide to customizing Papyrus for specific domains
Nicolas Hili
About Me
2
About this Presentation
3
About this presentation (cont’d)
4
Context
Objective: Tailoring UML to your own needs
Why using Eclipse Papyrus?
5
“Don’t reinvent the wheel, adopt UML instead, but tailor it to your’’
�Papyrus User Guide Series:
About UML profiling, version 1.0.0
Agenda
6
Papyrus
7
Papyrus Main Features
8
Model execution�with Moka
Fully customizable environment�with Papyrus Toolsmith
UML Modeling
Code generation�with Papyrus Designer
Source: https://www.eclipse.org/papyrus/
Downloading Papyrus
To download Papyrus: https://www.eclipse.org/papyrus/download.html
9
Overview of Papyrus
10
Model explorer
Project explorer
Graphical editor
Property menu
Tabbed diagrams
UML Profiles
11
“A stereotype defines how an existing metaclass may be extended, and enables the use of platform or domain specific
terminology or notation in place of, or in addition to, the ones used for the extended metaclass.’’
�OMG Unified Modeling Language TM (OMG UML)�Specification v 2.5
UML Profiles (cont’d)
12
extension
generalization
OCL constraint
isRequired attribute
UML Profile definition
13
Profile application
Once a profile has been defined, it can be applied to a model
14
Stereotype applications and validation of constraints
15
self.base_UseCase.ownedBehavior->selectByType(Interaction)�->forAll(interaction | interaction.message->includes(self.trigger))
Quick Way for Testing OCL Constraints
16
OCL interactive console
“self” designates the currently selected element (diagram/model explorer)
Options to configure
Agenda
17
Papyrus
Not only a UML2 editor but a fully customizable platform
18
Adapting Papyrus for a Specific Domain
19
Kind of adaptations
Adapt the�semantics of UML
Shorten “Workflows”
Hide elements
Where to Adapt? Example with UML-RT
20
Where to Adapt? Example with UML-RT
21
Papyrus for Toolsmiths
Papyrus for Toolsmiths
Important note about the version
What impact?
22
ISO42010 definition Architecture Description
Papyrus Architecture Model in a Nutshell
23
Source: https://wiki.eclipse.org/Papyrus/Oxygen_Work_Description/NewFeature/PapyrusAFViewpointSwitch
Main difference between �Papyrus 2 and 3:
⚠ Still a proposal -> under development -> everything not implemented yet
Architecture Model: Example
24
Viewpoint
ADL
Representation kind
Creation rules
Palette rules
Diagram style
Palette ID
Domain
Architecture Model: A lot of Potential for Extensibility
Papyrus allows for merging architecture models:
25
Papyrus Customization: the Process
26
«step 1»�Define your domain
myDSL.profile.uml
«step 4»�Customize the UI
myDSL.architecture
myDSL.paletteconfiguration
myDSL.ctx
myDSL.creationmenumodel
«step 2»�Define your viewpoints, stakeholders, etc.
«step 2a»�Generate EMF code
«step 2b»�Generate validation plugin
«step 3»�Define your representations
myDSL.style
myDSL.elementtypesconfig
myDSL.genmodel
myDSL.ecore
java
java
java
java
java
java
Papyrus Customization: the Process
27
«step 1»�Define your domain
myDSL.profile.uml
«step 4»�Customize the UI
myDSL.architecture
myDSL.paletteconfiguration
myDSL.ctx
myDSL.creationmenumodel
«step 2»�Define your viewpoints, stakeholders, etc.
«step 2a»�Generate EMF code
«step 2b»�Generate validation plugin
«step 3»�Define your representations
myDSL.style
myDSL.elementtypesconfig
myDSL.genmodel
myDSL.ecore
java
java
java
java
java
java
Step 1: Define your Domain: Example with HOE2
28
Highly Heterogeneous Object Oriented Efficient Engineering (HOE2):
In HOE2, requirements of a System are captured in a �requirement model where:
Step 1: Define your Domain: Example with HOE2 (cont’d)
29
In HOE2, a requirement model have a set of constraints:�
Papyrus Customization: the Process
30
«step 1»�Define your domain
myDSL.profile.uml
«step 4»�Customize the UI
myDSL.architecture
myDSL.paletteconfiguration
myDSL.ctx
myDSL.creationmenumodel
«step 2»�Define your viewpoints, stakeholders, etc.
«step 2a»�Generate EMF code
«step 2b»�Generate validation plugin
«step 3»�Define your representations
myDSL.style
myDSL.elementtypesconfig
myDSL.genmodel
myDSL.ecore
java
java
java
java
java
java
Step 2: Define your viewpoints, stakeholders, etc.
31
<extension
point="org.eclipse.papyrus.infra.architecture.models">
<model
path="resource/architecture/hoe2.architecture">
</model>
</extension>
Step 2: Define your viewpoints, stakeholders (cont’d)
32
Papyrus Customization: the Process
33
«step 1»�Define your domain
myDSL.profile.uml
«step 4»�Customize the UI
myDSL.architecture
myDSL.paletteconfiguration
myDSL.ctx
myDSL.creationmenumodel
«step 2»�Define your viewpoints, stakeholders, etc.
«step 2a»�Generate EMF code
«step 2b»�Generate validation plugin
«step 3»�Define your representations
myDSL.style
myDSL.elementtypesconfig
myDSL.genmodel
myDSL.ecore
java
java
java
java
java
java
Step 3: Adding CSS stylesheet
34
Current Result
35
Thank You