createProcessTaskID
Generate ID for specific task iteration defined by process model
Description
generates the identifier, ID
= createProcessTaskID(task
,artifact
)ID
, for an individual task iteration defined by
the process model. A task iteration is the pairing of a task,
task
, to a specific project artifact,
artifact
.
This function requires CI/CD Automation for Simulink Check.
Examples
Run One Task on One Artifact
Suppose you have a process model with several tasks, but right now
you only want to run the task padv.builtin.task.RunModelStandards
on
the model AHRS_Voter.slx
. Use the function
createProcessTaskID
to generate the ID for a specific task iteration,
then use the function runprocess
to run only that specific task
iteration.
Open the Process Advisor example project, which contains an example process model.
processAdvisorExampleStart
Specify a task that exists in the process model. For this example, specify the
built-in task for running Model Advisor checks,
padv.builtin.task.RunModelStandards
.
task = padv.builtin.task.RunModelStandards;
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);
Use the task instance and artifact to generate the ID for the specific task iteration.
runModelStandards_for_AHRS_Voter = createProcessTaskID(task,artifact)
runModelStandards_for_AHRS_Voter = "padv.builtin.task.RunModelStandards|sl_model_file|02_Models/AHRS_Voter/specification/AHRS_Voter.slx"
Use the function runprocess
to run the task
iteration.
runprocess(Tasks = runModelStandards_for_AHRS_Voter)
Tasks
value as the ID for a single task iteration,
the function runprocess
runs only the specified task iteration. For
this example, runprocess
runs only the task iteration associated with
the task padv.builtin.task.RunModelStandards
and the artifact
AHRS_Voter.slx
.Note
Alternatively, instead of creating and then running the task iterations, you can
directly specify the Task
and FilterArtifact
arguments of the runprocess
function to run the task on a
specific artifact:
runprocess(... Tasks = "padv.builtin.task.RunModelStandards",... FilterArtifact = fullfile("02_Models","AHRS_Voter","specification","AHRS_Voter.slx"))
Input Arguments
task
— Task name or subclass of padv.Task
string | character vector | padv.Task
object
Either:
Name of task, specified as a string or character vector. The name of a task is stored in the
Name
property of the task. For example,"name_of_my_custom_task"
.Subclass of
padv.Task
, specified as apadv.Task
object. Built-in tasks are subclasses ofpadv.Task
. For example, you can specify thepadv.Task
objectpadv.builtin.task.RunModelStandards
for thetask
argument.
Example: "name_of_my_custom_task"
Example: "padv.builtin.task.RunModelStandards"
Example: padv.builtin.task.RunModelStandards
Data Types: char
| string
artifact
— File in project
padv.Artifact
object
File in project, specified as a padv.Artifact
object.
Example: padv.Artifact("project","ProcessAdvisorExample.prj")
Example: padv.Artifact("sl_model_file",
"02_Models/AHRS_Voter/specification/AHRS_Voter.slx")
Output Arguments
ID
— Identifier for task iteration defined by process model
string
Identifier for task iteration defined by the process model, 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. To open the Process Advisor app for a project, in the MATLAB® Command Window, enter:
processAdvisorWindow
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)