Adding warning and failure messages to validation results — CdmPolicyUtil

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 3분
  • You use the CdmPolicyUtil script include to add warning and failure messages to validation results in the CDM Policy Validation Results table. CDM expects validation warnings and failures to contain a node path, a snapshot ID, and a reference to the impacted node.

    중요사항:
    DevOps Config is now deprecated and no longer supported or available for new activation.

    CdmPolicyUtil

    • CdmPolicyUtil is a public script include.
    • Because CdmPolicyUtil is a global script include, you do not need to invoke it like a new CdmPolicyUtil().
    • You can invoke CdmPolicyUtil in all scopes, but the expected invocation scope is PaCE (specifically, during the execution of PaCE policies).
    • The proper call is CdmPolicyUtil.methodName(parameters).
    주:
    If you add warning and failure messages to validation results manually instead of using CdmPolicyUtil, the snapshot validation status will show Execution Error.

    Methods

    addFailure

    Adds a failure message. The message appears on the Validation results tab for the snapshot.

    Parameters:

    • Output: Policy decision for the subject snapshot (primarySnapshotId).
    • cdmNode: Node (sn_cdm_node) that caused the failure.
    • name: Name of the failure.
    • description: Description of the failure.
    addWarning

    Adds a policy warning message. The message appears on the Validation results tab for the snapshot.

    Parameters:

    • Output: Policy decision for the subject snapshot (primarySnapshotId).
    • cdmNode: Node (sn_cdm_node) that caused the warning.
    • name: Name of the warning.
    • description: Description of the warning.
    getLastCreatedSnapshotIds

    Returns the latest created and published snapshot IDs for the supplied additionalDeployables. If no published snapshot is available for a particular deployable, adds a debug message.

    Parameter:

    additionalDeployables – can be passed directly as it comes to the policy.

    getLastPublishedSnapshotIds

    Retrieves the latest and published snapshot IDs for the supplied additionalDeployables. If no published snapshot is available for a particular deployable, adds a debug message.

    Parameter:

    additionalDeployables - can be passed directly as it comes to the policy.