Mathworks Simulink Connector Update
We recently updated the Mathworks Simulink Connector for Polarion to version 2.2. This version contains some new and exciting capabilities that I wanted to share with you.
Last year, we introduced a new concept to the connector that allowed anyone to extend out its functionality. We have used that functionality ourselves to introduce a number of new features in version 2.2.
These being:
- An ability to either link or publish the Simulink model artifacts to multiple Polarion servers on the fly
- An ability to either link or publish the Simulink model artifacts to multiple Polarion projects on the fly.
- An ability to publish the Simulink model artifacts to different Polarion Work-items on the fly.
- Specify a different Polarion search query (used when linking) on the fly.
Figure 1: New menu options available in Simulink
This is very helpful, as it allows a Simulink user to support multiple Polarion projects from the same Mathwork Simulink model. One can quickly create links and publish models on the fly, rather than having to reconfigure the Polarion settings window for each Polarion project.
Before we see how you set up these different configurations, let me start by saying that the Polarion connector settings inside Simulink remain unchanged. As a refresher, here is where we specify the default Polarion server, project, work-item creation type and work-item search query. In addition, we also specify the username and password for the Polarion server we have defined. We will refer to these as the default settings.
Figure 2: Default settings window for the Polarion connector
As you can see in Figure 1, the Simulink user now has multiple options available to them for linking Simulink model artifacts to existing Polarion work-items. There is the option to use the default settings. Those that are found in the Polarion settings window (see figure 2), or they have the option to link to 3 other “configurations”.
Figure 3: New menu options available to the Simulink user
To define these different menu options, you need to open the “extension.m” file, located in the Polarion Simulink connector installation folder, using your favorite text editor. Locate the ProjectsConfigurations function (normally at the start of the file) which defines a menu label, project name, workitem type used creation, search query and server URL.
Figure 4: Snapshot of extension.m
In the example above, I’ve used the following definition.
function result = ProjectsConfigurationresult = {
% Label %ProjectID %WIType for creation %Default Query %Base Server URL (default if not specified)
‘Simulink_Demo_2(localhost)/SimulinkObject2/System Requirement’, ‘Simulink_Demo_2’, ‘simulinkObject2’, ‘type:systemRequirement’, ”;
‘Simulink_Demo_3(localhost)/SimulinkObject3/Task’, ‘Simulink_Demo_3’, ‘simulinkObject3’, ‘type:task’, ”;
‘MyPolarionWhitfield(my_polarion_server.com)/Task/Task’, ‘MyPolarionWhitfield’, ‘task’, ‘type:task’, ‘https://my_polarion_server.com’;
};
end
If we take the first definition as an example:
‘Simulink_Demo_2(localhost)/SimulinkObject2/System Requirement’ is the label that will be used in the Polarion menu name.
‘Simulink_Demo_2’ is the polarion project ID used for linking or publishing
‘simulinkObject2’ is the work-item type used for publishing
‘type:systemRequirement’ is the Work-item used for query search
‘ ‘ = we will use default Polarion server URL specified in the connector settings window (see Figure 2).
You can specify as many combinations of these configurations as you wish in the extension.m file. I would strongly recommend you use descriptive names for your labels however. This will then prevent accidental publishing or linking to Polarion. Note that for each project and Polarion server you specify, the connector will use you’re default user name and password. Therefore, you will need to make sure you have the correct logins for all the Polarion servers and projects you intent to either publish or link too. In addition the extension.m file can be moved from the default installation folder, however ensure it is properly defined in your Matlab path definition, with appropriate priority.
Simulink supports the ability to link a model artifact to multiple end points. So in the example below (See figure 5), the integrator block has 3 outgoing Polarion links. Two of which, link to two different Polarion projects on the default Polarion server. The third links to a Polarion project on a different server to the default.
Figure 5: Simulink link editor
That’s it for now, please be sure to check back on this blog in the coming weeks, as I will be providing more tips and tricks on how you can customize the Simulink connector for Polarion even further!
You can download the latest version of the Simulink connector for Polarion here from the extension portal which includes these enhancements discussed.
If you’re new to Polarion, why not try it out for yourself with a free evaluation? For more information, please visit https://polarion.plm.automation.siemens.com/products/alm/demo
Happy customizing!
AW
Comments
Leave a Reply
You must be logged in to post a comment.
Hi,
(Asked this question in another Polarion forum as well, but this seems to be more dedicated)
We try to test this Polarion Connector v2.2 for Simulink together with Simulink 2015b as that’s the version we’re obliged to use for the current project. I got a temporary ‘simulink verification and validation’-license compatible with 2015b to test the connector from your colleague.
I installed the extension v2.2 which should be compatible according to the plugin site as it states it requires Matlab 2013a or later (http://extensions.polarion.com/extensions/173-polarion-connector-for-simulink).
However some errors showed up in the process after setting up polarion settings right. Errors regarded f.e. ‘strlength’- and ‘join’-function being used in the connectors extension.m file. These functions exist from Matlab 2016b so that’s not compatible with 2015b. We worked around that by defining the functions ourselves and got the list with requirements to link to showing up on screen (WorkItemSelectionDialog).
After linking we get the error ‘Function is not defined for java.lang.String’ inputs. And there we stopped. Strings are available from Matlab 2106b. before it was char.
(https://se.mathworks.com/help/matlab/ref/string.html)
Compatibility seems not to be optimal.
So main question is: How to make it work for Simulink 2015b?
Maybe it is better to use an older version of the plugin in this case?
Thanks for the comment. The best thing to do is raise a ticket with your GTAC support and will can look into it for you. Cheers, Adrian