Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Syndeia 3.3 (Plugin for Rhapsody)
Tutorial Exercise 3.2
Generating SysML Blocks/Instances from a MySQL Table

Image Removed

47 Perimeter Ctr E, Suite 410
Atlanta, GA 303046, USA
Voice: +1-404-592-6897
Web: www.intercax.com
Email: info@intercax.com

...

Objectives

The new learning objectives of this exercise are to generate Rhapsody SysML blocks and instances from a MySQL database.

...

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 MySQL interface, correctly installed with a valid license for user.

  • A MySQL repository network connection in the Syndeia Repository Manager, where you have write privileges to MySQL

  • MySQL Workbench, a direct interface to the user's MySQL database

Exercise

  1. In this exercise, we will use the MySQL table created in Exercise 3.1 and import this information back into an empty package in Rhapsody. If not still open, launch Rhapsody with the Syndeia_Tutorial_Testbed.rpy project (alternatively, create a new Rhapsody SysML project with the Syndeia profile).

  2. Create an empty package in the SysML model named MySQL_Tutorial Part 2. Right-click it and open the Syndeia dashboard. If Syndeia was still open from the previous exercise, right-click MySQL_Tutorial Part 1 in the Connection Manager tab and use Go to… to navigate to the new package.

  3. Expand the component table in the Connection Manager tab to show the table contents within the database, as shown in Figure 1. Set the Connection Type to Model Transform.

    Image Removed

    Anchor_Ref377039308_Ref377039308 Anchor_Ref388606407

    _Ref388606407Figure 1 Syndeia Dashboard, Connection Manager tab, showing the repository MySQL @ Intercax

    Image Removed

    Anchor_Ref377039358_Ref377039358Figure 2 Dialog box

  4. Drag the table component (see red arrow in Figure 1) into the MySQL_Tutorial Part 2 package in the SysML model. Click Yes on the dialog box (Figure 2). When complete, component appears as a block in the SysML model panel as in Figure 3. Note that while the component block contains the structure of the component table (this can be seen in Rhapsody), it does not contain any of the data about specific components. This is the object of the next step.

    Image Removed

    Anchor_Ref377039398_Ref377039398

    Figure 3 Syndeia Dashboard, Connection Manager tab, showing MySQl table component and the SysML block component

    Image Removed

    Anchor_Ref377039432_Ref377039432Figure 4 Instance generation dialog box

  5. Set the Connection Type to Data Map. Select several of the individual records under the component table in the right-hand panel. Drag them into the MySQL_Tutorial Part 2 package in the left panel. A dialog box as in Figure 4 will appear. Check the "As Specialization" checkbox (Syndeia for Rhapsody does not support instances) and click Yes. The new SysML specializations are shown in

    Figure 5.

    Image Removed

    Anchor_Ref377039545_Ref377039545

    Figure 5

    Syndeia Dashboard, Connection Manager tab, showing new SysML specializations created Anchor_Ref367106067_Ref367106067 Step 5 above could have been left out. If an MySQL record was dragged into the empty package initially, the component block is created automatically, along with the specialization corresponding to the individual record. If you wish to try this, first delete the existing Syndeia connections between the table and SysML and erase the current contents of the MySQL_Tutorial Part 2 package in Rhapsody

    .

  6. In the next part of the exercise, we will make change to the data in the database and update the SysML model from MySQL.

    Anchor
    _Ref366950567
    _Ref366950567
    Go to the MySQL Workbench and modify some details of the connected rows. For example, see Figure 6 where the left side shows the component table before making changes and the right side show the changes. The cost of the Communication Controller was reduced from 30 to 25 and the mass of the GPS was reduced from 7 to 6.

    Image Removed Image Removed

    Anchor_Ref377044756_Ref377044756 Figure 6 Modify contents of database in MySQL Workbench


  7. Refresh the Connection Search tab by clicking Get All and multiple-select (using Ctrl key) connections DZSB04-R103 and R104 that correspond to the 2 modified rows. Right-click and select Sync Target → Source, as shown in Figure 7.

    Image Removed

    Anchor_Ref377039637_Ref377039637 Anchor_Ref366949940_Ref366949940


    Figure 7 Multiple-select connections, right click, and select Sync Target → Source
  8. _Ref41422591Figure 8 Results of Compare Source and Target

    The Comparison results should appear as shown in Figure 8.

    Image Removed

    Anchor_Ref41422591


  9. Right-click the two rows again and select Sync Target -> Source. Check that the values of AV_Tutorial_component_GPS.mass and AV_Tutorial_component_Communications_ Controller.cost are updated in the Rhapsody model.