...
We will use the collection of blocks in the MySQL_Tutorial Part 1 package in the MagicDraw model supplied, Syndeia Tutorial Testbed.mdzip (get it here -SysML Models, Profiles and Mappings). In Figure 1, we see a component block with 12 specializations. We will use the parent component block to generate the table structure, using the value properties as column headers, and the specialized blocks to generate the table rows, with the default values as the column entries in each row.
Figure 1: Contents of MySQL_Tutorial Part 1 package in Syndeia Tutorial Testbed.mdzip
The same process works if the 12 blocks are instances rather than specializations of the component block. Whether the modeler uses instances or specializations to capture actual parameter values is a methodology question; MagicDraw and Syndeia support both.
For users unfamiliar with MySQL databases, Appendix 1 describes how to access the databases directly using the MySQL Workbench, where the user can create, modify, and view schemas, tables and table rows directly.Launch the Syndeia dashboard from the MySQL_Tutorial Part 1 package in the SysML model. Select a Syndeia Cloud project, if necessary.
The first step is to create the table in MySQL. Go to the Connection Manager tab. Set the Connection Type to Model Transform, as shown in Figure 2. Drag the parent block, component, from SysML to demo_tutorial in MySQL.
Figure 2: Contents of MySQL_Tutorial Part 1 package in Syndeia Tutorial Testbed.mdzip
Confirm table generation, as shown in Figure 3.
Figure 3: Confirming table generation
When complete, the Connection Manager should show a new table, component, under demo_tutorial, as shown in Figure 4.
Figure 4: Connection Manager after generation of new table, component
The Connection Search tab, as shown in Figure 5, shows the connection created between the SysML block and the MySQL table after Get All is clicked.
Figure 5: Connection Summary tab shows link between SysML block and MySQL table
The next step is to create a row in the table in MySQL. Set the Connection Type to Data Map. Drag the child block, Atmospheric Sensor, from SysML to component in MySQL and a new table row is created, as shown in Figure 6.
Figure 6: Generating a table row from the Atmospheric Sensor block
The table viewed in the MySQL database through the MySQL Workbench appear as in Figure 7.
Figure 7: Generating a table row from the Atmospheric Sensor block
Before completing the table, we will demonstrate how to compare and synchronize the parameter values between the SysML model and the MySQL database. In MagicDraw, modify the default value of the cost value property of the Atmospheric Sensor block, from 50 to 100. In the Connection Browser tab, right click on the connection from the Atmospheric Sensor block and select Compare Source & Target, as shown in Figure 8.
Figure 8: Generating a comparison across the Atmospheric Sensor data map connection
The Comparison Result is shown in Figure 9. The changed value of Atmospheric Sensor.Mass can also be observed directly using the MySQL Workbench. To update the parameter value in MySQL, right-click on the same connection and select Sync Source -> Target and confirm.
Figure 9: Comparison Result before updating SysML value to MySQL table
The remaining SysML specialized blocks can be dragged over in one step by multiple-selecting the blocks on the left side of the Connection Manager tab and dragging them onto the component table on the right. When complete, the Connection Manager will appear as shown in Figure 10. The changed value of Atmospheric Sensor.Mass can also be observed in the right column.
Figure 10: Connection Manager after dragging all components to MySQL table
...