Exercise 10.8 - SysML Requirements -> Simulink Requirements Compare and Sync

Objectives

In this tutorial, we demonstrate

Changing SysML requirements and doing compare/sync with Simulink Requirement

1a: SysML requirement - Simulink requirement connection

  • 1a1: Adding new child requirements on the SysML side, comparing, and synchronizing.

  • 1a2: Removing existing child requirements on the SysML side, comparing, and synchronizing.

  • 1a3: Updating text of requirements on the SysML side, comparing, and synchronizing.

1b: SysML package - Simulink requirement set connection

  • 1b1: Adding new requirements to the SysML package comparing, and synchronizing.

  • 1b2: Removing existing requirements from SysML package, comparing, and synchronizing.

Preparation

This exercise assumes the student has

1a: SysML requirement - Simulink requirement connection

The steps for this exercise are as follows.

1 Launch the Syndeia Dashboard from the Model Generation package in SysML Magicdraw/Cameo. It will appear as follows.

Figure 1: Launch the Syndeia Dashboard from the Model Generation package

 

2 Drag and drop the requirement Payload Mass from the Requirements package in SysML to a folder in your local file system, e.g. folder S1a. This has two nested requirements Select Model Transform. Select Yes.

Figure 2: Model transform Payload Mass requirement from SysML to folder S1a

 

3 In the Syndeia Dashboard you can observe the new Simulink requirements file Model_Generation_Requirements.

 

4 In the Connections Search tab, Click click the Get All. The connections between SysML requirements and Simulink requirements generated in the previous step can be seen.

5 Open the Simulink requirements model in Simulink, as shown below.

6 Compare the connection for Payload Mass and the nested requirements in the Connection Search tab.

7 In Comparison Result, it will show everything is matched as shown below.


1a1: Adding new child requirements on SYSML side, comparing, and synchronizing

1 Now we add a new nested requirement on Payload Mass on SysML Side such as Average Mass.

2 Again In Connections Search, click the Get All. The connections are generated and can be seen below. Compare the connection with Payload Mass as shown below.

3 The Comparison Result tab shows the difference between SysML (Source) And Simulink Requirement (Target). The result is shown below.

4 Now Sync Source-->Target in Syndeia. Click Yes when prompted.

5 After Sync click the Get All in the Connection Search tab. Here Average Mass connection is generated and can be seen as below.

6 Once Sync is over do compare again for Payload Mass in the Connection Search tab.

7 Click Yes.

8 Here the Sync is complete.

9 If the Set was already opened in the current MATLAB session as in Section 1a step 5, then it may need to be manually closed and reopened in order to display the changes: Right-click the set and select Close… as shown in Figure 12. We have found that simply closing the Requirements Editor or clicking the 'Refresh’ button will not be sufficient.

10 Re-open the Requirement Set in Simulink Requirements again.

11 In Simulink, we can see that Average Mass has been synced and added.

 


1a2: Removing existing child requirements on SYSML side, comparing, and synchronizingFr

The steps for this exercise are as follows.

1 In Requirements package in SysML remove 4.1 Maximum Mass from Payload Mass.

2 Click Delete.

3 In the Connection Search tab, click the Get All button. Compare Source and Target for the Payload Connection as shown below.

4 This Comparison Result does not show Maximum Mass on the SysML side as can been seen in the result for Comparison Result.

5 Sync Source--> Target for the Connection for Payload Mass in the Connection Search tab as shown below.

6 In the Connection Search tab, click the Get All button. Compare the Connection for Payload Mass again.

7 The Compare Result shows Maximum Mass is removed

8 In Simulink, the result is as follows where Maximum Mass requirement is removed. See 1a1 step 9 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.


1a3: Updating text of requirements on SYSML side, comparing, and synchronizing

The steps for this exercise are as follows

1 In the Requirements package in SysML, change the Maximum Mass from 50 kg to 100 kg as shown below.

2 In the Connection Search tab, Click the Get All button. Compare Source and Target for Payload Mass Connection.

3 Comparison Result shows the difference between 100 Kg and 50 kg in the Comparison Result tab.

4 Sync the Payload Mass Connection as shown below in the Connection Search tab.

5 Now Compare Source and Target again for the Payload Mass connection in the Connection Search tab as shown below.

6 In the Comparison Result tab the result is shown below.

 

7 Open Simulink Requirement Set, Maximum Mass is updated to 100 kg same as the SysML Model value. See 1a1 step 9 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.


1b: SysML package - Simulink requirement set connection

  • 1b1: Adding new requirements to SysML package comparing, and synchronizing.

  • 1b2: Removing existing requirements from SysML package, comparing, and synchronizing.

1b1: Adding new requirements to SysML package comparing, and synchronizing

The steps for this exercise are as follows

1 Launch Syndeia Dashboard from Model Generation.

2 Select the Model Generation:: Requirements Package in SysML Model and drag and drop the package in your local file system, e.g. folder S1c as shown below. Select Model Transform. Select Yes.

3 Observe the newly created Simulink requirements file Model_Generation_Requirements in the Syndeia Dashboard.

 

4 In the Connection Search tab, Click the Get ALL button. The connections generated between the SysML requirements and Simulink requirements in the previous step can now be seen, as shown below.

 

5 In Simulink, the new Simulink Requirement Set is generated as seen below.

6 Now update the SysML Requirement by adding a new Requirement ' Altitude as shown' under the Requirements package.

7 In Connection Search tab for Package “Requirements- Model Generation_Requirements “ package do Compare Source and Target as shown below.

8 In Comparison Result tab result shows that Altitude Connection is not there in Simulink Requirements.

9 Sync the connection for Package “Requirements- Model Generation_Requirements “ in the Connection Search tab as shown below.

10 Compare Source and Target once again on the connection for Package “Requirements- Model Generation_Requirements “.

11 In Comparison Result the result shows the requirement Altitude is updated.

12 In Simulink Requirements the set Simulink_Requirements_for_MagicDraw.slreqx (get it here - SysML Models, Profiles and Mappings) is updated with Altitude. See 1a1 step 9 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.

 


1b2: Removing existing requirements from the SysML package, comparing, and synchronizing

The steps for this exercise are as follows

We use the steps continuing from above exercise 1b1 Step 12 onwards.

1 Delete the Payload Data Rate requirement from the Requirements package in SysML.

2 In the Syndeia Dashboard Connections Search tab, Click the Get All button. For connection for package ”Requirements- Model Generation_Requirements “ select Compare Source and Target.

3 The Comparison Result tab shows the result as below where Payload Data Rate is present only in Simulink Requirements.

4 Sync the connection for Package ”Requirements- Model Generation_Requirements “ as Sync Source to Target as shown below.

5 Compare again the connection for package ”Requirements- Model Generation_Requirements as shown below.

6 In the Comparison Result tab the result is shown below where Payload Data Rate is not there now.

7 The Simulink Requirement shows no Payload Data Rate requirement. See 1a1 step 9 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.

 


Note to user: Simulink does not allow us to change the name of the requirement set without changing the parent file name. Changing the Simulink requirement file name will change the path to the file, and orphan the Syndeia connection. This use case is not supported.