Define Task Relationships
With the CI/CD Automation for Simulink Check support package, you can define a development and verification process for your team by adding tasks to your process model and reconfiguring the task behavior to meet the needs of your specific process.
Typically, you have dependencies between your tasks or you want your tasks to run
in a specific order. In your process model, you can specify the relationship between
tasks by using either the dependsOn
method or the
runsAfter
method.
dependsOn
specifies that a task depends on inputs or results from another task to run successfully. When you run the downstream task, the build system automatically runs the upstream task first.runsAfter
specifies a preferred task execution order for tasks that do not depend on each other. When both tasks are in the queue of tasks for the build system to run, the build system runs those tasks in your preferred task execution order when possible.
Open Process Model
You can specify the relationships between tasks by editing the process model file for the project. If you do not have a project or process model, see Automate and Run Tasks with Process Advisor to get started.
Open the project that contains your files.
Open Process Advisor. On the Project tab, in the Tools section, click Process Advisor.
Edit the process model by clicking the Edit button in the toolstrip.
Specify Relationships
Suppose you want to perform these tasks in the following order:
Check modeling standards with the built-in task
RunModelStandards
.Generate code with the built-in task
GenerateCode
.Inspect the generated code with the built-in task
RunCodeInspection
.
The following process model adds those tasks to the process model and
specifies the relationships between those tasks by using the
runsAfter
and dependsOn
methods.
function processmodel(pm) arguments pm padv.ProcessModel end % Add Tasks modelAdvisorTask = pm.addTask(padv.builtin.task.RunModelStandards); generateCodeTask = pm.addTask(padv.builtin.task.GenerateCode); inspectCodeTask = pm.addTask(padv.builtin.task.RunCodeInspection); % Define Task Relationships generateCodeTask.runsAfter(modelAdvisorTask); inspectCodeTask.dependsOn(generateCodeTask); end
See Also
dependsOn
| padv.ProcessModel
| padv.Task
| Process
Advisor | runprocess
| runsAfter