Main Content

rmi

Interact programmatically with Requirements Management Interface

Description

example

reqlinks = rmi('createEmpty') creates an empty instance of the requirement links data structure.

example

reqlinks = rmi('get',object) returns the requirement links data structure for object.

reqlinks = rmi('get',sig_builder,group_idx) returns the requirement links data structure for the Signal Builder group specified by the index group_idx.

example

rmi('set',model,reqlinks) sets reqlinks as the requirements links for model.

rmi('set',sig_builder,reqlinks,group_idx) sets reqlinks as the requirements links for the signal group group_idx in the Signal Builder block sig_builder.

example

rmi('cat',model,reqlinks) adds the requirements links in reqlinks to existing requirements links for model.

cnt = rmi('count',object) returns the number of requirements links for object.

rmi('clearAll',object) deletes all requirements links for object.

rmi('clearAll',object,'deep') deletes all requirements links in the model containing object.

rmi('clearAll',object,'noprompt') deletes all requirements links for object and does not prompt for confirmation.

rmi('clearAll',object,'deep','noprompt') deletes all requirements links in the model containing object and does not prompt for confirmation.

cmdStr = rmi('navCmd',object) returns the MATLAB® command cmdStr used to navigate to object.

[cmdStr,titleStr] = rmi('navCmd',object) returns the MATLAB command cmdStr and the title titleStr that provides descriptive text for object.

object = rmi('guidlookup',model,guidStr) returns the object name in model that has the globally unique identifier guidStr.

rmi('highlightModel',object) highlights all of the objects in the parent model of object that have requirement links.

rmi('unhighlightModel',object) removes highlighting of objects in the parent model of object that have requirement links.

rmi('view',object,index) accesses the requirement numbered index in the requirements document associated with object.

dialog = rmi('edit',object) displays the Requirements dialog box for object and returns the handle of the dialog box.

guidStr = rmi('guidget',object) returns the globally unique identifier for object. A globally unique identifier is created for object if it lacks one.

example

rmi('report',model) generates a Requirements Traceability report in HTML format for model.

rmi('report',matlabFilePath) generates a Requirements Traceability report in HTML format for the MATLAB code file specified by matlabFilePath.

rmi('report',dictionaryFile) generates a Requirements Traceability report in HTML format for the Simulink® data dictionary specified by dictionaryFile.

rmi('projectreport') generates a Requirements Traceability report in HTML format for the current project. The top-level page of this report has HTTP links to reports for each project item that has requirements traceability associations. For more information, see Create Requirements Traceability Report for A Project.

rmi('setup') configures RMI for use with MATLAB and installs the interface for use with IBM® DOORS®.

rmi('setup','doors',false) configures RMI for use with MATLAB and installs the interface for use with IBM DOORS without using the interactive setup.

rmi register typename registers the custom link type or custom document domain type name specified by the function typename. For more information, see Define Custom Document Interface for Direct Linking to Requirements and Define Custom Document Interface for Importing Requirements.

rmi unregister typename removes the custom link type or custom document domain type name specified by the function typename. For more information, see Define Custom Document Interface for Direct Linking to Requirements and Define Custom Document Interface for Importing Requirements.

rmi('linktypelist') displays a list of the currently registered link types. The list indicates whether each link type is built-in or custom, and provides the path to the function used for its registration.

number_problems = rmi('checkdoc') checks validity of links to Simulink from a requirements document in Microsoft® Word, Microsoft Excel®, or IBM DOORS. It prompts for the requirements document name, returns the total number of problems detected, and opens an HTML report in the MATLAB Web browser. For more information, see Validate Requirements Links in a Requirements Document.

number_problems = rmi('checkdoc',docName) checks validity of links to Simulink from the requirements document specified by docName. It returns the total number of problems detected and opens an HTML report in the MATLAB Web browser. For more information, see Validate Requirements Links in a Requirements Document.

rmi('check',matlabFilePath) checks consistency of traceability links associated with MATLAB code lines in the .m file matlabFilePath, and opens an HTML report in the MATLAB Web browser.

rmi('check',dictionaryFile) checks consistency of traceability links associated with the Simulink data dictionary dictionaryFile, and opens an HTML report in the MATLAB Web browser.

rmi('doorssync',model) opens the DOORS synchronization settings dialog box, where you can customize the synchronization settings and synchronize your model with an open project in an IBM DOORS database.

[objHs,parentIdx,isSf,objSIDs] = rmi('getObjectsInModel',model) returns a list of Simulink objects that may be considered for inclusion in the IBM DOORS surrogate module.

[objName,objType] = rmi('getObjLabel',object) returns Simulink object Name and Type information for the Simulink object that you link to with a third-party requirements management application.

example

rmi('setDoorsLabelTemplate',template) specifies a new custom template for labels of requirements links to IBM DOORS. The default label template contains the section number and object heading for the DOORS requirement link target. To revert the link label template back to the default, enter rmi('setDoorsLabelTemplate','') at the MATLAB command prompt.

template = rmi('getDoorsLabelTemplate') returns the currently specified custom template for labels of requirements links to IBM DOORS.

label = rmi('doorsLabel',moduleID,objectID) generates a label for the requirements link to the IBM DOORS object specified by objectID in the DOORS module specified by moduleID, according to the current template.

example

totalModifiedLinks = rmi('updateDoorsLabels',model) updates all IBM DOORS requirements links labels in model according to the current template.

example

rmi httpLink activates the internal HTTP server that you can use to navigate to linked items in MATLAB or Simulink from backlinks in a browser-based third-party requirements tool that uses HTTP protocol. Backlink navigation on the HTTPS server is enabled by default.

Note

