Exercise 5.7 - Creating Custom SysML-DOORS NG Mappings.

Objectives

The new learning objective of this exercise is to create new SysML_DOORS NG mappings for Model Transform connections. This is intended for an advanced user who will create new mappings that will be used by other members of the organization.

Preparation

This exercise assumes the student has

  • IBM Rational Rhapsody 8.2 installed correctly on his or her machine with a valid license for use, and

  • Syndeia 3.3 installed as a plugin for Rhapsody with a valid license for use

  • Syndeia DOORS NG interface, correctly installed with a valid license for user.

The user can use any DOORS NG repository they have available with the ability to create and edit elements within a DOORS project. This exercise's instructions uses DOORS artifacts and projects that we have available, but you will need to modify them to work with yours. Complete Exercise 5.6 on adding DOORS artifacts to the Model Types list first. It is generally advisable to carry out these exercises in a non-production repository, a "sandbox", set up for training and practice purposes.

We recommend that the student view the videos 1.6, 1.7, and 1.8 in the Introduction Section of the Syndeia training materials before attempting this exercise. These videos provide important background on creating custom mappings. Hands-on tutorials omit much of the logic behind the actions in the interest of clarity and brevity.
We will use the Rhapsody project Syndeia_DNG_Mapping_Tutorial.rpy (Get it here - SysML Models, Profiles and Mappings.) provided with the tutorials for this exercise, which loads the profile Syndeia_Mappings_Tutorial_Profile.sbs. We also use the syndeia34TutorialRhp.mappings file provided, which has been installed in the .syndeia folder and renamed as syndeia.mappings.
Any Syndeia user can use or view the mapping specifications, but Syndeia requires a special license in addition to the regular Syndeia license in order to create, modify or delete mapping information. It is good practice to confine this duty to a very limited number of experienced users or system administrators, who will provide mappings for the general users.

Exercise

  1. If not still open from the previous exercise, open the SysML project Syndeia_DNG_Mapping_Tutorial.rpy (Get it here - SysML Models, Profiles and Mappings.), right-click the DOORS_NG_Mapping package, and launch the Syndeia dashboard. Select a Syndeia Cloud project, if necessary.

  2. Go to the Mappings tab. This exercise assumes you created a DNG artifact type Requirement (UAV) in the previous exercise.

  3. The first task will be to create a new mapping using this artifact type.

    1. Right-click SysML-DOORS NG under Mapping Groups in the left column and select Add Mapping.

    2. Edit the Mapping characteristics

      1. Change Name to Reqt - Reqt (UAV) no attributes.

      2. Change Description to SysML Reqt - DOORS Reqt (UAV) with no attributes.

      3. Change Source Artifact Type to Requirement, using pull-down menu

      4. Set Target Artifact Type to Requirement (UAV), using pull-down menu

      5. Set Structure Level to NO_CHILDREN, using pull-down menu

      6. Set Include Attributes to Exclude Attributes, using pull-down menu

      7. Click Save Mapping at bottom.

      8. The window should look similar to Figure 1.

        Figure 1 Syndeia dashboard, Mappings tab, Adding Mapping to SysML-DOORS NG Mapping Group

  4. Use the new Mapping you just created

    1. Go to the Connection Manager tab. Open your SysML model in the left column and yours DOORS NG repository in the right column. Select Model Transform in the center.

    2. Drag the Reqt_Environmental requirement in the SysML model into a project or folder in DOORS NG (Custom Transforms in this example).

    3. A small pull-down menu will appear on the Syndeia dashboard, as Figure 2, showing the possible mappings available for a SysML requirement dragged into DOORS NG.

      Figure 2 Connection Manager while creating new DOORS NG Collection with new mapping

    4. Select Reqt – Reqt (UAV) no attributes and click OK. Expand the destination folder (Custom Transform in our example) on the right side of the Connection Manager. Check that a new DOORS NG requirement has been created.
      Note: other mapping options might be available but might not work properly with the Unmanned Aerial Vehicle project. As stated in Exercise 5.6, it is good practice to confine the DOORS model types and mappings to a DOORS NG project within a specific mappings file.

  5. The next task is to create another new mapping, this one with attributes shared between the SysML and DOORS NG elements. We will use the Clone Mapping command rather Add Mapping. Clone Mapping saves time when not all features of the new mapping need to be modified.

    1. Right-click Reqt – Reqt (UAV) no attributes under Mapping Groups/SysML – DOORS NG in the left column and select Clone Mapping

    2. Initially, the window should appear similar to Figure 3.

      Figure 3 Syndeia dashboard, Mappings tab, cloning a mapping in the SysML-DOORS NG Mapping Group

    3. Modify the Mapping

      1. Change Name to Reqt - Reqt (UAV) attributes.

      2. Change Description to SysML Reqt - DOORS Reqt Spec (UAV) with attributes.

      3. Keep Source Artifact Type as Requirement and Target Artifact Type as Requirement (UAV).

      4. Set Structure Level to CHILDREN_RECURSIVE, using pull-down menu.

      5. Set Include Attributes to Include Attributes, using pull-down menu

      6. Click the plus sign box under the Stereotypes table.

      7. A Select stereotype window will open. The window should look similar to Figure 4. Expand Syndeia Mapping Tutorial – Custom Stereotypes, select DOORS_NG_Requirement and click OK. This choice will appear in the Stereotypes box.

        Figure 4 Syndeia dashboard, Mappings tab, modifying the cloned mapping, part 1

      8. Click the Retrieve Available Attribute Definitions button below the Attribute Definition Mappings table.

      9. Click the plus box below the Attribute Definition Mappings table.

      10. In the new row, select Identifier on the right (Target) side of the table, using the pull-down menu

      11. In the new row, select Id [owner: Stereotype (Requirement)] on the left (Source) side of the table.

      12. Repeat steps ix through xi for Primary Text and Created On. The final table should look like Figure 5.

        Figure 5 Syndeia dashboard, Mappings tab, modifying the cloned mapping, part 2

      13. Click Save Mapping at bottom of right side.

  6. Use the cloned Mapping you just created

    1. Go to the Connection Manager tab. Open the DOORS NG repository you used above in the right column.

    2. Drag the Reqt_Environmental DOORS NG created earlier into the empty SysML DNG4 package.

    3. A small pull-down menu will appear on the Syndeia dashboard, as in Figure 6, showing the possible mappings available for a collection dragged into SysML.

    4. Select Reqt – Reqt (UAV) attributes and click OK.

      Figure 6 Connection Manager while creating new SysML Requirement with cloned mapping

  7. A new requirements hierarchy should appear under DNG4 on the SysML side. It will have the <<DOORS_Requirement>> stereotype in addition to <<requirement>> and all the tag values associated with those stereotypes (see Figure 7).

    Figure 7  New SysML requirement created by cloned mapping

  8. Edit the Reqt_Environmental SysML requirement in package DNG4 by adding a string (e.g. The system shall be greater than 95% recyclable) to the requirement Text (see Figure 7). Return to the Syndeia dashboard, Connection Browser tab, and find the connection between DNG4::Reqt_Environmental and the 2089 – Reqt_Environmental requirement in DOORS. Right-click and select Compare Source & Target. The Comparison Result shows the added text on the SysML side in red.

  9. On the same connection, select Sync Source -> Target. The comparison results now should show the SysML text transformed to the Primary Text on the DOORS NG side.