Exercise 5.6 - Adding SysML-DOORS NG Artifact Types.

Exercise 5.6 - Adding SysML-DOORS NG Artifact Types.

Objectives

The new learning objective of this exercise is to add additional DOORS NG artifacts for creating new mappings for Model Transform connections. These can be standard DOORS NG element types or user-defined element types.

Preparation

This exercise assumes the student has

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

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

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

  • Syndeia Mappings license, to modify syndeia.mappings file from the Syndeia dashboard (without the special mappings license, existing mappings can be used, but not modified)

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 assumes that the DOORS artifacts provided are compatible with your DOORS NG project. Otherwise, review Exercise 5.7 on adding DOORS artifacts to the Model Types list. 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.rpyx (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 syndeia_tutorial_rhp.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.

Special Note on Rhapsody SysML Stereotypes

As demonstrated below, some mappings require special SysML stereotypes so that the SysML element involved in the mapping has tag value slots for the attributes to be mapped. In this exercise, you will use stereotypes from the Syndeia_Mappings_Tutorial_Profile.sbs which should be loaded automatically with the model. However, in your own work, you can create stereotypes as needed and add them to your SysML model, either individually or as a profile. See the documentation for your SysML tool for instructions. Three issues to keep in mind are

  1. It is critical to remember that the mapping recognizes the stereotype by its ID, not its name. If the stereotype ID in the model is not the same as in the mapping, the mapping will not function as intended. The easiest way to avoid problems is to distribute the mappings file and the SysML profile as a pair which has been tested to ensure that the IDs match for the users.

  2. A special case in Rhapsody is the Requirement artifact. Because Rhapsody does not have a special stereotype for Requirement, it is necessary to add the standard attributes of ID and Text to the artifact specification in Syndeia in order for these attributes to be available for custom mappings. In order to add these, start by creating a SysML artifact type as shown in Figure 1. Then right-click on this artifact type and choose Add/Edit Attribute Definition. In the new table (Figure 2), use the plus key to add the ID and Text attributes to the Requirement artifact specification.

    Figure 1 Rhapsody SysML Requirement artifact type in Syndeia


    Figure 2 Adding ID and Text artifact attributes to Requirement definition

  3. In defining custom stereotypes in Rhapsody, specify all the artifact types to which it can be applied, using the Applicable to: pull-down menu as shown in Figure 3. With Rhapsody, Requirement does not extend Class, so it must be included separately in the specification in order for the custom mapping examples shown in these tutorials to work.

    Figure 3 Features window for Rhapsody stereotypes

Special Note on DOORS NG Artifact Types

  1. Model transforms from SysML to DOORS NG are complicated by a special feature of DOORS NG. DOORS NG artifact types are registered on a project-by-project basis. It is only possible for Syndeia to create a new artifact in a DOORS NG project if that project already recognizes that artifact type and the user has permission to create new artifacts in that project.

    Because of this feature, the user may need to modify the instructions for the following exercise to accommodate the specific DOORS NG project available, with its artifact types and user permissions, and complete the exercise.

  2. In particular, artifact attribute ID's are project-specific. Artifacts in two different projects with the same name will have different attribute ID's and attribute mappings will not transfer.

  3. To discover what artifact types are already available in a specific DOORS NG project, the user can

    1. open DOORS NG in a web browser

    2. navigate to the desired project (Figure 4), click the Administration icon in the upper right corner, and select Manage Project Properties.

      Figure 4 DOORS NG dashboard, Administration icon (Gear), Manage Project Properties

    3. The available artifact types for this project (Sandbox in our example) are shown in the column on the left. If we select one of the artifact types, the Default artifact format field shows us what generic type of artifact it is (Figure 5).

      Figure 5 DOORS NG dashboard, Default artifact format = Text

  4. Syndeia can only handle default artifact formats of Text and Collection. DOORS NG artifacts having other formats, such as Diagram or Module, cannot be created in DOORS NG by Syndeia using model transforms.

Exercise

  1. 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 project, if required.

  2. Go to the Mappings tab.

    The first task will be to make a new DOORS NG artifact type available for mapping.

    1. Select DOORS NG under Model Types in the left column.

    2. Initially, the window should appear similar to Figure 6, with no existing DOORS NG artifact types and no relation types available.

      Warning: As discussed in the section "Special Note on DOORS NG Artifact Types", DOORS_NG artifact types are specific to an individual DOORS NG project. It is unlikely that the artifacts available to you in your project will be identical to those used in the following example, so you will need to modify these instructions to use the artifacts available in your project to successfully complete the exercise.

    3. Figure 6 Syndeia dashboard, Mappings tab, showing available DOORS NG artifact types

      Figure 6 Syndeia dashboard, Mappings tab, showing available DOORS NG artifact types

      1. Add a new DOORS NG artifact type.

      2. Right-click DOORS_NG under Model Types and select Add Artifact Type.

      3. A new window appears, Add DOORS_NG Artifact Type

      4. Select the DOORS_NG Repository that you will be working with, using the pull-down menu (DOORSNG 6.0.2 @ Intercax in our example). It may be necessary to actively select items from pull-down menus, instead of leaving the default choice without selecting it.

      5. Select a Project in that repository, using the pull-down menu (Unmanned Aerial Vehicle in our example)

      6. Choose Resource Format as either Text or Collection, using the pull-down menu (Text in our example)

      7. Click the Get DOORS NG-Artifacts Types button.

      8. Select the artifact type to be added from the pull-down menu under Types (Requirement in our example)

      9. ID, Type, Name and Description fields will be populated, as shown in Figure 7. Name and Description should be modified to indicate the DOORS NG project to which they belong.

        Figure 7 Add DOORS_NG Artifact Type window

  3. Specify the DNG artifact attributes to be available for mapping

    1. Near the center of the window, click the Retrieve DOORS-NG Artifact Type Properties button.

    2. The table Add attribute definitions… will be populated, as Figure 8.

    3. Select the Requirement (UAV) attributes you want to be available for mapping in the leftmost column (or click the Select All button) and click OK.

      Figure 8  Add DOORS _NG Artifact Type window, lower half