Objectives
The new learning objectives of this exercise are to generate Rhapsody SysML blocks and instances from an Excel spreadsheet.
Preparation
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
The specific instructions call for creating connections to an Excel workbook on the local file system, so no additional interface beyond the Syndeia base module is required.
Exercise
In this exercise, we will use the Excel table created in Exercise 2.1 and import this information back into an empty package in Rhapsody.
If not still open from the previous exercise, re-open Syndeia_Tutorial_Testbed.rpy (Get it here - SysML Models, Profiles and Mappings.). Create an empty package named Excel_Tutorial Part 2.
If not already open, right-click on Excel_Tutorial Part 2 and open the Syndeia dashboard. Select a Syndeia Cloud project, if necessary. If Syndeia is already open from the previous exercise, right-click on Excel_Tutorial Part 1 in the Connection Manager, select Go to.. and navigate to Excel_Tutorial Part 2.
Expand DZ Local in the Connection Manager tab to show the worksheets and tables within the Excel_Testbed_Rhp.xlsx spreadsheet. In this example, we are using the component table in the component worksheet, as shown in Figure 1.
Figure 1 Syndeia Dashboard, Connection Manager tab, showing local repository contents on right
In the first task, we will create a block in SysML linked to the table component in Excel. Set the Connection Type to Model Transform. Drag the table component (see red arrow in Figure 1) into the Excel_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, it does not contain any of the data about specific components. That is the object of the next step.
Figure 2 Dialog box
Figure 3 Syndeia Dashboard, Connection Manager tab, showing Excel table component and the SysML block component
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 Excel_Tutorial Part 2 package in the left panel. A dialog box as in Figure 4 will appear. Check the "As Specialization" checkbox and click Yes (Syndeia for Rhapsody does not support instances). The new SysML specializations of the component block are shown in Figure 5, their names corresponding to the rows in the Excel worksheet they originated from.
Figure 4 Instance generation dialog box
Figure 5 Syndeia Dashboard, Connection Manager tab, showing new SysML specializations created
Step 5 above could have been left out. If an Excel 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 Excel_Tutorial Part 2 package in Rhapsody.In the next part of the exercise, we will make changes to the data in the database and update the SysML model from Excel. Go to Excel and modify some details of the connected rows. For example, see Figure 6 where the left side shows the components table before making changes and the right side show the changes. The cost of the Payload Controller was reduced from 50 to 25 and the mass of the Atmospheric Sensor was decreased from 2 to 1.5.
Figure 6 Modify contents of database in Excel Workbench
Now in the Connection Search tab, as shown in Figure 7, multiple-select (using Ctrl key) the two connections that correspond to the 2 modified rows. Right click and select Compare Source and Target. The results should appear as in Figure 8.
Figure 7 Multiple select connections, right click, and select Compare Source and Target
Figure 8 Results of Compare Source and Target
Right-click the two rows again and select Sync Target -> Source. Check that the values of component_row-8.cost and component_row_3.mass are updated in the Rhapsody model.