Main Content

Overview of Process Model

You can define a repeatable development and verification process for your team by using the support package CI/CD Automation for Simulink Check. You define your process inside a process model. A process model is a MATLAB® file that specifies the tasks that you want to perform and dependencies between those tasks. The support package has built-in tasks that you can add to your process to perform common activities like running Model Advisor checks, generating code, and running tests. But you can also create and add your own custom tasks to your process. To specify which artifacts your tasks iterate over or use as task inputs, you can use built-in and custom queries to automatically find certain types of artifacts.

To get started with the default process model, see Modify Default Process Model to Fit Your Process.

Process Model

You define your process by using a process model file. A process model file accepts one argument, a padv.ProcessModel object. You define your process by modifying the padv.ProcessModel object and related objects.

function processmodel(pm)

    arguments
        pm padv.ProcessModel
    end

end

The process model file for your project must:

  • Be on the MATLAB path.

  • Have the file name processmodel.m or processmodel.p.

Graphic showing build system applying process model to a MATLAB project and generating a pipeline of tasks in Process Advisor

Tasks

In the process model, you add the tasks that you want to perform as part of your process. A task represents an individual step in the process. Tasks can take artifacts as inputs, perform specific actions, generates assessments, and return artifacts as outputs.

Flow diagram for a task accepting input artifacts and returning output artifacts and assessments

You add tasks to your process by using the addTask object function on the padv.ProcessModel object.

You can add:

  • Built-In Tasks for common activities like checking modeling standards, generating code, and running tests. The classes that define the built-in tasks are in the padv.builtin.task namespace.

  • Custom Tasks for your own customized task behavior. Your custom tasks can inherit from one of the built-in task classes or the padv.Task superclass.

For example, to add the built-in task for checking modeling standards with Model Advisor, you pass the task name or task instance to the addTask object function. addTask returns a task object that you can use to reconfigure the task behavior for the current process.

function processmodel(pm)

    arguments
        pm padv.ProcessModel
    end

    % Add Task
    modelAdvisorTask = pm.addTask(padv.builtin.task.RunModelStandards);

end

In Process Advisor, the Tasks column shows the task and the artifacts that the task iterates over. By default, the built-in task RunModelStandards runs once for each model in the project. But you can reconfigure how often the task runs and other task behaviors.

Tasks column showing built-in task for Check Modeling Standards

For more information, see:

Queries

You can find and use artifacts in your project by using queries. A query can automatically find artifacts in your project based on search criteria like the artifact type, project label, file path, and other characteristics. You can use queries in your process model to automatically find the relevant artifacts for your tasks without needing to manually update a static list of files.

In Process Advisor, the Tasks column shows the artifacts that a task iterates over. When you point to task results in the I/O column, you can see the task inputs and input dependencies.

Diagram showing IterationQuery connected to task iterations, InputQueries connected to the task inputs, and InputDependencyQuery connected to the dependencies

You can reconfigure a task to iterate over different artifacts or use different task inputs by specifying a different query for the associated task property:

  • IterationQuery — Determines how often a task runs by finding the artifacts that the task iterates over

  • InputQueries — Finds inputs for the task

  • InputDependencyQuery — Finds additional dependencies related to the inputs

For each task in your process, the build system runs the task IterationQuery to determine which artifacts the task iterates over. The build system then creates a task iteration, runs any additional queries the task needs, runs the task, and saves the task results. Although tasks iterate over artifacts, tasks do not automatically use those artifacts as inputs unless those artifacts are specified by the task input queries. For each task iteration, the build system runs the InputQueries to find the inputs for that specific task iteration. For each input, the build system runs the InputDependencyQuery to find additional dependencies that can impact if task results are up-to-date.

You can specify these task properties and other process modeling properties by using:

  • Built-In Queries to find artifacts like models, test cases, and requirements. The classes that define the built-in queries are in the padv.builtin.query namespace.

  • Custom Queries to find artifacts that are not covered by the built-in queries.

For information on how to reconfigure tasks to use different artifacts, see Reconfigure Task Behavior.

Use Your Process

When you are ready to run your process, you do not manually run the process model file. Instead, you use the Process Advisor app or the runprocess function. The Process Advisor build system automatically loads your process model, analyzes your project, and creates your pipeline of tasks. For more information, see Automate and Run Tasks with Process Advisor and Programmatically Run Tasks.

See Also

|

Related Topics