Versions Compared

Key

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

Syndeia 3.3 (Plugin for MagicDraw)
Tutorial Exercise 2.2
Transforming Excel Tables/Rows to SysML Blocks/Instances

Image Added

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


Revision Date: June 18, 2020

Objectives

The new learning objectives of this exercise are to generate MagicDraw SysML blocks and instances from an Excel spreadsheet.

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

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

  1. In this exercise, we will use the Excel table created in Exercise 2.1 and import this information back into an empty package in MagicDraw.


  1. If not still open from the previous exercise, re-open Syndeia Tutorial Testbed.mdzip. Create an empty package named Excel_Tutorial Part 2.
  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.


  1. Expand DZ Local in the Connection Manager tab to show the worksheets and tables within the Excel_Testbed.xlsx spreadsheet. In this example, we are using the component table in the component worksheet, as shown in Figure 1.

    Image Added

    Anchor
    _Ref388977349
    _Ref388977349
    Figure 1 Syndeia Dashboard, Connection Manager tab, showing local repository contents on right


    Image Added

    Anchor
    _Ref388987587
    _Ref388987587
    Figure 2 Dialog box

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

    Image Added

    Anchor
    _Ref388987615
    _Ref388987615
    Figure 3 Syndeia Dashboard, Connection Manager tab, showing Excel table component and the SysML block component

    Image Added

    Anchor
    _Ref388987868
    _Ref388987868
    Figure 4 Instance generation dialog box


  3. 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. Leave the "As Specialization" checkbox unchecked and click Yes. The new SysML instances are shown in Figure 5. The names of the instances correspond to the rows in the Excel worksheet they originated from.

    Image Added

    Anchor
    _Ref388988019
    _Ref388988019
    Figure 5 Syndeia Dashboard, Connection Manager tab, showing new SysML instances created


  4. Explore other options for transferring Excel records to the SysML model
    1. Drag more records from the component table into the Excel_Tutorial Part 2 package in SysML, but check the "As Specialization" checkbox on the Syndeia dialog box. This will create a series of blocks that are specializations of the component block, but with the default values of the value properties showing the information from the individual records.
    2. Create a new package in the SysML project and drag some Excel records into it. They will still be treated as instances (or specializations) of the component block even if they are not in the same package.

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 instance (or 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 MagicDraw.

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

    Image Added Image Added

    Anchor
    _Ref41421737
    _Ref41421737
    Figure 6 Modify contents of database in Excel Workbench


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


  1. Right-click the two rows again and select Sync Target -> Source. In the Containment Browser of the SysML model, the updated values of component_row-7.cost and component_row_3.mass are updated, as shown in Figure 9.

    Image Added

    Anchor
    _Ref388989584
    _Ref388989584
    Figure 7 Multiple select connections, right click, and select Compare Source and Target

    Image Added

    Anchor
    _Ref41422591
    _Ref41422591
    Figure 8 Results of Compare Source and Target

    Image Added

     

    Anchor
    _Ref388990395
    _Ref388990395
    Figure 9 Updated values from Excel