add
类: slreq.ReqSet
命名空间: slreq
将需求添加到需求集
语法
req = add(rs)
req = add(rs,"Artifact",artifactName)
req = add(___,reqProperty,value,...,refPropertyN,valueN)
说明
将需求添加到需求集req
= add(rs
)rs
并返回该需求的句柄。
添加与外部需求文档req
= add(rs
,"Artifact",artifactName
)artifactName
相关的引用需求。
将需求或引用的需求添加到需求集,其属性和属性值分别由 req
= add(___,reqProperty
,value
,...,refPropertyN,valueN)reqProperty
和 value
指定。
输入参数
rs
— 需求集
slreq.ReqSet
对象
需求集,指定为 slreq.ReqSet
对象。
reqProperty
— 需求属性名称
字符串标量 | 字符向量
需求或引用的需求属性名称,指定为字符串标量或字符向量。
您只能输入 slreq.Requirement
属性或 slreq.Reference
属性,其中 SetAccess
属性为 public
。
示例: "Summary"
value
— 需求属性值
字符串标量 | 字符向量
需求或引用的需求属性值,指定为字符串标量或字符向量。
artifactName
— 外部需求文档名称
字符串标量 | 字符向量
外部需求文档名称,指定为字符串标量或字符向量。
输出参量
req
— 需求
slreq.Requirement
对象 | slreq.Reference
对象
需求或引用的需求,以 slreq.Requirement
或 slreq.Reference
对象形式返回。
示例
将需求添加到需求集
此示例显示如何将需求添加到需求集。
加载需求集myReqSet
,它不包含任何需求。
rs = slreq.load("myReqSet");
使用 add
方法将需求添加到需求集。
req = add(rs)
req = Requirement with properties: Type: 'Functional' Id: '#2' Summary: '' Description: '' Keywords: {} Rationale: '' CreatedOn: 20-Apr-2024 08:24:13 CreatedBy: 'batserve' ModifiedBy: 'batserve' IndexEnabled: 1 IndexNumber: [] SID: 2 FileRevision: 1 ModifiedOn: 20-Apr-2024 08:24:13 Dirty: 1 Comments: [0x0 struct] Index: '1'
清理
丢弃需求集而不保存。
discard(rs);
将引用的需求添加到需求集
此示例显示如何将引用需求添加到需求集。
加载crs_req
需求集。
rs = slreq.load("crs_req");
使用 add
方法将引用的需求作为导入节点添加到需求集。将导入节点与 crs_req.docx
文件关联作为外部需求工件。
ref = add(rs,"Artifact","crs_req.docx")
ref = Reference with properties: Id: '' CustomId: '' Artifact: 'crs_req.docx' ArtifactId: '' Domain: 'linktype_rmi_word' UpdatedOn: 19-Apr-2023 15:57:41 CreatedOn: 19-Apr-2023 15:57:41 CreatedBy: '' ModifiedBy: '' IsLocked: 1 Summary: '' Description: '' Rationale: '' Keywords: {} Type: 'Functional' IndexEnabled: 1 IndexNumber: [] SID: 32 FileRevision: 1 ModifiedOn: 19-Apr-2023 15:57:41 Dirty: 0 Comments: [0×0 struct] Index: 'Import2'
将需求添加到需求集时指定属性
此示例显示如何在将需求添加到需求集时指定属性。
加载需求集myReqSet
,它不包含任何需求。
rs = slreq.load("myReqSet");
使用 add
方法将需求添加到需求集。将需求摘要设置为 New Req
,将需求描述设置为 My new requirement
。
req = add(rs,"Summary","New Req","Description","My new requirement")
req = Requirement with properties: Type: 'Functional' Id: '#2' Summary: 'New Req' Description: 'My new requirement' Keywords: {} Rationale: '' CreatedOn: 20-Apr-2024 08:24:14 CreatedBy: 'batserve' ModifiedBy: 'batserve' IndexEnabled: 1 IndexNumber: [] SID: 2 FileRevision: 1 ModifiedOn: 20-Apr-2024 08:24:14 Dirty: 1 Comments: [0x0 struct] Index: '1'
清理
丢弃需求集而不保存。
discard(rs);
将引用的需求添加到需求集时指定属性
此示例显示如何在将引用的需求添加到需求集时指定属性。
加载crs_req
需求集。
rs = slreq.load("crs_req");
使用 add
方法将引用的需求作为导入节点添加到需求集。将导入节点与 crs_req.docx
文件关联作为外部需求工件。将需求摘要设置为 New Import Node
,将需求描述设置为 My new Import node
。
ref = add(rs,"Artifact","crs_req.docx","Summary","New Import Node","Description","My new Import node")
ref = Reference with properties: Id: '' CustomId: '' Artifact: 'crs_req.docx' ArtifactId: '' Domain: 'linktype_rmi_word' UpdatedOn: 17-Apr-2023 16:18:32 CreatedOn: 17-Apr-2023 16:18:32 CreatedBy: '' ModifiedBy: '' IsLocked: 1 Summary: 'New Import Node' Description: 'My new Import node' Rationale: '' Keywords: {} Type: 'Functional' IndexEnabled: 1 IndexNumber: [] SID: 32 FileRevision: 1 ModifiedOn: 17-Apr-2023 16:18:32 Dirty: 0 Comments: [0×0 struct] Index: 'Import2'
提示
版本历史记录
在 R2017b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)