Alternatively, you can active the internal HTTP server by using the rmipref function to set the UnsecureHttpRequests preference to true. When the UnsecureHttpRequests preference is true, MATLAB activates the internal HTTP server on startup.

example

status = rmi("httpLink","status") returns the port numbers for the internal HTTP server. If the port number is 0, the server is not active.

Examples

collapse all

Get a requirement associated with a block in the slvnvdemo_fuelsys_officereq model, change its description, and save the requirement back to that block. Define a new requirement link and add it to the existing requirements links in the block.

Get requirement link associated with the Airflow calculation block in the slvnvdemo_fuelsys_officereq example model.

openExample("slvnvdemo_fuelsys_officereq.slx")
blk_with_req = ['slvnvdemo_fuelsys_officereq/fuel rate controller/'...
'Airflow calculation']
reqts = rmi('get',blk_with_req);

Change the description of the requirement link.

reqts.description = 'Mass airflow estimation';

Save the changed requirement link description for the Airflow calculation block.

rmi('set',blk_with_req,reqts);

Create new requirement link to example document fuelsys_requirements2.htm.

new_req = rmi('createempty');
new_req.doc = 'fuelsys_requirements2.htm';
new_req.description = 'New requirement';

Add new requirement link to existing requirements links for the Airflow calculation block.

rmi('cat',blk_with_req, new_req);

Create HTML report of requirements traceability data in example model.

Create an HTML requirements report for the slvnvdemo_fuelsys_officereq example model.

openExample("slvnvdemo_fuelsys_officereq.slx")
rmi('report','slvnvdemo_fuelsys_officereq');

The MATLAB Web browser opens, showing the report.

Specify a new label template for links to requirements in DOORS, and update labels of all DOORS requirements links in your model to fit the new template.

Specify a new label template for requirements links to IBM DOORS so that new links to DOORS objects are labeled with the corresponding module ID, object absolute number, and the value of the ‘Backup’ attribute.

rmi('setDoorsLabelTemplate','%m:%n [backup=%<Backup>]');

Specify a new label template for requirements links to IBM DOORS and set the maximum label length to (for example) 200 characters.

rmi('setDoorsLabelTemplate','%h %200');

Update existing DOORS requirements link labels to match the new specified template in your model example_model. When updating labels, DOORS must be running and all linked modules must be accessible for reading.

rmi('updateDoorsLabels',example_model);

Get the internal HTTP server status.

status = rmi("httpLink","status")
status = struct with fields:
     httpPort: 0
    httpsPort: 31515

Activate the internal HTTP server.

rmi httpLink

Get the internal HTTP server status.

status = rmi("httpLink","status")
status = struct with fields:
     httpPort: 31415
    httpsPort: 31515

Input Arguments

collapse all

Simulink model or Stateflow chart with which requirements can be associated, specified as a character vector or handle.

Example: 'slvnvdemo_officereq'

Data Types: char

Model object with which requirements can be associated, specified as a character vector or handle.

Example: 'slvnvdemo_fuelsys_officereq/fuel rate controller/Airflow calculation'

Data Types: char

Signal Builder block containing signal group with requirements traceability associations, specified as a character vector or handle.

Data Types: char

Signal Builder group index, specified as a scalar.

Example: 2

Data Types: char

MATLAB code file with requirements traceability associations, specified as the path to the file.

Data Types: char

Simulink data dictionary with requirements traceability associations, specified as a character vector containing the file name and, optionally, path of the dictionary.

Data Types: char

Globally unique identifier for model object object, specified as a character vector.

Example: GIDa_59e165f5_19fe_41f7_abc1_39c010e46167

Data Types: char

Index number of requirement linked to model object, specified as an integer.

Requirements document in external application, specified as a character vector that represents one of the following:

  • IBM DOORS module ID.

  • path to Microsoft Word requirements document.

  • path to Microsoft Excel requirements document.

For more information, see Validate Requirements Links in a Requirements Document.

Label for links to requirements in IBM DOORS, specified as a character vector.

Data Types: char

Template label for links to requirements in IBM DOORS, specified as a character vector.

You can use the following format specifiers to include the associated DOORS information in your requirements links labels:

%hObject heading
%tObject text
%pModule prefix
%nObject absolute number
%mModule ID
%PProject name
%MModule name
%UDOORS URL
%<ATTRIBUTE_NAME>Other DOORS attribute you specify

Example: '%m:%n [backup=%<Backup>]'

Data Types: char

IBM DOORS module, specified as the unique DOORS module ID.

Data Types: char

IBM DOORS object in the DOORS module moduleID, specified as the locally unique DOORS ID.

Data Types: char

Output Arguments

collapse all

Command used to navigate to model object object, returned as a character vector.

Example: rmiobjnavigate('slvnvdemo_fuelsys_officereq.slx', 'GIDa_59e165f5_19fe_41f7_abc1_39c010e46167');

Textual description of model object with requirements links, returned as a character vector.

Example: slvnvdemo_fuelsys_officereq/.../Airflow calculation/Pumping Constant (Lookup2D)

Globally unique identifier for model object object, returned as a character vector.

Example: GIDa_59e165f5_19fe_41f7_abc1_39c010e46167

Requirements dialog box for model object object, returned as a handle to the dialog box.

Total count of invalid links detected in external document docName.

For more information, see Validate Requirements Links in a Requirements Document.

List of numeric handles, returned as an array.

Model hierarchy indices, returned as an array.

Logical array that indicates which list positions correspond to which Stateflow objects.

Session-independent Simulink IDs, returned as an array.

Internal HTTP and HTTPS server status, returned as a structure with these fields:

HTTP port number, returned as a double. If the HTTP port number is 0, the service is not active.

HTTPS port number, returned as a double.

Version History

Introduced in R2006b

expand all