Main Content

generateProcessTasks

Get list of valid task keys

    Description

    taskKeys = generateProcessTasks() returns the list of valid task keys. The task keys represent the task iterations in the pipeline of tasks.

    By default, generateProcessTasks returns a task key for each combination of tasks and associated artifacts in the pipeline defined by the default process.

    example

    taskKeys = generateProcessTasks(Name=Value) filters the list of task keys 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 task keys for each task iteration in the pipeline.

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

    processAdvisorExampleStart

    List the valid task keys for each task iteration in the pipeline.

    taskKeys = 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 task keys 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 task keys for the task iterations in the pipeline, but filter the list to include only task iterations associated with the artifact AHRS_Voter.slx.

    taskKeys_AHRS_Voter = generateProcessTasks(FilterArtifact=artifact);

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

    runprocess(Tasks=taskKeys_AHRS_Voter)

    When you specify the Tasks value as a list of task keys 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.

    Name-Value Arguments

    collapse all

    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 to generate task keys for, specified as either the:

    • Full path to an artifact

    • Relative path to an artifact

    • padv.Artifact object that represents an artifact

    • 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

    Process to generate task keys for, specified by a character vector or string. The process name is defined by the Name property of the padv.Process object.

    Example: "CIPipeline"

    Data Types: char | string

    Subprocesses to generate task keys 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

    Tasks to generate task keys 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 pipeline, returned as a string.

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

    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)