Exercise 10.8 - SysML Requirements -> Simulink Requirements Compare and Sync.
In this tutorial, we demonstrate
Changing SysML requirements in Rhapsody and doing compare/sync with Simulink Requirement
1a: SysML requirement from Rhapsody - 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 SysML package comparing, and synchronizing.
1b2: Removing existing requirements from SysML package, comparing, and synchronizing.
Preparation
This exercise assumes the student has
Rhapsody supported version installed correctly on his or her machine with a valid license for use.
Syndeia installed as a plugin for Rhapsody with a valid license for use.
Syndeia Simulink interface, correctly installed with a valid license for use.
MATLAB/Simulink R2016b or later installed correctly on his or her machine with a valid license for use.
In this tutorial, we will see the Rhapsody model available as Syndeia_Simulink_Examples.rpyx (Get it here - SysML Models, Profiles and Mappings.)
1a: SysML requirement Rhapsody- Simulink Requirement connection
The steps for this exercise are as follows.
1 Launch the Syndeia Dashboard from Model Generation Package in Rhapsody. It will appear as follows.
2 Drag and drop the requirement Payload Mass from the Requirment_Sim 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.
3 In the Syndeia Dashboard you can observe the new Simulink requirements file Requirement_Sim.
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 from Connection Search Tab and see the result in the Comparison Result tab.
7 In the Comparison Result tab the result will show everything is matched.
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 Comparison Result shows Average Mass is not present in Simulink Requirements. The result is shown below.
4 Now Sync Source-->Target in Syndeia. Click Yes when prompted.
5 After Sync, click Get All in the Connection Search tab. Here Average Mass connection is generated.
6 In Connections Search Tab click Get All. Again Compare the connection with Payload Mass. The result is Average Mass is now shown in Simulink requirements.
7 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 13. We have found that simply closing the Requirements Editor or clicking the 'Refresh’ button will not be sufficient.
8 Re-open the Requirement Set in Simulink Requirements again.
9 In Simulink, we can see that Average Mass has been synced and added.
1a2: Removing existing child requirements on the SysML side, comparing, and synchronizing
The steps for this exercise are as follows.
1 In the Requirment_Sim package in SysML remove Maximum Mass from Payload Mass.
2 In the Connection Search tab, click the Get All button. Compare Source and Target for the Payload connection. The result shows Maximum Mass is not present on the SysML Rhapsody side.
3 Sync Source → Target for the Payload Mass connection in the Connections Search tab as shown below.
4 In the Connections Search Tab click the Get All button. Again Compare the connection with Payload Mass again.
5 The Compare Result shows the Maximum Mass removed.
6 In Simulink Requirements the result is as follows where Maximum Mass is removed. See 1a1 step 7 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 Requirement_Sim package in SysML Change Maximum Mass from 100 kg to 50 kg.
2 This becomes as below in SysML.
3 In Connections Search Tab click Get All button. Again Compare the connection with Payload Mass.
4 Comparison Result tab shows Maximum Mass is 50 kg on the Rhapsody SysML side and 100 kg on the Simulink Requirements Side.
5 Sync Source (SysML)-->Target(Simulink)on the Payload connection in the Connection Search tab. Again compare the Payload connection. Now Comparison Result will show as below Maximum Mass is 50 kg on both SysML and Simulink sides.
6 Open Simulink Requirement Set, Maximum Mass is updated to 50 kg same as the SysML Model value. See 1a1 step 7 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
The steps for this exercise are as follows.
1 Select the Model Generation:: Requirement_Sim package in SysML Model and drag and drop the package in your local file system, e.g. folder S1b1 as shown below. Select Model Transform. Select Yes.
2 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.
3 In Simulink a new Requirement Set is generated.
4 Now in SysML Rhapsosdy add a new requirement as Maximum_Altitude as shown below.
5 In the Connection Search tab, Compare Source and Target for the Requirement_Sim package connection as shown below.
6 Compare Result shows Maximum_Altitude is present on SysML Rhapsody side and absent on Simulink Requirement Side.
7 Sync Source-->Target for the connection for Requirement_Sim Package as shown below.
8 Now again in the Connection Search tab, compare the connection for Requirement_Sim package. See the result in Comparison Result. This shows Maximum_Altitude is created on Simulink Side as well now.
9 In Simulink the Requirement_Sim requirement set is updated with the new requirement Maximum Altitude. This appears as shown below. See 1a1 step 7 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.
1b2: Removing existing requirements from SysML package, comparing, and synchronizing
The steps for this exercise are as follows.
1 From the same Model Generation::Requirement_Sim package as from 1b1 above remove the Payload_Data_Rate Requirement from SysML Rhapsody.
2 This now appears as shown below in SysML Rhapsody.
3 In the Connection Search tab, Compare Source and Target for the Requirement_Sim package connection. The result shows Payload_Data_Rate is absent from SysML Rhapsody side and present on Simulink Requirement Side.
4 Sync Source → Target for the connection for Requirement_Sim package as shown below.
5 Now again, compare the connection for Requirement_Sim Package and see the result in Comparison Result. This will appear as below.
6 In Simulink Requirements this appears shown below with no Payload_Data_Rate requirement in the Requirement_Sim set. See 1a1 step 7 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.