Creating SysML – JIRA Mappings.
The new learning objective of this exercise are to create new SysML_JIRA mappings for Data Map and Model Transform connections.
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.2 installed as a plugin for Rhapsody with a valid license for use
- Syndeia JIRA interface, correctly installed with a valid license for user
- Syndeia Mappings license, to modify syndeia.mappings file from the Syndeia dashboard
We will use the provided Rhapsody project Syndeia_JIRA_Mapping_Tutorial.rpy. The user can use any JIRA repository they have available with the ability to create and edit issues within a JIRA project. 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, syndeiaTutorial_Rh.mappings, which contains the specific starting mappings used in this and the following exercises. To install this,
- Close Rhapsody, if it is open
- Rename the existing syndeia.mappings file in the .syndeia folder to something like syndeiaOld.mappings
- Copy syndeiaTutorial_Rh.mappings into the .syndeia folder
- Rename syndeiaTutorial_Rh.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, SyndeiaTutorialMapping.sbs, which is loaded into a TutorialMappingProfile folder in the profiles folder of Syndeia installation:
C:\Users\<account>\<Rhapsody installation> \Share\Profiles\Syndeia\profiles\
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. Some mappings require a special SysML stereotype to correctly transform attributes to or from a SysML element, so each mappings file should be paired with a SysML profile that holds the required stereotypes, as we have done here.
Many organizations customize their JIRA installation, creating new artifact and relationship types for their purposes. This tutorial exercise uses common artifact types in a standard JIRA installation, but you may need to adapt the instructions if these artifact types are not available to you. Prior to your doing this exercise, a user with the mapping license described above would need to register the new artifact types for mapping (as described in Exercise 8.6).
Exercise
- Open the SysML project Syndeia_JIRA_Mapping_Tutorial.rpy. Right-click the JIRA package and launch the Syndeia dashboard.
- Go to the Mappings tab. The first task will be to create a new mapping using existing artifacts.
- Right-click SysML-JIRA under Mapping Groups in the left column and select Add Mapping. Initially, the window should appear similar to Figure 1.
- Modify the Mapping
- Change Name to Activity – New Feature (no attributes)
- Change Description to SysML Activity - JIRA New Feature with no attributes
- Change Source Artifact Type to Activity, using pull-down menu
- Change Target Artifact Type to New Feature, using pull-down menu
- Set Structure Level to CHILDREN_RECURSIVE, using pull-down menu
- Set Include Attributes to Exclude Attributes, using pull-down menu
- The window should look similar to Figure 2.
- Click Save Mapping at bottom of right side (scroll down if necessary).
- Right-click SysML-JIRA under Mapping Groups in the left column and select Add Mapping. Initially, the window should appear similar to Figure 1.
- Use the new Mapping you just created
- Go to the Connection Manager tab. Open a JIRA repository in the right column.
- Drag the Feature E activity in the SysML model into a JIRA project
- A small pull-down menu will appear on the Syndeia dashboard, as Figure 3, showing the possible mappings available for an activity dragged into JIRA.
- Select Activity – New Feature (no attributes) and click OK.
- Expand the Syndeia Demo Box Project and Reported by me folder. Check that a new JIRA issue of type New Feature has been created with default attribute values assigned by JIRA.
- The second task is to create another new mapping, this one with attributes shared between the SysML and JIRA elements. We will use the Clone Mapping command rather Add Mapping. Clone Mapping saves time when not all features of the new mapping need to be modified.
- Right-click Activity – New Feature (no attributes) under Mapping Groups/SysML - JIRA in the left column and select Clone Mapping
- Initially, the window should appear similar to Figure 4.
- Modify the Mapping
- Change Name to Activity – New Feature (attributes)
- Change Description to SysML Activity - JIRA New Feature with attributes
- Keep Source Artifact Type as Activity and Target Artifact Type as New Feature
- Set Structure Level to NO_CHILDREN, using pull-down menu
- Set Include Attributes to Include Attributes, using pull-down menu
- At the bottom of the right side, click the + sign box under the Stereotypes table.
- A Select stereotype window will open. The window should look similar to Figure 5.
- Select JIRA_Feature. This choice will appear in the Select stereotype box on the right.
- Scroll up to Attribute Definition Mappings
- Click Retrieve Available Attribute Definitions
- Click the + box below the Attribute Definition Mappings box.
- In the new row, select Priority (Priority) on the right (Target) side of the table, using the pull-down menu
- In the new row, select priority (priority) on the left (Source) side of the table, using the pull-down menu
- Repeat steps xi through xiii for Status, Summary and Assignee. The final table should look like Figure 6.
- Click Save Mapping at bottom of right side (scroll down if necessary).
- Use the cloned Mapping you just created
- Go to the Connection Manager tab. Open the JIRA repository you used above in the right column.
- Drag the Feature E JIRA issue created earlier into an empty SysML package.
- A small pull-down menu will appear on the Syndeia dashboard, as in Figure 7, showing the possible mappings available for an activity dragged into JIRA.
- Select Activity – New Feature (attributes) and click OK.
- A new activity (named Feature E) should appear under J4 on the SysML side. It will have the <<JIRA_Feature>> stereotype in addition to Activity and all the tag values associated with that stereotype. However, only the four JIRA attributes mapped in the Activity – New Feature (Attributes) mapping (i.e. priority, status, summary, assignee) have been populated in the SysML element from the JIRA issue (see Figure 8).
Note that SysML activities do not normally have any place to receive the JIRA attributes. <<JIRA_Feature>>, a stereotype applicable to Activity Diagrams, was chosen in the new mapping definition, so the new activity was created with that additional stereotype and tag values ready to receive the desired JIRA attributes.
- Change Priority from Major to Minor in the JIRA issue created from Feature E (named SDB-1295 in our example) through the JIRA web interface
- Find the connection between the JIRA Issue and the new SysML activity (J4::Feature E) in the Connection Browser.
- Right-click the connection and select Compare Source and Target.
- The Comparison Result tab should appear similar to Figure 9.
- Return to the connection in the Connection Browser and select Sync Target to source and update the priority tag value on the SysML block to Minor.