Exercise 7.6 - Adding SysML-Jama Artifact Types.
Objectives
The new learning objective of this exercise is to add additional Jama artifacts for creating new mappings for Data Map and Model Transform connections. These can be standard Jama 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 Jama interface, correctly installed with a valid license for user.
The user can use any Jama repository they have available with the ability to create and edit model elements within a Jama model. It is generally advisable to carry out these exercises in a non-production repository, a "sandbox", set up for training and practice purposes.
We will use the Rhapsody project Syndeia_Jama_Mapping_Tutorial.rpyx (Get it here - https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330111792) 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.
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.
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
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.
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
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. Similarly, ActivityDiagram is necessary to apply stereotypes to activities.
Figure 3 Features window for Rhapsody stereotypes
Exercise
Open the SysML project Syndeia_Jama_Mapping_Tutorial.rpyx (Get it here - https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330111792), right-click the Jama_Mapping package, and launch the Syndeia dashboard. Select a Syndeia project if necessary
Go to the Mappings tab. The first task will be to make a new Jama artifact type available for mapping.
Select Jama under Model Types in the left column.
Initially, the window should appear similar to Figure 4, with three existing Jama artifact types and one Jama Relationship type already available.
Figure 4 Syndeia dashboard, Mappings tab, showing available Jama artifact types
Add new Jama artifact type.
Right-click Model Types: Jama in left column and select Add Artifact Type.
A new window appears, Add Jama Artifact Type
Choose the correct Jama Repository, using the pull-down menu.
Click the Get Jama Item Types button
Use the pull-down menu under Item Types to view all the Jama artifact types Syndeia can find.
Select Failure Mode, assuming your Jama repository includes this artifact type (if not, select another new Jama artifact type)
ID, Type, Name and Description fields will be populated. Name and Description can be modified, if desired (Figure 5).
Figure 5 Add Jama Artifact Type window
Specify the Jama artifact attributes to be available for mapping
Near the bottom of the window, click the Retrieve Jama Item Properties button.
The table add attribute definitions… will be populated, as Figure 6.
Figure 6 Add Jama Artifact Type window, completed
Select the Failure Mode attributes you want to be available for mapping and click OK.
Use the new Jama artifact type to create a new mapping.
Right-click SysML - Jama under Mapping Groups in the left column and select Add Mapping.
Set Name to Block – Failure Mode (Attributes)
Set Description to SysML Block – Jama Failure Mode with attributes
Set Source Artifact Type to Block, using pull-down menu
Set Target Artifact Type to Failure Mode, using pull-down menu
Set Structure Level to CHILDREN_RECURSIVE, using pull-down menu
Set Include Attributes to Include Attributes, using pull-down menu
Initially, the window should appear similar to Figure 7.
Figure 7 Syndeia dashboard, Mappings tab, adding a mapping in the SysML-Jama Mapping Group
Add a stereotype <<Jama_FailureMode>> by clicking the plus button under the Stereotypes table (see Figure 8) and selecting it from the new window (review Special Note on Rhapsody SysML Stereotypes at the beginning).
Figure 8 Select Stereotypes window
Create an Attribute Definitions Mappings table, using the plus button to add the pairing line-by-line as shown in Figure 9.
Figure 9 Attribute Definitions table in Mappings tab
Click Save Mapping at the bottom. The new mapping should appear in the list under the SysML – Jama mapping group in the left column and should be available in the Select Mapping Specification window when creating a Model Transform connection.