Exercise 17.3 - Creating a Custom SysML-TM4J Mapping

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.

Preparation

This exercise assumes the student has

  • Cameo System Modeler 18.0 - 19.0 (or MagicDraw with SysML plug-in) installed correctly on his or her machine with a valid license for use, and

  • Syndeia 3.3 installed as a plugin for Cameo/MagicDraw 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.
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 MagicDraw project Syndeia_JIRA_TM4J_Tutorial.mdzip (get it here - https://intercax.atlassian.net/wiki/spaces/SYN34/pages/2407364009) provided with the tutorials for this exercise, which loads the profile Syndeia_Mapping_Tutorials_Profile.mdzip. We also use the syndeia34Tutorial.mappings file provided, which has been installed in the .syndeia folder and renamed as syndeia.mappings.
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 and modify the instructions accordingly.

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 Dependency relationship – TM4J issueLinks relationship

  • SysML Part Property relationship – TM4J testRuns relationship

    Figure 1 SysML Starter Model

Exercise

  1. If not already open from the previous exercise, open the SysML project Syndeia_JIRA_TM4J_ Tutorial.mdzip (get it here - https://intercax.atlassian.net/wiki/spaces/SYN34/pages/2407364009) (or your own), right-click the top-level package, and launch the Syndeia dashboard. Go to the Mappings tab (Figure 2).

    Figure 2 Syndeia dashboard, Mappings tab

  2. 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 window (Figure 3).

    Figure 3 Mappings window

    1. Choose Source Artifact Type as Block (Test Plan) from the pull-down menu.

    2. Choose Target Artifact Type as TM4J Test Plan from the pull-down menu.

    3. Enter Name and Description as shown in Figure 4.

      Figure 4 New Mappings window, top half

    4. Choose Structure Level as Children Immediate from the pull-down menu.

    5. Choose Include Attributes as Include Attributes from the pull-down menu.

    6. The window should appear as in Figure 4 at this stage.

    7. Scroll down, if necessary to see the bottom half of the Mappings window, as in Figure 5.

    8. Click Retrieve Available Attribute Definitions below the Attribute Definition Mappings table. Using the Plus button, add the two attribute mappings line-by-line for the Test Plan artifacts as shown in Figure 5.

    9. Choose Include Relations as Include Relations from the pull-down menu.

    10. Using the plus button below the Relation Type Mappings table, add the two relationship mappings line-by-line as shown in Figure 5.

      Figure 5 New Mappings window, bottom half

    11. Using the plus button below the Related Mappings table, add the two related mappings line-by-line as shown in Figure 5.

    12. Click Save Mapping at the bottom before moving on.

  3. 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.

    Figure 6 Connection Manager tab in Syndeia dashboard, drag My Test Plan to JIRA project

     

  4. 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

  5. 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.

    Figure 8 Comparison Results across My Test Plan Connection

  6. In the SysML model, modify the connections to My Test Plan, as shown in Figure 9.

    Figure 9 Modified SysML model

    1. Delete the dependency relationship from My Test Plan to My Test Project.

    2. Add a second part property using the block My Second Test Cycle.

  7. 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.

  8. 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.

    Figure 10 Comparison Results across My Test Plan Connection after modifying SysML model