Exercise 7.5 - Using SysML-Jama Mappings
Objectives
The new learning objective of this exercise is to explore and use existing SysML_Jama mappings for Model Transform connections.
Preparation
This exercise assumes the student has:
Cameo System Modeler 19.0 (or MagicDraw with SysML plug-in) or later installed correctly on his or her machine with a valid license for use.
Syndeia 3.6 or later installed as a plugin for Cameo/MagicDraw with a valid license for use.
Jama repository (server) that can be connected over the network from the Syndeia Repository Manager.
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.
Using mapping in Syndeia requires two new elements which are provided with these tutorials
A mappings file, syndeia34Tutorial.mappings (get it here - SysML Models, Profiles and Mappings), which contains the specific starting mappings used in this and the following exercises. To install this,
Close MagicDraw, if it is open
Rename the existing syndeia.mappings file in the .syndeia folder to something like syndeiaOld.mappings
Copy syndeia34Tutorial.mappings into the .syndeia folder
Rename syndeiaTutorial.mappings as syndeia.mappings
When you have completed the mapping tutorial exercises, you may want to reverse this process to restore the original mappings file.
A mappings profile,Syndeia_Mapping_Tutorials_Profile.mdzip (get it here - SysML Models, Profiles and Mappings), which is loaded automatically with the SysML project Syndeia_Jama_Mapping_Tutorial.mdzip and can be used with other projects.
Exercise
Open the SysML project Syndeia_Jama_Mapping_Tutorial.mdzip (get it here - SysML Models, Profiles and Mappings), right-click the Jama_Mapping package, and launch the Syndeia dashboard. Select the Syndeia Cloud project, if used.
Go to the Settings tab (Figure 1) and check the Use mapping element under the General heading, if not already checked. Click Apply.
Figure 1 Syndeia dashboard, Settings tab, Use mapping checked
Go to the Mappings tab. The contents of the main area on the right will depend on the element selected on the left. Expand Mapping Groups and select SysML-Jama on the left to see the existing mappings in this area (Figure 2).
Figure 2 Syndeia dashboard, Mappings tab, Mapping Groups/SysML-Jama expanded on left
The first task is to drag a hierarchy of SysML requirements into Jama to create an equivalent Jama hierarchy.
Go to the Connection Manager tab and set Connection Type to Model Transform in the central column.
Open the SysML model in the left column and your Jama repository in the right. Expand the SysML model to show Jama_Mapping::J1::Product_Spec.
Drag the Product Spec requirement onto the target Jama component (Jama_Tutorial in this example)
Select Requirement-Requirement (No attributes) and click OK (Figure 3).
Figure 3Â Syndeia Dashboard, Connection Manager tab
We can view the new Jama requirements created by expanding the right side of the Connection Manager (see Figure 4). The SysML requirement structure is preserved.
Figure 4Â New Jama requirements viewed in Syndeia dashboard
You can view the new requirements created in Jama. If you right-click the new requirement Feature_1_Environmental in either column and select Open, the Jama web interface should open to that requirement.
While the Jama interface is open, modify the requirement. The model transform operation just performed used a mapping that did not carry over attributes from SysML, so the Description and Priority fields in Jama (among others) are empty, while the ID and Status fields have default entries. Enter some values into Description and Priority, as shown in Figure 5, and save.
Figure 5Â Modified Jama requirement viewed in Jama web interface
While in the Jama web interface, refresh the parent requirement, Product_Spec, of the requirement just modified, before closing the interface. This is necessary to update the parent requirement before proceeding with the second part of the exercise.
In the second example, we will use a different mapping when we drag the Jama requirement back into SysML.
Return to the Mappings tab in the Syndeia dashboard and select the mapping Requirement - Requirement (attributes) in the left column (Figure 6). We see that this mapping is associated with a special SysML stereotype, <<Jama_Requirement>>, which contains tag values priority and status, corresponding Jama attributes that are not part of the standard SysML requirement, but that we want to bring into the SysML model. On the right side next to Attribute Definition Mappings, there is a table showing the desired mappings between the SysML (Source) element tag values and the Jama (Target) attributes.
In the Syndeia dashboard, Connection Manager tab, select the Model Transform connection type, drag the Feature_1_Environmental item into an empty SysML package, e.g. Jama_Mapping::J3, and select the Requirement - Requirement (attributes) mapping.
You can view the new requirement created in MagicDraw. If you create and populate a requirement diagram, it should appear similar to Figure 7. Both the <<Jama_Requirement>> and <<requirement>> stereotypes have been applied and the associated tag values have been added.
Figure 6Â Syndeia mapping for Requirement - Requirement (attributes)
Figure 7Â New SysML requirement created by different mapping
The Compare & Sync features of Syndeia work with custom-mappings just as they do with default mappings. To demonstrate,
Modify the SysML requirement attributes, e.g set priority to High and Text to 95% recyclable.
Go to the Syndeia Dashboard, Connection Browser tab, and find the new connection between the SysML and Jama requirements (see Figure 8).
Figure 8Â Syndeia Dashboard, Connection Browser tab, new connection
Right-click the connection and select Compare Source and Target and confirm. The Comparison Result tab will open (Figure 9), showing differences in the Text and priority fields between the SysML and Jama requirements
Figure 9Â Syndeia Dashboard, Comparison Results tab, after compare operation
Return to the Connection Browser and select Sync Target to Source. Confirm that the SysML requirement tag values have returned to original Jama values and that a comparison between the two requirements shows all green.
Alternatively, the sync in d) could have been Sync Source to Target, using the modified SysML attributes to update the Jama requirement. This assumes that the user has Write privileges to the Jama repository and that the Jama attribute is editable through the Jama API (Id, for example, is not).
Save and close the model. If you have a Mapping license that allows you to modify mappings, proceed to the next tutorial exercises.
Related Tutorials
Refer to the following tutorial for synchronizing SysML → Jama, and vice versa, when using custom mappings:
Exercise 7.9 - Jama - SysML Compare & Sync with Custom Mappings
Â