Main Content

systemcomposer.rptgen.finder.ProfileResult Class

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

Search result for profiles

Since R2022b

Description

Search result object for information about a profile in a System Composer™ architecture model.

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

Creation

result = ProfileResult creates a search result object for a profile that you find by using a systemcomposer.rptgen.finder.ProfileFinder object.

Note

The find method of the systemcomposer.rptgen.finder.ProfileFinder class creates a search result object for each profile 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

Name of profile, returned as a string.

Data Types: string

Description of profile, returned as a string.

Data Types: string

Stereotypes on profile, returned as an array of strings.

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 ProfileFinder, ProfileResult, StereotypeFinder, and StereotypeResult classes to create a report that finds all profiles in a given architecture model.

import mlreportgen.report.*
import slreportgen.report.*
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.

profilesReport = slreportgen.report.Report(OutputPath=model_name + "_ProfileReport", ...
    CompileModelBeforeReporting=false);
append(profilesReport,TitlePage(Title="Profiles and their Stereotypes in " + model_name));
append(profilesReport,TableOfContents);

Create a chapter to contain all sections related to profiles and their stereotypes.

profileChapter = Chapter(Title="Profiles");

Find all profiles imported into the architecture model.

profileFinder = ProfileFinder(model_name);

while hasNext(profileFinder)
    profile = next(profileFinder);
    profileSection = Section(Title="Profile: " + profile.Name);
    append(profileSection, profile);

Find all stereotypes in a profile.

    stereotypeFinder = StereotypeFinder(profile.Name);
    while hasNext(stereotypeFinder) 
        stereotype = next(stereotypeFinder);
        stereotypeSection = Section(Title=stereotype.Name);
        append(stereotypeSection,stereotype);
        append(profileSection,stereotypeSection);
    end
    
    append(profileChapter,profileSection);
end

Append the chapter to the report and view the generated report.

append(profilesReport,profileChapter);
close(profilesReport);
rptview(profilesReport);

Version History

Introduced in R2022b