addComplianceStatus
Add to number of results with specified compliance status
Description
addComplianceStatus(
adds to the number of assessment results with the specified compliance
status in the taskResultObj
,status
,increment
)ComplianceStatusSummary
property of the task result
object.
This function adds to the existing value. If you want to overwrite the existing value,
you can use the function setComplianceCount
instead.
Examples
Update Compliance Status Information in Task Result
As part of your
task definition, you can update the compliance status information to the task results by
using the addComplianceStatus
function.
Create a task result by using a padv.TaskResult
object.
taskResult = padv.TaskResult;
View the compliance status summary. By default, there are no compliant, warning, and non-compliant statuses in the task result because the task assessment has not run yet.
taskResult.ComplianceStatusSummary
ans = dictionary (padv.ComplianceStatus ⟼ uint64) with 3 entries: Compliant ⟼ 0 Warning ⟼ 0 NonCompliant ⟼ 0
Suppose that your task assessment initially identifies one compliant result, two
warnings, and three non-compliant results. You can update the compliance statuses in the
task result by using the setComplianceCount
function.
setComplianceCount(taskResult,"Compliant",1); setComplianceCount(taskResult,"Warning",2); setComplianceCount(taskResult,"NonCompliant",3);
Verify the current compliance status summary of the task result by checking the
ComplianceStatusSummary
property
value.
taskResult.ComplianceStatusSummary
ans = dictionary (padv.ComplianceStatus ⟼ uint64) with 3 entries: Compliant ⟼ 1 Warning ⟼ 2 NonCompliant ⟼ 3
Suppose that your task assessment identifies two additional compliant result. You
can add those two results to the overall count by using the
addComplianceStatus
function.
addComplianceStatus(taskResult,"Compliant",2);
Verify the updated compliance status summary of the task result by checking the
ComplianceStatusSummary
property
value.
taskResult.ComplianceStatusSummary
ans = dictionary (padv.ComplianceStatus ⟼ uint64) with 3 entries: Compliant ⟼ 3 Warning ⟼ 2 NonCompliant ⟼ 3
To access a specific entry in the dictionary, you can use the key associated with the value that you want to look up. For example, find the number of compliant assessment results.
taskResult.ComplianceStatusSummary("Compliant")
ans = uint64 3
Input Arguments
taskResultObj
— Task result
padv.TaskResult
object
Task result, specified as a padv.TaskResult
object.
Example: padv.TaskResult
status
— Compliance status
padv.ComplianceStatus.Compliant
| padv.ComplianceStatus.Warning
| padv.ComplianceStatus.NonCompliant
Compliance status, specified as either:
padv.ComplianceStatus.Compliant
— The task meets the assessment objective.padv.ComplianceStatus.Warning
— The task might not meet the assessment objective and needs review.padv.ComplianceStatus.NonCompliant
— The task does not meet the assessment objective.
These values belong to the enumeration class
padv.ComplianceStatus
.
Example: padv.ComplianceStatus.NonCompliant
increment
— Number of additional assessment results
1
(default) | integer
Number of additional assessment results, specified as an integer.
Example: 2
Data Types: double
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)