Main Content

generateProcessTasks

Get list of IDs for task iterations in MBD pipeline

    Description

    IDs = generateProcessTasks() returns identifiers, IDs, for each of the task iterations in the model-based design (MBD) pipeline.

    By default, generateProcessTasks returns an ID for each combination of tasks and associated project artifacts in the MBD pipeline.

    This function requires CI/CD Automation for Simulink Check.

    example

    IDs = generateProcessTasks(Name=Value) filters the list of IDs using one or more Name=Value arguments.

    example

    Examples

    collapse all

    Suppose you have a process model that adds several tasks to the process. Use the function generateProcessTasks to list the IDs for each task iteration in the MBD pipeline.

    Open the Process Advisor example project, which contains an example process model.

    processAdvisorExampleStart

    List the IDs for each task iteration in the MBD pipeline.

    IDs = generateProcessTasks()

    Suppose you have a process model that adds several tasks to the process, but right now you only want to run the tasks associated with one specific artifact. You can use the function generateProcessTasks, but filter the list of IDs to only include task iterations associated with a specific model in the project, AHRS_Voter.slx.

    Open the Process Advisor example project, which contains an example process model.

    processAdvisorExampleStart

    Use padv.Artifact to specify the project artifact that you want the task to run on. For this example, the artifact type is sl_model_file because the artifact is a Simulink® model and the address is the path to AHRS_Voter.slx, relative to the project root.

    artifactType = "sl_model_file";
    address = fullfile("02_Models","AHRS_Voter","specification","AHRS_Voter.slx");
    artifact = padv.Artifact(artifactType,address);

    Get a list of the IDs for the task iterations in the MBD pipeline, but filter the list to include only task iterations associated with the artifact AHRS_Voter.slx.

    IDs_AHRS_Voter = generateProcessTasks(FilterArtifact=artifact);

    Use the function runprocess to run only the task iterations associated with the artifact AHRS_Voter.slx.

    runprocess(Tasks=IDs_AHRS_Voter)

    When you specify the Tasks value as a list of IDs for task iterations, the function runprocess runs only the specified task iterations. For this example, runprocess runs only the task iterations associated with the artifact AHRS_Voter.slx.

    Note

    Alternatively, instead of generating and then running the task iterations, you can directly specify the FilterArtifact argument of the runprocess function to run the tasks associated with the artifact:

    runprocess(FilterArtifact = fullfile("02_Models","AHRS_Voter","specification","AHRS_Voter.slx"))
    But note that you can only run the tasks if the tasks are defined in the process model and the artifacts exist in the project.

    Input Arguments

    collapse all

    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: generateProcessTasks(Tasks = "padv.builtin.task.GenerateSimulinkWebView")

    Artifact or artifacts that you want to generate IDs for, specified as either the full path to an artifact, relative path to an artifact, a padv.Artifact object that represents an artifact, or an array of padv.Artifact objects.

    Example: fullfile("C:\","User","projectA","myModel.slx")

    Example: fullfile("02_Models","AHRS_Voter","specification","AHRS_Voter.slx")

    Example: padv.Artifact("sl_model_file",fullfile("02_Models","AHRS_Voter","specification","AHRS_Voter.slx"))

    Data Types: string

    Name of process that you want to generate IDs for, specified by a character vector or string.

    Example: "CIPipeline"

    Data Types: char | string

    Names of subprocesses that you want to generate IDs for, specified as a character vector, cell array of character vectors, string, or string array. The subprocess name is defined by the Name property of the subprocess.

    Example: "SubprocessA"

    Example: ["SubprocessA",SubprocessB"]

    Data Types: char | string

    Names of tasks that you want to generate IDs for, specified as a character vector, cell array of character vectors, string, or string array. The task name is defined by the Name property of the task.

    Example: "padv.builtin.task.GenerateSimulinkWebView"

    Example: ["padv.builtin.task.GenerateSimulinkWebView",... "padv.builtin.task.RunModelStandards"]

    Data Types: char | string

    Output Arguments

    collapse all

    Identifiers for task iterations in the MBD pipeline, returned as a string.

    IDs take the form: "taskNameOrObject|fileType|relativePath", where relativePath is the path relative to the project root.

    Example IDs:

    • "myCustomProjectTask|project|ProcessAdvisorExample.prj"

    • "padv.builtin.task.RunModelStandards|sl_model_file|02_Models/AHRS_Voter/specification/AHRS_Voter.slx"

    • "padv.builtin.task.RunTestsPerTestCase|sl_test_case|ced877ff-cfb8-4fa8-9bbf-aaa29b1d926b"

    Alternative Functionality

    App

    You can also use the Process Advisor app to run individual task iterations in the process or to view task iterations for a specific model.

    • To open the Process Advisor app for a project, in the MATLAB® Command Window, enter:

      processAdvisorWindow

    • To open the Process Advisor app for a specific model, provide the name of the model, modelName, to the function processadvisor:

      processadvisor(modelName)