slreq.callback.ReqIFImportOptions Class
Namespace: slreq.callback
Description
Use objects of the slreq.callback.ReqIFImportOptions
class to adjust the options to use when
import requirements. When you import requirements from a ReqIF™ file, slreq.getCurrentImportOptions
generates an slreq.callback.ReqIFImportOptions
object
that you can use to adjust the options to use during import. You can only access this object
in the PreImportFcn
callback.
The slreq.callback.ReqIFImportOptions
class is a handle
class.
Creation
options
= slreq.getCurrentImportOptions
returns an slreq.callback.ReqIFImportOptions
object if
you are importing requirements from a ReqIF file.
Properties
MappingFile
— Attribute mapping file
string scalar | character vector
Attribute mapping file to use during import, specified as a string scalar or character vector. Specify the full file path for the file.
Attributes:
GetAccess | public |
SetAccess | public |
Attr2ReqProp
— Attribute mapping
containers.Map
object
Attribute mapping from ReqIF attributes to Requirements Toolbox™ properties, specified as a containers.Map
object. For
example, this code creates a containers.Map
object that maps:
ReqSum
toSummary
Desc
toDescription
ID
toCustomId
attrMap = containers.Map(ReqSum="Summary"); attrMap("Desc") = "Description"; attrMap("ID") = "Custom ID";
Example: myImportOptions.Attr2ReqProp = attrMap;
Attributes:
GetAccess | public |
SetAccess | public |
SingleSpec
— Name of single specification to import
string scalar | character vector
Name of the single specification to import from the ReqIF file, specified as a string scalar or character vector. If the ReqIF file has multiple specifications, only this specification is imported.
Attributes:
GetAccess | public |
SetAccess | public |
AsMultipleReqSets
— Option to import into separate requirement sets
0
(default) | 1
Option to import each specification into separate requirement sets, specified as a
1
or 0
of data type
logical
.
If your ReqIF file has multiple specifications and you set this property to
0
, the specifications are combined into one requirement set.
Attributes:
GetAccess | public |
SetAccess | public |
ImportLinks
— Option to import links
1
(default) | 0
Option to import the links from the ReqIF file, specified as a 1
or 0
of data
type logical
.
Attributes:
GetAccess | public |
SetAccess | public |
AutoDetectMapping
— Option to automatically detect mapping
1
(default) | 0
Option to allow Requirements Toolbox to automatically detect the attribute mapping to use based on the contents
of the ReqIF file, specified as a 1
or 0
of data
type logical
.
Attributes:
GetAccess | public |
SetAccess | public |
AsReference
— Option to import as references
1
(default) | 0
Option to import as slreq.Reference
objects, specified as a
1
or 0
of
data type logical
. If 0
,
requirements import as slreq.Requirement
objects.
Attributes:
GetAccess | public |
SetAccess | public |
RichText
— Option to import with rich text
0
(default) | 1
Option to import requirements with rich text, specified as a 1
or
0
of data type logical
.
Attributes:
GetAccess | public |
SetAccess | public |
DocUri
— Resource identifier for requirements document
string scalar | character vector
Resource identifier for external requirements document, specified as a string scalar or character vector.
Attributes:
GetAccess | public |
SetAccess | public |
DocType
— Requirements document custom link type
string scalar | character vector
Requirements document custom link type, returned as a string scalar or character vector.
Attributes:
GetAccess | public |
SetAccess | private |
ReqSet
— Requirement set name
character vector
Requirement set name, returned as a character vector.
Attributes:
GetAccess | public |
SetAccess | private |
PreImportFcn
— Contents of PreImportFcn
callback
string scalar | character vector
Contents of the PreImportFcn
callback for the current Import node, specified as a string scalar or a character vector.
Attributes:
GetAccess | public |
SetAccess | public |
PostImportFcn
— Contents of PostImportFcn
callback
string scalar | character vector
Contents of the PostImportFcn
callback for the current Import node, specified as a string scalar or a character vector.
Attributes:
GetAccess | public |
SetAccess | public |
Examples
Customize ReqIF Import Options
This example shows how to customize ReqIF™ import options by using the PreImportFcn
callback.
Use slreq.import
to import the ReqIF™ file mySpec.reqif
into Requirements Toolbox™. Name the imported requirement set myReqSet
and register the script myPreImportScript
as the PreImportFcn
callback to use during import. Return a handle to the requirement set.
[~,~,rs] = slreq.import("mySpec.reqif",ReqSet="myReqSet",preImportFcn="myPreImportScript");
The script myPreImportScript
uses slreq.getCurrentImportOptions
to get the import options, then specifies the attribute mapping file to use during import.
type myPreImportScript.m
importOptions = slreq.getCurrentImportOptions; importOptions.MappingFile = "myMappingFile.xml";
Return the importOptions
object.
importOptions
importOptions = ReqIFImportOptions with properties: MappingFile: "myMappingFile.xml" Attr2ReqProp: [] SingleSpec: '' AsMultipleReqSets: 0 ImportLinks: 1 AutoDetectMapping: 1 AsReference: 1 RichText: 0 DocUri: 'C:\Users\jdoe\MATLAB\Examples\CustomizeReqIFImportOptionsExample\mySpec.reqif' DocType: 'REQIF' ReqSet: 'myReqSet' PreImportFcn: 'myPreImportScript' PostImportFcn: ''
Version History
Introduced in R2022a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)