Main Content

importProfile

Class: slreq.ReqSet
Namespace: slreq

Assign profile to requirement set

Since R2022b

Syntax

importProfile(rs,fileName)

Description

importProfile(rs,fileName) assigns the profile, fileName, to the requirement set rs.

Input Arguments

expand all

Requirement set, specified as an slreq.ReqSet object.

Profile file name, specified as a string scalar or character vector.

Example: "myProfile.xml"

Examples

expand all

This example shows how to assign a profile to a requirement set and get and set stereotype property values for requirements.

Open the ShortestPath project.

openProject("ShortestPath");

Load the shortest_path_tests_reqs requirement set.

rs = slreq.load("shortest_path_tests_reqs");

Assign the TestReqProfile profile to the shortest_path_tests_reqs requirement set.

importProfile(rs,"../TestReqProfile.xml");

Find the requirement with index 2.1.1. Apply the TestRequirement stereotype to the requirement.

testReq = find(rs,Index="2.1.1");
testReq.Type = "TestReqProfile.TestRequirement";

Get the value of the Reviewed stereotype property.

val = getAttribute(testReq,"TestReqProfile.TestRequirement.Reviewed")
val = 
0

Set the value of the Reviewed stereotype property to 1.

setAttribute(testReq,"TestReqProfile.TestRequirement.Reviewed",1)

Tips

  • To assign profiles to link sets, use the importProfile method of slreq.LinkSet.

Version History

Introduced in R2022b