Main Content

systemcomposer.rptgen.finder.RequirementLinkResult Class

Namespace: systemcomposer.rptgen.finder
Superclasses: mlreportgen.finder.Result (MATLAB Report Generator)

Search result for requirement links

Since R2022b

Description

Search result object for information about a requirement link in a requirement link set.

The systemcomposer.rptgen.finder.RequirementLinkResult class is a handle class.

Creation

result = RequirementLinkResult creates a search result object for a requirement link that you find by using a systemcomposer.rptgen.finder.RequirementLinkFinder object.

Note

The find method of the systemcomposer.rptgen.finder.RequirementLinkFinder class creates a search result object for each requirement link that it finds. You do not need to create this object yourself.

Properties

expand all

Universal unique identifier (UUID) of result element, returned as a string.

Data Types: string

Source of link, returned as a string.

Data Types: string

Type of link, returned as a string.

Data Types: string

Destination of link, returned as a string.

Data Types: string

Tag to associate with result, specified as a string. You can use this property to attach additional information to a result. You can set this property to any value that meets your requirements.

Data Types: string

Methods

expand all

Examples

collapse all

Use the RequirementSetFinder, RequirementSetResult, RequirementLinkFinder, and RequirementLinkResult classes to create a report that finds all requirements in a given requirement set and link set.

import mlreportgen.report.*
import slreportgen.report.*
import slreportgen.finder.*
import systemcomposer.rptgen.finder.*

Open the scKeylessEntrySystem project.

prj = openProject("scKeylessEntrySystem");
model_name = "KeylessEntryArchitecture";
mdl = systemcomposer.loadModel(model_name);

Create a report and append a title page and table of contents.

reqReport = slreportgen.report.Report(output="RequirementAnalysisReport", ...
    CompileModelBeforeReporting=false);
append(reqReport,TitlePage(Title="Requirement Sets and Link Sets in " + model_name));
append(reqReport,TableOfContents);

Create a chapter called Requirement Analysis.

reqChapter = Chapter("Requirement Analysis");

Create a section for requirement sets and use the finder, result, and reporter classes to find all requirements in the FunctionalRequirements.slreqx requirement set. Append the Requirement Sets section to the Requirement Analysis chapter.

reqSetSection = Section("Requirement Sets");
reqSetFinder = RequirementSetFinder("FunctionalRequirements.slreqx");
reqSetResult = find(reqSetFinder);
reqSetReporter = reqSetResult.getReporter;

append(reqSetSection,reqSetReporter);
append(reqChapter,reqSetSection);

Create a section for requirement links and use the finder, result, and reporter classes to find all requirement links in the KeylessEntryArchitecture.slmx requirement links set. Append the Requirement Links section to the Requirement Analysis chapter.

reqLinkSection = Section("Requirement Links");
reqLinkFinder = RequirementLinkFinder("KeylessEntryArchitecture");
reqLinkResult = find(reqLinkFinder);
reqLinkReporter = systemcomposer.rptgen.report.RequirementLink(Source=reqLinkResult);

append(reqLinkSection,reqLinkReporter);
append(reqChapter,reqLinkSection);

Append the Requirement Analysis chapter to the RequirementAnalysisReport and view the report.

append(reqReport,reqChapter);
close(reqReport);
rptview(reqReport);

Version History

Introduced in R2022b