applyStatus
Apply new task status if priority is higher
Description
applyStatus(
applies a new task status taskResultObj,taskStatus)taskStatus to the task result object
taskResultObj if the priority level of
taskStatus is higher than the current Status
property of the task result object.
The priority levels from lowest to highest are:
padv.TaskStatus.Passpadv.TaskStatus.Failpadv.TaskStatus.Error
Note
The function applyStatus can only change the
Status to a higher priority status. For example, if you apply a
failing status and then apply a passing status, the status remains a failing status
because the priority of padv.TaskStatus.Fail is higher than the
priority of
padv.TaskStatus.Pass.
taskResult = padv.TaskResult(); % By default, Status is Pass. applyStatus(taskResult, padv.TaskStatus.Fail); % Status changes to Fail. applyStatus(taskResult, padv.TaskStatus.Pass); % Status remains Fail. taskResult
taskResult =
TaskResult with properties:
Status: Fail
OutputArtifacts: [0×0 padv.Artifact]
Details: [1×1 struct]
Values: [1×1 struct]
ResultValues: [1×1 struct]To set the Status property of a task result object to a
specific value, manually set the property to either
padv.TaskStatus.Pass, padv.TaskStatus.Fail, or
padv.TaskStatus.Error. For example, to set the
Status of a task result object taskResult to
Pass, use taskResult.Status =
padv.TaskStatus.Pass.