Main Content

padv.util.ArtifactAddress

Address for artifact in project

    Description

    Use the padv.util.ArtifactAddress object to represent the address of an artifact in your project.

    Creation

    Description

    addressObj = padv.util.ArtifactAddress(filePath) creates an artifact address by using the file path specified by filePath. You can access information inside the artifact address object by using the object functions listed below.

    This functionality requires CI/CD Automation for Simulink Check.

    example

    addressObj = padv.util.ArtifactAddress(___,Name=Value) creates an artifact address using the settings specified by one or more name-value arguments. For example, to create an artifact address that specifies the name of the project that contains the artifact, specify OwningProjectName=projectName.

    example

    Input Arguments

    expand all

    File path, specified as a string array.

    Example: padv.util.ArtifactAddress(fullfile("tools","sampleChecks.json"))

    Data Types: string

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: padv.util.ArtifactAddress(filePath,OwningProjectName=projectName)

    Project that contains the artifact, specified as a string array.

    You can retrieve the owning project name of an artifact address object by using the getOwningProject object function.

    Example: "ProcessAdvisorExample"

    Data Types: string

    Setting for tracking changes to the artifact, specified as a numeric or logical 1 (true) or 0 (false).

    For more information, see Exclude Files from Change Tracking in Process Advisor.

    Example: false

    Data Types: logical

    Object Functions

    FunctionDescription
    getFileAddress

    Get address of file on disk.

    getFileAddress(addressObj)

    getKey

    Get unique address of artifact.

    getKey(addressObj)

    getOwningProject

    Get name of project that contains the artifact.

    getOwningProject(addressObj)

    getAbsolutePath

    Get the absolute path of the artifact.

    getAbsolutePath(addressObj)

    isFileArtifact

    Determine if input is file.

    isFileArtifact(addressObj)

    isSubFileArtifact

    Determine if input is subfile. A subfile is a part of a larger file.

    For example, a subsystem is a subfile of a model file.

    isSubFileArtifact(addressObj)

    Examples

    collapse all

    Create artifact address for file in project.

    addressObj = padv.util.ArtifactAddress(...
    fullfile("tools","sampleChecks.json"));

    Use artifact address to create padv.Artifact object.

    paArtifact = padv.Artifact("other_file",addressObj)

    Specify the name of the project that contains the artifact.

    projectName = "My Reference Project";

    Specify that the project contains the artifact.

    addressObj = padv.util.ArtifactAddress(...
    fullfile("tools","sampleChecks.json"),...
    OwningProjectName=projectName)

    You can view which project contains the artifact by using the getOwningProject function.

    getOwningProject(addressObj)
    ans = 
    
        "My Reference Project"