Products

Extensions update: Polarion Connector for Mathworks Simulink

By Adrian Whitfield

I’m pleased to announce an updated version of the Polarion Connector for Mathworks Simulink, available for download here on the Polarion extension site.

Version 2.0 of the Polarion connector for Simulink provides a framework to extend the core functionality by allowing users to write simple custom code. There are 2 types of extension possible:



  • Register additional menu items which will appear in the Polarion context menu found on diagram items.

  •  Add functionality to select or publish actions of the Connector.


To showcase this new functionality, an example of an extended function that supports populating the Mathworks Simulink Link Editor “User tag” field with Polarion work item standard and custom fields is included.

Let’s look into more detail of how this works:


The installation directory includes an Extension.m example file that extends the functionality of the connector to support populating the Simulink link editor User tag field with Polarion Work Item fields. This is useful for users working inside of Simulink to better understand specific information about the Polarion Work Item to which the model element is linked.

Setup:


First, you need to decide which Polarion work item fields you want to export to Mathworks. The fields supported are id, title, type, severity, and any custom fields of type String, Enum, or multi-Enum.


Let’s choose the following custom fields and normal fields, id and type.

02-sw-custom-fields.png


 Open up the Extension.m file in your favorite editor and edit line 58 that specifies which work item fields you would like to export to Simulink.

% method, where list of extractable field ids is listed – use semicolon as separator
function fieldNames = polarionWIFieldList
fieldNames = {‘id’; ‘type’; ‘custom1’; ‘custom2’; ‘custom3’};
end

 Once a Simulink model element is linked to a Polarion Work item, when you now open the Mathworks RMI Link Editor, you will see the User Tag field populated with Polarion Work Item field data.

03-user-tag-field.png

As the above figure shows, the User tag field displays the custom fields from Polarion ALM: ID: SIMU-89; Type: SW Change Request; Custom 1: Test; Custom 2: Carl User,Mark Test; Custom 3: Private

.. and it’s as simple as that. For more information concerning these updates, please check out the documentation that is provided with the Polarion connector for Mathworks Simulink.

The new version of the Polarion connector for Mathworks Simulink is available for free from the Polarion extension portal here.

Happy customizing!

Comments

3 thoughts about “Extensions update: Polarion Connector for Mathworks Simulink
  • Hi Adrian,

     

    Nice to see a new update for this extension, really like the new customization features!

    I wanted to let you know, I have noticed a small error in the Matlab code. More specifically in the Extensions.m file. When trying to opening the context menu in Simulink in order to access the Polarion features, Matlab throws an error stating “Creating a string using double quotes is not supported. Use the string function.” , which causes the Polarion menu to not show up. Going into the extensions.m file and updating line 94 to use single quotation marks instead of double ones fixes the issue quickly.

     

    Old:    attributes{end+1} = char(sprintf(%s: %s, fieldName, fieldValue));

    New:  attributes{end+1} = char(sprintf(%s: %s, fieldName, fieldValue));

     

    Cheers,

    Sam

  • Thanks @Sam_Sil. We have uploaded a new version of the connector to the Extensions site here that addresses the issue with using double quotes instead of single quotes in the extensions.m file.

     

    Cheers, Adrian

Leave a Reply

This article first appeared on the Siemens Digital Industries Software blog at https://blogs.sw.siemens.com/polarion/extensions-update-polarion-connector-for-mathworks-simulink/