You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Codebeamer - Simulink Integration

This page provides guidance and help for the installation and first steps.

Prerequisites

The necessary versions are the followings:

  • Matlab / Simulink 2022b or newer versions
    • May work with older versions, but not tested.
  • 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 – PTC product
  • Required to include Simulink Test:
    • Simulink Check
    • Simulink Coverage
    • Simulink Test
    • Stateflow

User Guide

Licensing and Permissions

The usage of the integration will be limited to users with Advanced or Premium licenses. The user shall 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 gets installed, and a pop-up window will inform about successful installation.
  4. Configuration file in the home directory (C:\Users\user) shall be deleted. The file extension is “.mlcbconfig”.
  5. Restart MATLAB to enable the changes.

Codebeamer Toolbox Uninstallation

To uninstall the Codebeamer Toolbox,

  1. Open MATLAB
  2. Click tab Home > Environment section > click down arrow below the Add-Ons button > select Manage Add-Ons.
  3. Find the Codebeamer toolbox name > click the 3 vertical dots > Uninstall
  4. Click Yes to confirm uninstallation.

Codebeamer - Simulink plugin working conditions

The plugin requires to have only one running Matlab / Simulink instance on the client machine when the user is making the connection between the requirement and models or tests.

Codebeamer Project Setup

Project Structure

The plugin requires four trackers in Codebeamer for the integration:

  • Tracker to store Simulink Models related proxy items,
  • Tracker to store Simulink Tests related proxy items,
  • Tracker to store test run results from Simulink,
  • Configuration tracker which contains the configuration item.

Example:

Mandatory Fields in Simulink Integration Codebeamer Projects

The following fields shall be present in the Simulink Model and Simulink Test Case trackers:

  • MatlabID (Text field): ID of the Models and Tests in Simulink,
  • BlockModifiedOn (Text field): Date and Time of the last modification of the Simulink artifact in Simulink,
  • Subject (Reference field): Reference field to connect models and tests with requirements.

Example:


Reference Structure Setup in Codebeamer

The Simulink Design and Simulink Test Case trackers can be referenced to any requirement tracker in any project. References shall be set up for the Subject field in the tracker configuration. Note, that any reference type fields can be used, but the integration will work with Subject.

Example:

Codebeamer Project Configuration Item

A configuration item is required in Codebeamer. The following information shall be 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 above listed fields's type is text.


Configuration Item Values

The tracker IDs belong to:

  • Tracker to store Simulink Models related proxy items,
  • Tracker to store Simulink Tests related proxy items,
  • Tracker to store test run results from Simulink

Example:


The Removed states are representing the target state of the proxy item in Codebeamer if the related Simulink artifact is not covered with requirement anymore or deleted. The Recovered states are representing the target state if a proxy item if it covered with requirement again.

Example:


The ID of the configuration item will be the Config-ItemID value in the settings.


How to link Codebeamer Requirement to Simulink Models and Tests

Codebeamer Toolbox Configuration

  1. Open a Simulink model.
  2. Click Tool menu > Codebeamer > Settings
  3. Setup window:
    • alt='A screenshot of a computer Description automatically generated' width='393' height='158' }]
  4. Fill in the Server URL, Config-ItemID and User Name fields. These values are saved and need to be added once.
  5. Fill the Password before starting.
  6. Simulink Callback update is optional but recommended for the models. This is enabling the change detection for the models.

Links to Codebeamer Requirements

Make sure the CodeBeamer Toolbox is configured. To create a link to Codebeamer requirement:

  1. Select the requirement in Codebeamer you would like to create a link to.
  2. In Simulink, right click on the model item that needs to get linked to a requirement > select Requirements > Link to Requirement in Codebeamer.
  3. Repeat steps 1 and 2 for other model items.

All created links can be viewed in a list:

  1. Click on the gray Perspective views icon in the right bottom corner of Simulink model.
  2. Select Requirements.

Tutorial: LinksToCodebeamerRequirement.mp4

Create or Update Backlinks in Codebeamer

  1. Click on the Tool menu > Codebeamer > PublishLinks.
  2. New backlinks appear in the description sections of corresponding requirements in Codebeamer. Clicking on the backlink opens Simulink model and highlights corresponding model item.

Tutorial: CreateOrUpdateBacklinks.mp4

Requirement Consistency Check in Simulink Model

The new version of Codebeamer requirements can be detected in Simulink models:

  1. Click on the Tool menu > Codebeamer > Check Requirement Consistency.
  2. If there is a block with requirement updated since connection, it is highlighted in the model.
  3. The highlight and warning can be removed.
  4. Right click on the highlighted block and select Clear Codebeamer inconsistency.

Tutorial: RequirementConsistencyCheckInSimulink.mp4

Handling of Obsolete and Reused Simulink Blocks in Codebeamer

In case a connection is deleted in Simulink, the related proxy item is handled accordingly 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.

Tutorial: HandlingOfObsoleteAndReusedProxyItems.mp4

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 you would like to create a link to.
  2. Open the model test cases in the Test Manager.
  3. Select a specific test case if exists, or create a new one.
  4. Under Requirements, click on +Add > New.
  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 Apply > OK. Requirement link will be saved for the test case.
  8. Repeat these steps to add links to other test cases, if needed.
  9. Clicking the link will open corresponding requirement in Codebeamer.

Tutorial: TestCaseLinkingToCodebeamer.mp4

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. The following input arguments shall be specified:
    • 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,
    • Passsword- 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,
  3. 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.

Simulink_Integration_Project - Release1.0.0.0.zip

Current Limitations

The following limitations are existing in version 1.0.0.0:

  • Consistency checks between Simulink Test and Codebeamer requirements is not supported.
  • Clear Codebeamer inconsistency command does clear Suspected flag in Codebeamer.
  • Reference is suspected when the proxy item first time backlinked to Codebeamer.