Main Content

Process Advisor

Automate your development workflow and prequalify changes before submitting to source control

Description

With the CI/CD Automation for Simulink Check support package, you can use the Process Advisor app to create, deploy, and automate a consistent prequalification process for Model-Based Design (MBD). The app includes built-in tasks for performing common MBD tasks like checking modeling standards with the Model Advisor app, running tests with Simulink® Test™, generating code with Embedded Coder®, and inspecting code with Simulink Code Inspector™. You can use the customizable process modeling system to define the steps in your process and use the app to run each of the steps. As you edit and save the artifacts in your project, the app tracks changes and automatically identifies tasks and task iterations that have outdated results. The Process Advisor app runs your tasks locally for prequalification. The tasks run on the machine that is running MATLAB® and does not use an external CI system.

If your process model defines multiple processes, you can select which process you want to use from the Process gallery in the toolstrip. For more information, see Manage Multiple Build and Verification Workflows Using Processes.

In Process Advisor, you can:

  • Point to a task in the Tasks column and click the run button to run that task and outdated dependent tasks.

  • Click Run All to run each of the tasks shown in the Tasks column.

  • Click Run All > Force Run All to force the build system to run each task, even if the tasks already have up-to-date results.

  • Click Run All > Dry Run All to dry run each task in the process. A dry run can help you test your process model by validating task inputs and generating representative task outputs without actually running the tasks. For more information, see Dry Run Tasks to Test Process Model.

  • Click Run All > Clean All to clear the task results and delete task outputs for each of the tasks.

  • Click Run All > Refresh All to manually refresh the list of tasks that appears in the Tasks column.

  • Click Run All > Set Dry Run as Default to make dry runs the default task execution mode for the current MATLAB session. For more information, see Dry Run Tasks to Test Process Model.

When the Process Advisor app runs tasks, a Stop button appears in the top-right corner. You can click the Stop button to stop the queued tasks from running next.

To edit the process model, click the Edit process model icon . If you have a P-coded process model file, you must delete the processmodel.p file before you can edit the process model using Process Advisor.

After Process Advisor analyzes the project, the Project Analysis Issues pane shows the errors or warnings that the artifact analysis generated. For more information, see Troubleshoot Missing Tasks, Artifacts, and Dependencies.

Project with 1 error and 12 warnings

For information on how to get started, see Automate and Run Tasks with Process Advisor.

Process Advisor app showing completed tasks for collecting model maintainability metrics, generating a Simulink Web View, and checking modeling standards

Open the Process Advisor App

  • For a Simulink model:

    • On the Apps tab, click Process Advisor.

    • Or, in the Command Window, enter:

      processadvisor(modelName)

  • For a project:

    • On the Project tab, in the Tools section, click Process Advisor.

      Process Advisor app in Project Tools

    • Or, in the Command Window, enter:

      processAdvisorWindow

Examples

expand all

Open the Process Advisor app for a Simulink model in a project.

Create and open a working copy of the Process Advisor example project. MATLAB copies the files to an example folder so that you can edit them.

processAdvisorExampleStart

The project contains the model AHRS_Voter.slx.

Open the Process Advisor app for the model AHRS_Voter.slx.

processadvisor("AHRS_Voter")

By default, the Process Advisor pane shows the tasks for the current model.

To view the tasks associated with the project, in the Process Advisor pane, you can switch the filter from Model to Project.

Mouse pointing to Project option in drop-down menu

Open the Process Advisor for a project and view the pipeline of tasks.

Create and open a working copy of an example project. MATLAB copies the files to an example folder so that you can edit them.

proj = Simulink.createFromTemplate("code_generation_example.sltx",...
Name="New Project");

Open the Process Advisor for the project.

processAdvisorWindow

The Tasks column shows the pipeline of tasks generated from the process model.

Click Edit to open the process model file that defines the process.

You can clean Process Advisor tasks to clear the task results and delete the task outputs. When you clean a task, it is as if you did not run the task.

To clean a specific task in Process Advisor, point to the task, open the options menu (...), and click Clear results and delete outputs.

Task options menu showing button for Clear results and delete outputs

Alternatively, you can use the Clean and DeleteOutputs arguments of the runprocess function. For example, to programmatically clean a Collect Model Maintainability Metrics task for a model AHRS_Voter.

runprocess(Tasks="padv.builtin.task.CollectMetrics",...
FilterArtifact=fullfile("02_Models","AHRS_Voter","specification","AHRS_Voter.slx"),...
Clean=true,DeleteOutputs=true);

To clean all tasks in Process Advisor, click Run All > Clean All.

Process Advisor toolstrip showing Run All menu with Clean All button

Alternatively, you can use the Clean and DeleteOutputs arguments of the runprocess function.

runprocess(Clean=true,DeleteOutputs=true)

Related Examples

Programmatic Use

expand all

Note that you need to load a project before you open the Process Advisor.

processadvisor(modelName) opens the Simulink model, modelName, in the current project and opens a Process Advisor pane to the left of the Simulink canvas.

processAdvisorWindow() opens the Process Advisor app for the current project. The app opens in a standalone window.