padv.builtin.query.GetOutputsOfDependentTask Class
Namespace: padv.builtin.query
Superclasses: padv.Query
Query for getting outputs from predecessor task
Description
This class requires CI/CD Automation for Simulink Check.
The padv.builtin.query.GetOutputsOfDependentTask
class provides a query
that can return the outputs from a predecessor task.
You can use this query in your process model or task definition to find artifacts for your
task to use as inputs. Typically, you use this query to pass the outputs of one task as inputs
to another task. For example, if TaskB
depends on TaskA
,
then TaskA
is a predecessor task. You can pass the outputs from
TaskA
to TaskB
by specifying
GetOutputsOfDependentTask
as an input query for
TaskB
.
The padv.builtin.query.GetOutputsOfDependentTask
class is a handle
class.
Creation
Input 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.builtin.query.GetOutputsOfDependentTask(Name="MyQuery",Task="TaskA")
taskNameorInstance
— Task name or instance
string | padv.Task
object
Task name or instance, specified as a string or padv.Task
object.
This argument specifies the value of the DependentTask
property for the class instance.
Example: "NameOfMyTask"
Example: padv.builtin.task.RunModelStandards
queryName
— Name of query
string
Name of query, specified as a string.
This argument specifies the value of the Name
property for
the class instance.
Example: "NameOfMyQuery"
Properties
DependentTask
— Predecessor task name or instance
string | padv.Task
object
Predecessor task name or instance, specified as a string or
padv.Task
object.
Example: "NameOfMyTask"
Example: padv.builtin.task.RunModelStandards
Data Types: string
Title
— Query title
"Outputs of the dependent task"
(default) | string | character vector
Query title, specified as a string or a character vector.
Example: "Get artifacts from previous task"
Data Types: char
| string
Parent
— Initial query that runs before iteration query
padv.Query
| Name
of padv.Query
object
Initial query that runs before iteration query, specified as either a
padv.Query
object or the Name
of a
padv.Query
object. When you specify an iteration query for a task,
the parent query is the initial query that the build system runs before running the
specified iteration query.
For information on how to improve Process Advisor load times by sharing query instances across your process model, see Best Practices for Process Model Authoring.
Example: sharedQuery
Example: "FindMyInitialArtifacts"
Name
— Unique identifier for query
"padv.builtin.query.GetOutputsOfDependentTask"
(default) | string
Unique identifier for query, specified as a string.
Example: "GetOutputsFromTask"
Data Types: string
ShowFileExtension
— Show file extensions for returned artifacts
0
(false
) | 1
(true
)
Show file extensions in the Alias
property of returned
artifacts, specified as a numeric or logical 1
(true
) or 0
(false
). The
Alias
property controls the display name for the artifact in the
Tasks column in Process Advisor.
By default, queries strip file extensions from the Alias
property of each task iteration artifact. To show file extensions for
all artifacts in the
Tasks column, select the project setting Show file
extensions. To keep file extensions in the results for a specific query,
specify the query property ShowFileExtension
as
true
.
Example: true
Data Types: logical
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 an example, 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
method.
The sortArtifacts
method should return a list of sorted
padv.Artifact
objects.
Example: SortArtifacts = false
Data Types: logical
FunctionHandle
— Handle to function that function-based query runs
function_handle
Handle to the function that a function-based query
runs, specified as
a function_handle
.
If you define your query functionality inside a function and you or the build system
call run
on the query, the query runs the function specified by the
function_handle
.
The built-in queries are defined inside classes and do not use the
FunctionHandle
.
Example: FunctionHandle = @FunctionForQuery
Data Types: function_handle
Methods
Specialized Public Methods
This class overrides the following inherited methods.
run | Run query to find the artifacts that meet the criteria specified by the query. The query returns a Note You do not need to manually invoke this method inside your process
model. The build system automatically invokes the
The function artifacts = run(obj,~) ... end |
Examples
Use Task Outputs as Task Inputs
Suppose that you want to pass the output of one task as the input to
another task. You can use the built-in query GetOutputsOfDependentTask
to
find the outputs of the predecessor task and specify that query as an input query for the
task.
For this example, open the Process Advisor example project.
processAdvisorExampleStart
The process model for the example specifies that the Merge Test Results task depends on the Run Tests task:
if includeTestsPerTestCaseTask && includeMergeTestResultsTask mergeTestTask.dependsOn(milTask, "WhenStatus",{'Pass','Fail'}); end
If you open the source code for the Merge Test Results task,
you can see that the task uses the built-in query
padv.builtin.query.GetOutputsOfDependentTask
as an input
query.
open padv.builtin.task.MergeTestResults
... options.InputQueries = [padv.builtin.query.GetIterationArtifact,... padv.builtin.query.GetOutputsOfDependentTask(... Task="padv.builtin.task.RunTestsPerTestCase")]; options.InputDependencyQuery = padv.builtin.query.GetDependentArtifacts; ...
When you run the Merge Test Results task, the build system runs this input query, which passes the current model and the outputs of the Run Tests task as inputs to the Merge Test Results task.
For each input, the build system checks for other artifacts that the inputs depend
on by running the InputDependencyQuery
. For the Merge
Test Results task, the input dependency query allows the build system to
find related artifacts, such as data dictionaries, that the model uses. Those
dependencies can impact if the task results are up-to-date or outdated.
Capabilities and Limitations
This table identifies functionality that is supported by the query.
Functionality | Supported? |
---|---|
Input query for task | Yes. |
Iteration query for task | No. |
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 (한국어)