Viewpoints in Papyrus

Introduction

Viewpoints in Papyrus enable the specialization and customization of the user experience by constraining what can be seen and interacted with in Papyrus diagrams and tables. Viewpoints can be used for the following purposes in Papyrus:

Configuration Options for Viewpoints

At any given time, there can only be one viewpoint that is currently applied to an Eclipse instance. Users are free to select any viewpoint that is provided to them. Papyrus itself comes with a default viewpoint that is automatically selected when to other viewpoint is specified.

All the viewpoints-related configuration options available to the users are provided in the Papyrus > Viewpoints Configuration preference page of Eclipse:

The first available option is the Configuration selection. It determines how the current viewpoint is selected. The possible options are:

In the case where multiple viewpoints are available through the current configuration options as explained above the specific viewpoint to be applied can be chosen through the two drop-down lists:

In addition, the checkbox Multiplicity can be activated so that at most one diagram or table of the each kind defined in the applied viewpoint can be created for each model element. For example, at most one class diagram per package, etc.

It is possible at any time to see the details of the diagrams and tables offered by the currently used viewpoint in the Viewpoint Explorer view in Eclipse. This view is available in Window > Show View > Other, and then selecting Papyrus > Viewpoint Explorer.

This view summarizes the currently available diagrams and tables, as well as the conditions for their availability.

The application of a viewpoint has some impacts on the following UI elements in Papyrus:

Definition of New Viewpoints

Papyrus supports the definition of new viewpoints that can subsequently be used by selecting them in the Papyrus Viewpoints preference panel, as presented above. Papyrus viewpoints are defined in configuration files with the �.configuration� extension. They are really just an ECore model that can be edited with the specialized viewpoint configuration editor provided by Papyrus.

Basic Concepts

Viewpoints in Papyrus are implemented as an extension to the ISO 42010 standard for architecture description framework. Hence many concepts presented here are derived from those presented in the ISO 42010 standard. However, the standard has been extended with Papyrus-specific concepts and properties.

Walkthrough

The definition of a new viewpoint in Papyrus starts with the creation of a new configuration file: Viewpoint s configuration in the Papyrus folder of the Eclipse new element creation dialog. The top element of the file should be a Papyrus Configuration element.

Step 1: Select the metamodel that is applicable to this configuration. Generally, this should be UML. The metamodel is selected as the metamodel property of the Papyrus Configuration root element. The drop-down value selection is automatically filled with the currently metamodel currently loaded in Eclipse. For UML select, " http://www.eclipse.org/uml2/5.0.0/UML".

Step 2: Add the basic elements. The setting of the elements below is required for the configuration to work correctly.

Notes:

Step 3: Complete the viewpoint with new diagrams and tables. Those elements can be added by right clicking on the viewpoint element, in the New child menu. Refer to the sections below for more information on the specification of diagrams and tables.

Step 4: Deploy the configuration. The new configuration file can be deployed in an Eclipse plugin and registered through an extension point. The extension point to use is org.eclipse.papyrus.infra.viewpoints.policy.custom. It comes in two flavors that are the possible child elements for it:

Diagram Specification

A diagram has the following attributes:

Implementation ID Description
PapyrusUMLActivityDiagram UML Activity Diagram
PapyrusUMLClassDiagram UML Class Diagram
PapyrusUMLCommunicationDiagram UML Communication Diagram
PapyrusUMLComponentDiagram UML Component Diagram
CompositeStructure UML Composite Diagram
PapyrusUMLDeploymentDiagram UML Deployment Diagram
PapyrusUMLProfileDiagram UML Profile Diagram
PapyrusUMLSequenceDiagram UML Sequence Diagram
PapyrusUMLStateMachineDiagram UML State Machine Diagram
PapyrusUMLTimingDiagram UML Timing Diagram
UseCase UML Use Case Diagram
PapyrusUMLInteractionOverviewDiagram UML Interaction Overview Diagram
BlockDefinition SysML Block Definition Diagram
InternalBlock SysML Internal Block Diagram
Parametric SysML Parametric Diagram
RequirementDiagram SysML Requirements Diagram

Once a diagram has been created it is possible to constraint it using rules. There are four kinds of rules:

Each rule has a permit property that specify whether the rule authorizes or forbids the action it represents. Otherwise, the properties of the rules are as follow:

The minimal required rules for a diagram specification to work are: