Main Content

importProfile

Class: slreq.ReqSet
Package: slreq

Assign profile to requirement set

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.

Save the location of the current folder as a variable.

initFolder = pwd;

Open the ShortestPath project.

slreqShortestPathProjectStart;

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,strcat(initFolder,"\TestReqProfile"));

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

Version History

Introduced in R2022b