Documentation Center

  • Trials
  • Product Updates

rmi

Interact programmatically with Requirements Management Interface

Syntax

  • reqlinks = rmi('createEmpty') example
  • reqlinks = rmi('get', model) example
  • reqlinks = rmi('get', sig_builder, group_idx)
  • rmi('set', model, reqlinks) example
  • rmi('set', sig_builder, reqlinks, group_idx)
  • rmi('cat', model, reqlinks) example
  • cnt = rmi('count', model)
  • rmi('clearAll', object)
  • rmi('clearAll', object, 'deep')
  • rmi('clearAll', object, 'noprompt')
  • rmi('clearAll', object, 'deep', 'noprompt')
  • cmdStr = rmi('navCmd', object)
  • [cmdStr, titleStr] = rmi('navCmd', object)
  • object = rmi('guidlookup', model, guidStr)
  • rmi('highlightModel', object)
  • rmi('unhighlightModel', object)
  • rmi('view', object, index)
  • dialog = rmi('edit', object)
  • guidStr = rmi('guidget', object)
  • rmi('report', model) example
  • rmi('report', matlabfilepath)
  • rmi('projectreport')
  • rmi setup
  • rmi register linktypename
  • rmi unregister linktypename
  • rmi linktypelist
  • number_problems = rmi('checkdoc')
  • number_problems = rmi('checkdoc', docName)
  • rmi('check', matlabfilepath)
  • rmi('doorssync', model)
  • rmi('setDoorsLabelTemplate', template) example
  • template = rmi('getDoorsLabelTemplate')
  • label = rmi('doorsLabel', moduleID, objectID)
  • totalModifiedLinks = rmi('updateDoorsLabels', model) example

Description

example

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

example

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

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', model) returns the number of requirements links for model.

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 string cmdStr used to navigate to object.

[cmdStr, titleStr] = rmi('navCmd', object) returns the MATLAB command string cmdStr and the title string 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('projectreport') generates a Requirements Traceability report in HTML format for the current Simulink® Project. The master 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 Simulink Project.

rmi setup configures RMI for use with your MATLAB software and installs the interface for use with the IBM® Rational® DOORS® software.

rmi register linktypename registers the custom link type specified by the function linktypename. For more information, see Custom Link Type Registration.

rmi unregister linktypename removes the custom link type specified by the function linktypename. For more information, see Custom Link Type Registration.

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 Rational 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('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 Rational DOORS database. See rmi.doorssync for information about synchronizing your model with DOORS at the MATLAB command line.

example

rmi('setDoorsLabelTemplate', template) specifies a new custom template for labels of requirements links to IBM Rational 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 Rational DOORS.

label = rmi('doorsLabel', moduleID, objectID) generates a label for the requirements link to the IBM Rational 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 Rational DOORS requirements links labels in model according to the current template.

Examples

expand all

Requirements Links Management in Example Model

Get a requirement associated with a block in the slvnvdemo_fuelsys_htmreq 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_htmreq example model.

slvnvdemo_fuelsys_htmreq;
blk_with_req =  ['slvnvdemo_fuelsys_htmreq/fuel rate' 10 '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 = 'A new requirement';

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

rmi('cat', blk_with_req, new_req);

Requirements Traceability Report for Example Model

Create HTML report of requirements traceability data in example model.

Create an HTML requirements report for the slvnvdemo_fuelsys_htmreq example model.

rmi('report', 'slvnvdemo_fuelsys_htmreq');

The MATLAB Web browser opens, showing the report.

Labels for Requirements Links to IBM Rational DOORS

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 Rational 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>]');

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);

Input Arguments

expand all

model — Simulink or Stateflow® model with which requirements can be associatedname | handle

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

Example: 'slvnvdemo_officereq'

Data Types: char

object — Model object with which requirements can be associatedname | handle

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

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

Data Types: char

sig_builder — Signal Builder block containing signal group with requirements traceability associationsname | handle

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

Data Types: char

group_idx — Signal Builder group indexinteger

Signal Builder group index, specified as a scalar.

Example: 2

Data Types: char

matlabfilepath — MATLAB code file with requirements traceability associationspath

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

Example:

Data Types: char

guidStr — Globally unique identifier for model objectstring

Globally unique identifier for model object object, specified as a string.

Example: GIDa_59e165f5_19fe_41f7_abc1_39c010e46167

Data Types: char

index — Index number of requirement linked to model objectinteger

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

docName — Requirements document in external applicationfile name | path

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

  • IBM Rational 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.

template — Template label for links to requirements in IBM Rational DOORSstring

Template label for links to requirements in IBM Rational DOORS, specified as a string.

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

moduleID — IBM Rational DOORS moduleDOORS module ID

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

Example:

Data Types: char

objectID — IBM Rational DOORS objectDOORS object ID

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

Example:

Data Types: char

Output Arguments

expand all

Requirement links data, returned as a structure array with the following fields:

doc

String identifying requirements document

id

String defining location in requirements document. The first character specifies the identifier type:

First
Character
IdentifierExample

?

Search text, the first occurrence of which is located in requirements document

'?Requirement 1'

@

Named item, such as bookmark in a Microsoft Word file or an anchor in an HTML file

'@my_req'

#

Page or item number

'#21'

>

Line number

'>3156'

$

Worksheet range in a spreadsheet

'$A2:C5'

linked

Boolean value specifying whether the requirement link is accessible for report generation and highlighting:

1 (default). Highlight model object and include requirement link in reports.
0
description

String describing the requirement

keywords

Optional string supplementing description

reqsys

String identifying the link type registration name; 'other' for built-in link types

cmdStr — Command string used to navigate to model objectstring

Command string used to navigate to model object object, returned as a string.

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

titleStr — Textual description of model object with requirements linksstring

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

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

guidStr — Globally unique identifier for model objectstring

Globally unique identifier for model object object, returned as a string.

Example: GIDa_59e165f5_19fe_41f7_abc1_39c010e46167

dialog — Requirements dialog box for model objecthandle

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

number_problems — Total count of invalid links detected in external documentinteger

Total count of invalid links detected in external document docName.

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

Total count of DOORS requirements links updated with new label template.

See Also

| | | | | | |

Was this topic helpful?