addQuery
Add query instance to process model
Description
adds the query specified by queryObj
= addQuery(pm
,queryNameOrInstance
)queryNameOrInstance
to the process model.
You can access the query using the query object queryObj
.
This functionality requires CI/CD Automation for Simulink Check.
specifies the properties of the query using one or more queryObj
= addQuery(___,Name=Value
)Name=Value
arguments.
Input Arguments
pm
— Process for project
padv.ProcessModel
object (default) |
Process for project, specified as a padv.ProcessModel
object.
Example: pm = padv.ProcessModel
queryNameOrInstance
— Name or instance of query
string | padv.Query
object
Name or instance of a query, specified as a string or padv.Query
object.
Example: "NameOfMyQuery"
Example: padv.builtin.query.FindModels
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:
DefaultArtifactType
— Artifact type returned by query
"padv_output_file"
(default) | valid value for the Type
property of a padv.Artifact
object
Artifact type returned by the query, specified as a valid value for the
Type
property of a padv.Artifact
object.
Example: DefaultArtifactType = "sl_model_file"
Title
— Human readable name
Name
property of query (default) | string
Human readable name for the query, specified as a string. By default, the
Title
property of the query is the same as the
Name
.
Example: Title = "My Query"
Data Types: string
FunctionHandle
— Handle to function that runs when you run query object
function_handle
Handle to function that runs when you run query
object, specified as a
function_handle
.
When you call the run
function on a query object,
run
runs the function specified by the
function_handle
.
Example: FunctionHandle = @FunctionForQuery
Data Types: function_handle
Parent
— Initial query run before iteration query
[0×0 string]
(default) | padv.Query
object | Name
of padv.Query
object
Initial query run before iteration
query, specified as either a
padv.Query
object or the Name
of a
padv.Query
object. When you specify a padv.Query
object as the iteration query for a task, the Parent
query is the
initial query that the build system runs before running the specified iteration
query.
For
example, the built-in
querypadv.builtin.query.FindModelsWithTestCases
has the
Parent
query padv.builtin.query.FindModels
.
If you specify padv.builtin.query.FindModelsWithTestCases
as the
iteration query for a task, you are specifying that you want the task to run once for
each model with a test case. The build system runs the Parent
query padv.builtin.query.FindModels
first, to find the models in
the project, and then the build system runs the iteration query
padv.builtin.query.FindModelsWithTestCases
to find the models
with test
cases.
The build system ignores the Parent
query when you specify a
query as an input query or dependency query for a task.
Example: Parent = "padv.builtin.query.FindModels"
SortArtifacts
— Setting for automatically sorting artifacts by address
true
or 1
(default) | false
or 0
Setting for automatically sorting artifacts by address, specified as a numeric or
logical 1
(true
) or 0
(false
). When a query returns artifacts, the artifacts should be
in a consistent order. By default, the build system sorts artifacts by the artifact
address.
Alternatively, you can sort artifacts in a different order by overriding the
internal sortArtifacts
method in a subclass that defines a custom
sort behavior.
For more information, see Sort Artifacts in Specific Order.
The build system automatically calls the sortArtifacts
method
when using the process model. The sortArtifacts
method expects two
input arguments: a padv.Query
object and a list of
padv.Artifact
objects returned by the run
function. The sortArtifacts
method should return a list of sorted
padv.Artifact
objects.
Example: SortArtifacts = false
Data Types: logical
Output Arguments
queryObj
— Query object
padv.Query
object
Query object, returned as a padv.Query
object.
For more information, see padv.Query
.
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 (한국어)