Syndeia 3.3 (Plugin for Rhapsody)
Tutorial Exercise 17.3
Creating a Custom SysML-TM4J Mapping
| 47 Perimeter Ctr E, Suite 410 |
...
Objectives
Using the TM4J artifact and relation types created in the previous exercise, the new learning objective of this exercise is to create and execute a custom mapping between SysML and TM4J in Syndeia.
...
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 JIRA interface, correctly installed with a valid license for user.
The user can. It is generally advisable to carry out these exercises in a non-production repository, a "sandbox", set up for training and practice purposes. For this demonstration, you may use any JIRA repository you have available with the ability to create and edit TM4J elements of types Test Case, Test Cycle and Test Plan.
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_JIRA_TM4J_Mapping_Tutorial.rpy provided with the tutorials for this exercise, which loads the profile Syndeia_Mappings_Tutorial_Profile.sbs. We also use the syndeia33TutorialRhp.mappings file provided, which has been installed in the .syndeia folder and renamed as syndeia.mappings.
Example – SysML to TM4J/JIRA
...
...
...
The SysML model shown in Figure 1 will be used in a model transform to a JIRA repository with TM4J capability with the following mapping, which includes both multiple artifact and multiple relationship mappings.
Block (Test Plan) – TM4J Test Plan
Block (Test Cycle) – TM4J Test Cycle
Activity – JIRA Bug issue
SysML Allocate dependency relationship – TM4J issueLinks relationship
SysML Part Property relationship – TM4J testRuns relationship
Figure 1 SysML Starter Model
Exercise
...
If not already open from the previous exercise, open the SysML project Syndeia_JIRA_TM4J_Mapping_Tutorial.rpy (or your own), right-click the top-level package, and launch the Syndeia dashboard. Go to the Mappings tab (Figure 2).
Anchor _Ref481833169 _Ref481833169 Figure 2 Syndeia dashboard, Mappings tab
Our first objective is to create a new SysML-TM4J mapping, Block (Test Plan) - TM4J Test Plan. In the left column, right-click on Syndeia Mappings/2 Mapping Groups/[↔] SysML - TM4J and select Add Mapping (Figure 3).
Anchor _Ref481833397 _Ref481833397 Figure 3 Mappings window
Choose Source Artifact Type as Block (Test Plan) from the pull-down menu.
Choose Target Artifact Type as TM4J Test Plan from the pull-down menu.
Enter Name and Description as shown in Figure 4.
Choose Structure Level as Children Immediate from the pull-down menu.
Choose Include Attributes as Include Attributes from the pull-down menu.
The window should appear as in Figure 4 at this stage.
Figure 4 New Mappings window, top half
Scroll down to see the bottom half of the Mappings window, as in Figure 5.
Click Retrieve Available Attribute Definitions below the Attribute Definition Mappings table. Using the Plus button, add the Three attribute mappings line-by-line for the Test Plan artifacts as shown in Figure 5.
Figure 5 New Mappings window, bottom half
Choose Include Relations as Include Relations from the pull-down menu.
Using the plus button below the Relation Type Mappings table, add the two relationship mappings line-by-line as shown in Figure 5.
...
...
anchorUsing the plus button below the Related Mappings table, add the two related mappings line-by-line as shown in Figure 5.
Click Save Mapping at the bottom before moving on.
_Ref40102224 _Ref40102224 - Figure 5 New Mappings window, bottom half
Execute the model transform just created by dragging J4::My Test Plan onto a project in JIRA with the capability to accept TM4J model elements (see Figure 6). Choose the mapping just created, Block (Test Plan) – TM4J Test Plan.
Anchor _Ref40090832 _Ref40090832Figure 6 Connection Manager tab in Syndeia dashboard, drag My Test Plan to JIRA project
Expand the JIRA column and find the new Test Plan element, My Test Plan. Right-click My Test Plan and open JIRA. My Test Plan in the JIRA web browser should look similar to
Figure 7.
...
...
Figure 7 My Test Plan in JIRA web browser, showing related Issues and Test Cycles after model transform
From the Syndeia dashboard, Connection Browser or Connection Search tab, execute Compare Source and Target on the connection from My Test Plan. The results should appear the same as Figure 8. Note the relationships on both sides connecting My Test Plan to My Test Cycle and My Test Project.
Anchor _Ref40125161 _Ref40125161Figure 8 Comparison Results across My Test Plan Connection
Anchor _Ref40125585 _Ref40125585 - Figure 9 Modified SysML model
In the SysML model, modify the connections to My Test Plan, as shown in Figure 9.
Figure 9 Modified SysML model
Delete the dependency relationship from My Test Plan to My Test Project.
Add a second part property using the block My Second Test Cycle.
Run Compare Source and Target again from the My Test Plan connection. The results should now appear similar to Figure 10. The part property relationship to My Second Test Cycle has no equivalent on the JIRA side and the connection to My Test Project has disappeared on the SysML side.
...
Figure 10 Comparison Results across My Test Plan Connection after modifying SysML model
From the Syndeia dashboard, Connection Browser or Connection Search tab, execute Sync Source to Target on the connection from My Test Plan, then repeat the Compare Source and Target. The results should resolve the differences shown in Figure 10.