ModelAdvisor.Task - Define custom tasks

Class Description

The ModelAdvisor.Task class is a wrapper for a check so you can access the check with the Model Advisor.

You can use one ModelAdvisor.Check object in multiple ModelAdvisor.Task objects, allowing you to place the same check in multiple locations in the Model Advisor tree. For example, Check for implicit signal resolution is in the By Product > Simulink folder and in the By Task > Model Referencing folder in the Model Advisor tree.

Syntax

task_obj = ModelAdvisor.Task(task_ID)

Arguments

task_obj

A variable representing the task object you create.

task_ID

A string that uniquely identifies the task. The value of task_ID must remain constant. If you do not specify a task_ID, the Model Advisor assigns a random task_ID to the task object.

Method Summary

NameDescription
setCheckSpecify check used in task

Methods

setCheck

Purpose

Specify check used in task

Syntax

task_obj.setCheck(check_ID)

Arguments

task_obj

A variable representing the task object.

check_ID

A unique string that identifies the check to use in the task.

Description

The setCheck method specifies the check to use in the task.

See Also

ModelAdvisor.Check

Example

See Demo and Code Example for more information.

function defineTaskAdvisor
mdladvRoot = ModelAdvisor.Root;

MAT1 = ModelAdvisor.Task('com.mathworks.sample.TaskSample1');
MAT1.DisplayName='Example task with input parameter and auto-fix ability';
MAT1.setCheck('com.mathworks.sample.Check1');
mdladvRoot.register(MAT1);

MAT2 = ModelAdvisor.Task('com.mathworks.sample.TaskSample2');
MAT2.DisplayName='Example task 2';
MAT2.setCheck('com.mathworks.sample.Check2');
mdladvRoot.register(MAT2);

MAT3 = ModelAdvisor.Task('com.mathworks.sample.TaskSample3');
MAT3.DisplayName='Example task 3';
MAT3.setCheck('com.mathworks.sample.Check3');
mdladvRoot.register(MAT3);

See Also

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS