Main Content

removeClassification

R2026b

Remove classification from threshold rule

Since R2026b

    Description

    removeClassification(rule,classification) removes the classification classification from the threshold rule rule. Use this function to simplify or change the compliance criteria for a threshold rule by removing one of its classification conditions as shown in Adjust Dashboard Thresholds to Match Your Testing Criteria.

    Threshold classifications showing the compliance conditions for the "Tests Linked to Requirements" widget

    example

    Examples

    collapse all

    Copy a shipping threshold set, get a threshold rule, and remove one of its classifications.

    Copy a shipping threshold set and get a threshold rule.

    config = metric.config.Configuration.copyThresholdSet( ...
        SourceThresholdSetId="ReqBasedTesting", ...
        TargetThresholdSetId="MyTestingThresholds");
    
    rule = getThresholdRule(config, ...
        ThresholdSetId="MyTestingThresholds", ...
        MetricId="modeltesting.TestResultAnalysis[slcomp.TestStatusDistribution]", ...
        ThresholdRuleId="NotRun");

    Inspect the classifications on the rule.

    numel(rule.Classifications)
    ans =
    
         2

    Remove the second classification from the rule.

    classification = rule.Classifications(2);
    removeClassification(rule, classification)

    Verify that the function removed the classification.

    numel(rule.Classifications)
    ans =
    
         1

    Input Arguments

    collapse all

    Threshold rule to remove the classification from, specified as a metric.threshold.ThresholdRule object.

    Classification to remove from the threshold rule, specified as a metric.threshold.Classification object. To specify which classification to remove, index into the Classifications property of the threshold rule. For example, rule.Classifications(2).

    Version History

    Introduced in R2026b