Codebeamer - Simulink Integration
This page provides guidance and help for the installation and configuration of the Codebeamer - Simulink Integration.
The integration between Codebeamer and Simulink creates a digital thread between requirements and design, supporting consistency and traceability across requirements, architecture, and design. This seamless integration between Simulink models and tests and the Codebeamer requirements management streamlines the workflow, enabling you to efficiently link and directly manage requirements and test cases within the Simulink environment. By ensuring consistency and traceability, the Simulink-Codebeamer integration enhances collaboration and productivity for engineering teams. This integration not only maintains alignment between requirements and design but also supports a more efficient and cohesive engineering process.
The integration supports two main use cases:
• Development (left side of the V-model)—Using Model-Based Systems Engineering (MBSE) or Model-Based Design (MBD), Codebeamer and Simulink are employed for requirements analysis, specification, implementation, and detailed design. Requirements authored in Codebeamer are implemented in Simulink.
• Requirements-Based Testing (right side of the V-model)—Requirements-Based Testing is performed on the implementation of those requirements. The models and generated code are verified based on test specifications using Simulink Test. The solution provides bidirectional traceability between requirements, implementation, and testing.
Prerequisites
The following are the necessary versions:
• Matlab / Simulink 2022b or newer versions
• Codebeamer 2.0.0.0 or newer versions
The necessary Matlab toolboxes are the followings:
• Basic workflow for Simulink models:
◦ MATLAB
◦ Simulink
◦ Requirements toolbox
◦ Codebeamer toolbox.
• Required to include Simulink test:
◦ Simulink test
◦ Stateflow
User Guide
This guide covers the necessary versions and toolboxes for integrating Matlab/Simulink with Codebeamer, including installation and configuration steps and Data Dictionary. It also outlines the required project setup and mandatory fields, and describes how to link requirements between Codebeamer and Simulink models and Simulink tests. Additionally, it provides instructions for batch synchronization of data using the Matlab API.
Licensing and Permissions
The use of the integration is limited to users with Advanced or Premium licenses. The user must be part of a group in which Rest / Remote API – Access is granted.
Codebeamer Toolbox Installation (Matlab)
To install the Codebeamer toolbox:
1. Open MATLAB.
2. Navigate to the folder where the CodeBeamer.mltbx file is downloaded.
3. Double-click on the CodeBeamer.mltbx. The toolbox is installed, and a pop-up window confirms a successful installation.
4. Delete a configuration file in the home directory (C:\Users\user). The file extension is .mlcbconfig.
5. Restart MATLAB to enable the changes.
Uninstallling the Codebeamer Toolbox
To uninstall the Codebeamer toolbox:
1. Open MATLAB.
2. Click tab > . Click the down arrow below the Add-Ons button and select Manage Add-Ons.
3. Find the Codebeamer toolbox name. Click the 3 vertical dots and select Uninstall.
4. Click Yes to confirm.
Codebeamer - Simulink Plugin Working Conditions
The plugin requires only one running Matlab/Simulink instance on the client machine when the user links the requirement with the models or tests.
Codebeamer Project Setup
Integration Setup
The integration uses proxy items in Codebeamer, which act as surrogates for the linked items in Simulink, Simulink Test, or Data Dictionary. Creating these items in Codebeamer ensures bidirectional traceability and provides comprehensive traceability within Codebeamer, from requirements through design to verification.
The proxy items require a predefined structure in Codebeamer. The necessary configuration is described in the upcoming sections
Project Structure
The plugin requires four trackers in Codebeamer for the integration:
• A tracker to store Simulink model-related proxy items.
• A tracker to store Simulink test-related proxy items.
• A tracker to store test run results from Simulink.
• A configuration tracker that contains the configuration item.
Example:
Mandatory Fields in the Simulink Integration with Codebeamer Projects
The following fields must be defined in the Simulink Model and Simulink Test Case trackers:
• MatlabID (text field)—ID of the models and tests in Simulink.
• BlockModifiedOn (text field)—The date and time of the last modification of the Simulink artifact in Simulink.
• Subject (reference field)—A reference field to connect models and tests with requirements.
Example:
Setting up Reference Structure in Codebeamer
The Simulink Design and Simulink Test Case ttrackers can be referenced to any requirement tracker in any project. References must be set up for the Subject field in the tracker configuration. You can use any reference type fields, but the integration will work with Subject.
Example:
Codebeamer Project Configuration Item
A configuration item is required in Codebeamer. The following information is specified for the Codebeamer project that contains the proxy items:
Field Name | Description |
---|
ModelTrackerID | ID of the Simulink model tracker. |
TestCaseTrackerID | ID of the Simulink test tracker. |
TestRunTrackerID | ID of the Simulink test run results. |
ModelRemovedState | Target state for removed Simulink blocks. |
ModelRecoveredState | Target state for newly added or recovered Simulink blocks. |
TestRemovedState | Target state for removed Simulink tests. |
TestRecoveredState | Target state for newly added or recovered Simulink tests. |
The type of the above listed fields is text.
Configuration Item Values
The tracker IDs belong to:
• A tracker to store Simulink model-related proxy items
• A tracker to store Simulink test-related proxy items
• A tracker to store test run results from Simulink
Example:
The Removed states represent the target state of the proxy item in Codebeamer if the related Simulink artifact is no longer covered with a requirement or is deleted. The Recovered states represent the target state if a proxy item is covered with a requirement.
Example:
The ID of the configuration item is the Config-ItemID value defined in the settings.
Linking a Codebeamer Requirement to Simulink Models and Tests
Configuring the Codebeamer Toolbox
1. Open a Simulink model.
2. Click > > .
Setup window:
3. Enter the Server URL, Config-ItemID, and User Name fields. These values are saved and must be added only once.
| From Codebeamer 2.2, the URL may end with cb/. In this case, add cb/ to the Server URL. |
4. Enter the Password before starting.
5. Simulink Callback update is optional but is recommended for the models.
6. The Debug checkbox is optional. Additional communication logs created when selected.
Simulink Callback Update
Clicking the Simulink Callback Update button extends the callbacks of the current Simulink model to track changes in blocks covered by Codebeamer requirements.
The affected callbacks are:
• PreSaveFcn,
• PostSaveFcn,
• CloseFcn.
Debug Option
If Debug checkbox is selected, web communication-related logs are printed into the command window and saved in a log file cblog txt. Additional information logged is when a JSON returns an error code.
Configuring SSO
There are two possibilities in the current release of the plugin:
Internal
1. This is a device authentication workflow where MATLAB obtains the user's bearer token once, and it is refreshed automatically until the refresh token is valid ( typically 24h ).
2. A configuration JSON file, containing details of the OpenID provider. This file must be in the path.
External
1. This approach allows the integration of other applications that provide bearer tokens according to the workflows preferred by users.
The client is responsible for providing the application for token generation.
2. A configuration JSON file must be in the path.
Using the Internal Approach
1. Save the ssoConfig.json file with the following information in the working folder or in MATLAB path.
| See the example Discovery URL and response in the Appendix. |
2. Open Codebeamer plugin settings.
3. Select the SSO checkbox.
4. Enter information in the Server URL and Config Item ID. Click Apply.
5. In a browser, a login window opens.
6. Enter the credentials and click Login.
7. A code will be visible in MATLAB.
8. the Enter Code window opens to enter the code. The code is automatically copied to the clipboard .
9. Click Authorize.
Using the External Approach
1. Save a ssoConfig.json file with the following information in the working folder or in MATLAB path.
2. Open the Codebeamer plugin settings.
3. Select the SSO checkbox.
4. Enter information for the Server URL and Config Item ID. Click Apply.
5. In a browser, a login opens.
6. A two-factor authenticator will be triggered to authenticate the plugin.
| From this point forward, the required steps and actions depend on the implementation of the application providing the token. The application must be provided by the client, and it must adhere to the company’s security policy. |
Linking Codebeamer Requirements to Simulink and Stateflow
Make sure the Codebeamer Toolbox is configured. To create a link to Codebeamer requirement:
1. Select the requirement in Codebeamer to which you would like to create a link.
2. In Simulink, right-click the model item to link to a requirement. Select > .
3. Repeat steps 1 and 2 for other model items.
To view the list of created links,
1. Click the Perspective views icon in the bottom-right corner of the Simulink model.
2. Select Requirements.
Create or Update Backlinks in Codebeamer
1. Click on the > > .
2. New back links appear in the description sections of the corresponding requirements in Codebeamer. Clicking a back link opens Simulink model and highlights the corresponding model item.
Requirement Consistency Check in a Simulink Model
To the view the new version of Codebeamer requirements in Simulink models,
1. Click on the > > .
2. If there is a block with a requirement that was updated since the connection has been established, it is highlighted in the model.
3. You can remove the The highlighting and warning.
4. Right-click the highlighted block and select Clear Codebeamer inconsistency.
Handling Obsolete and Reused Simulink Blocks in Codebeamer
If a connection is deleted in Simulink, the related proxy item is handled accordingly in Codebeamer. Perform the following steps to trigger the status change in Codebeamer.
1. Delete the unnecessary link in Simulink.
2. Execute Publishlinks or CIActions command to handle the removed connection.
3. This triggers a status change on the related proxy item.
4. If the Simulink model or block covered with requirement again, another status change is triggered.
Link Codebeamer Requirement to Data Dictionary
1. Make sure the Codebeamer Toolbox is configured. To create a link to Codebeamer requirement:
2. Select the requirement in Codebeamer for which you want to create a link.
3. In Data Dictionary, right-click the model item that must be linked to a requirement select > .
4. Repeat steps 1, 2 and 3 for other data objects.
| Creation and update of back link can be maintained for Data Dictionary only via Matlab API. See the following section.. |
Test Cases Linking to Codebeamer Requirements
Make sure the Codebeamer Toolbox is configured. To create a link from a test case to Codebeamer requirement:
1. In Codebeamer, select the requirement to which you would like to create a link
2. Open the model test cases in the Test Manager.
3. Select a test case, or create a new one.
4. Under Requirements, click on > .
5. Select Codebeamer Item in the Document type drop-down menu.
6. Click Use current. The rest of the requirement information will be passed automatically.
7. Click > . Requirement link will be saved for the test case.
8. Repeat these steps to add links to other test cases, if needed.
Clicking the link opens the corresponding requirement in Codebeamer.
| Creation and Update of backlink can be maintained for Data Dictionary only via Matlab API. See below. |
Batch Synchronizing Simulink Model and Test Data to Codebeamer
There is a Matlab API codebeamer.rmi.updateProxyLinks introduced to synchronize multiple Simulink Models and Simulink Tests into Codebeamer in one step. This API can also be used for automated publishing by a CI/CD pipeline.
1. Specify the following input arguments:
◦ artifactName—an array of Model and Test files, or Simulink Project File, which contains linked requirements that need to be snychronized.
◦ UserName—Codebeamer's username of user,
◦ Password—Codebeamer's password for the username,
◦ URL— the URL of the target Codebeamer instance,
◦ trackerID— the ID of the configuration item in Codebeamer: Config-ItemID
2. The API can be called from Command Line or embedded into a script.
Example:
Appendix
Example Project
The following Codebeamer project is an example for the integration. In this project, all the required Trackers, References, and Mandatory fields are setup according to the plugin.
Example Discovery URL
Current Limitations
The following limitations are existing in version 1.1.0.0:
• Consistency checks between Simulink Test and Codebeamer requirements is not supported.
• Consistency checks between Data Dictionary and Codebeamer requirements is not supported.
• Clear Codebeamer inconsistency command does clear Suspected flag in Codebeamer.
• References are suspected in Codebeamer when the proxy item first time backlinked from Simulink.
◦ The suspected flag can be manually cleared by the user after Backlinking.