Import Export of ReqIF elements into Papyrus

This model explains the functionality in Papyrus Req in order to import or export ReqIF files into Papyrus (OMG Document Number: formal/2013-10-01 Standard document URL: http://www.omg.org/spec/ReqIF/1.1)

Table of Contents

Requirements

- ReqIfImport (id=ReqIF_001): 
Darwin shall allow importation of Reqif elements to SysML Model
- Import SpecObjects (id=ReqIF_001_001): 
The user shall be able to import spec object
- Two  Kind of Users (id=ReqIF_001_002): 
The simple User can only import SpecObject by choosing domain. The AdvancedUser can import Types and DataTypes.
- Import DataType Enumeration (id=ReqIF_001_003): 
The advanced user shall be able to import DataType and enumeration
- Import SpecObjectTypes (id=ReqIF_001_004): 
The advanced user shall be able to import specObjectType
- Import SpecRelationType (id=ReqIF_001_005): 
The advanced user shall be able to import SpecRelationType
- Import SpecRelation (id=ReqIF_001_006): 
Papyrus Req shall import SpecRelation
- ReqIFExport (id=ReqIF_002): 
Darwin shall enable export of SysML requirement to ReqIF Model
- ControlMode (id=ReqIF_003): 
The managment with ReqIf must support Control Mode
- WihtoutUI (id=ReqIF_004): 
The export can be done programmatically, without GUI, in order to test it, or to be enable to pilot it programmatically
- Re-Export (id=ReqIF_005): 
Papyrus shall re-export requirements in existing reqIF file
- Re-Import (id=ReqIF_006): 
Papyrus shall re-Import requirement from a ReqIF file

Use Cases

UseCases

UseCases Diagram


ReqIfModule

Import ReqIF file

In order to import ReqFile into UMLModel, first analysis will be done:

- All existing SpecObjectTypes will be listed. From the list, the user chooses interesting Types. (In fact types may be purely information as title, chapter...)
- All stereotypes from applied profiles will be also listed.
Because each SpecType becomes a stereotype based on Requirement, if the two lists are equals no stereotypes will be created.

Import

Import Activity


If stereotypes need to be created, a dialog is opened  in order to ask to the user if a profile must be created.

After importing types, elements of ReqIF file are imported
Before import requirement fro ReqIF file, the kinf of User has to be verified.


There are two kind of users:

- Simple User: he can only import instance of requirements inside the Papyrus tool.

- Advancerd User: he can importe new types of requirements and instance of requirement inside the Papyrus tool

To verify it, go to window--> preferences--> Papyrus--> ReqIF Import

Two

Two kinds of user


When the current user is a "Simple User", he can only import instances of requirements by choosen predefined types contained in the profile.

If the profile does not contain all needed types, the import is not done and a message is displayed on the screen.

Choose

Choose predefined type contained in profile


The

The import cannot be done if the profile is not complete.


How to
First the User must have a SysML model. Select the package where ReqIF elements will be imported.

Import

Import SysMLModel


Select the menu Import  of Eclipse.

Select

Select import Menu of Eclipse


Select the menu Import ReqIF from Papyrus Categories

Import

Import ReqIF


Select the ReqIF file to import

ReqIF

ReqIF file Selection


Select Types of ReqIFElement that you want to import

SpecObject

SpecObject Type selection


When the current user is an "Advanced User", he can import Requirement types and all requirements from ReqIF , if needed he can select or create the profile that will contain imported types

Create

Create or select Profile


The model has now imported requirements with relations. Note that a comment explains the origin of the import.

Resulted

Resulted model


Import DataType Enumeration

Each Datatype Definition  Enumeration in a ReqFIle is transformed to UML Eneumeration in a profile.

Import SpecObjectTypes

Each SpecObjectType choosen in the ReqIFile is transformed to stereotype that inherits of SysML Requirement in a profile.

Each SpecRelationType of the ReqIF file is transformed in to Stereotype based on dependency Metaclass.
Each attribute is transformed to equivalent attribute in Stereotype. Only XTML attributes are transformed into String typed attributes in profile.

Import SpecObjects

Each SpecObjectNode is transformed to class with a corresponded applied stereotype. During the creation, SpecHierarchy ared used in order to structure the SysML files.

Each Specification becomes a package.
Each SpecRelation becomes a stereotyped dependency. if the souce or target of this object are not created, the spec relation will be not imported.

Export UML Model to ReqIF File

The goal is to export all requirements and links into ReqIF.

To do that, the tool lists all applied stereotypes that inherits of SysML::Requirement and that inherits of dependencies.
From this list, the tool constructs, in ReqIF File, correponding specObjects Tyoes and SpecRelationsTypes
Then from all stereotyped elements, it constructs the corresponding hierarchy.

Export

Export Activity


How to
Select the SysML that you want to export

SysML

SysML Model


Select the export Menu from Eclipse menu.

Export

Export Menu


Select the menu export ReqIF form the papyrus Category

Import

Import ReqIF file


Choose the name of the reqif file.

Choose

Choose ReqIF File name


At the end, a reqFile is generated. The header has an information that explain that the result comes from UML file.

Result

Result in the ReqIf file


export DataType

In a reqFile, all basic types must be created; that is why data type definition string, integer, Real, boolean and XHTML are created.

Moreover, all Enumerations in applied profiles become DataTypeDefinitionEnumerations in the ReqIF file.

Export Stereotypes

From all stereotypes, all SpecObject Types and all SpecRelationTypes will be created. If an attribute of a stereotype is typed by a primitiveType named XHTML, the attribute of the SpecObjecType will be XHTML. 

Export Stereotyped Elements

From all packages that contains Requirements, a specification will be created. Then a hierarchy will be created by taking in account the structure of requirements. Finally SpecObject and SpecRelation are created.

Re-Import

When a ReqIfile has been already imported, Papyrus shall update contents during Re-import

Re-Export

When a UML model has been already exported, PapyrusReq must only update the content of the file.

Adavanced ReqIFile Import

Import SpecRelation

ImportspecRelationType

Design

Architecture

Architecture of ReqIF Import-Export


The architecture is quite simple. There are wizard for import and export,  two classes to realize the job and differents assistants or dialogs.

Nevertheless, two layers can be distinguished in the code:
- one layer independent of the papyrus
- one layer called integration dependent of papyrus.
Efforts have been made to be more independant of papyurs in order to facilitate the maintenance of the algorithm for import export.
The layer integration contains specializations to create elements by using service edit or use some facilities as advanced dialog.

com.cea.darwin.reqif

independant of Papyrus

assistant

ReqIFNewFilePage
ReqIFSelectionPage
CreateOrSelectProfileDialog

integration

assistant
AbstractWizardForPapyrus
ChooseReqIFTypeDialog
ReqIFImportWizard
ReqIFExportWizard
transformation
ReqIFImporterServiceEdit
command
DefineProfileCommand

transformation

ReqIFImporter
ReqIFBaseTransformation
ReqIFExporter

Tests

TestImport

The goal is to test the import of a reIF file

TestExport

Requirements Coverage

RequirementsCoverageTable
IdSatisfy byVerify by
ReqIF_001
Import ReqIF file,
Import DataType Enumeration,
Import SpecObjects,
Import SpecObjectTypes
ReqIF_001_001
ReqIF_001_002
ReqIF_001_003
ReqIF_001_004
ReqIF_001_005
ReqIF_001_006
ReqIF_002
export DataType,
Export UML Model to ReqIF File,
Export Stereotypes,
Export Stereotyped Elements
ReqIF_003
ReqIF_004
ReqIF_005
Re-Export
ReqIF_006
Re-Import
Unsatisfied requirements (8 out of 12) : 
ReqIF_001_001, ReqIF_001_002, ReqIF_001_003, ReqIF_001_004, ReqIF_001_005, ReqIF_001_006, ReqIF_003, ReqIF_004
Unverified requirements (12 out of 12) : 
ReqIF_001, ReqIF_001_001, ReqIF_001_002, ReqIF_001_003, ReqIF_001_004, ReqIF_001_005, ReqIF_001_006, ReqIF_002, ReqIF_003, ReqIF_004, ReqIF_005, ReqIF_006