---
policy: /ce/ca/aws/dms/migration-task-logging
logic: /ce/ca/aws/dms/migration-task-logging/prod.logic.yaml
executionTime: 2025-07-12T12:02:31.556506719Z
rows:
  - id: test1
    match: true
    status:
      expected: DISAPPEARED
      actual: DISAPPEARED
    conditionIndex:
      expected: 99
      actual: 99
    conditionText:
      expected: isDisappeared(CA10A1__disappearanceTime__c)
      actual: isDisappeared(CA10A1__disappearanceTime__c)
    runtimeError: {}
  - id: test2
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: not(extract('caJsonBoolean__settingsJsonEnableLogging__c'))
      actual: not(extract('caJsonBoolean__settingsJsonEnableLogging__c'))
    runtimeError: {}
  - id: test3
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()
      actual: extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()
    runtimeError: {}
  - id: test4
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 499
      actual: 499
    conditionText:
      expected: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetApplySeverity__c'))"
      actual: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetApplySeverity__c'))"
    runtimeError: {}
  - id: test5
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 599
      actual: 599
    conditionText:
      expected: extract('caJsonText__settingsJsonTargetLoadSeverity__c').isEmpty()
      actual: extract('caJsonText__settingsJsonTargetLoadSeverity__c').isEmpty()
    runtimeError: {}
  - id: test6
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 699
      actual: 699
    conditionText:
      expected: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetLoadSeverity__c'))"
      actual: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetLoadSeverity__c'))"
    runtimeError: {}
  - id: test7
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 799
      actual: 799
    conditionText:
      expected: extract('caJsonText__settingsJsonSourceCaptureSeverity__c').isEmpty()
      actual: extract('caJsonText__settingsJsonSourceCaptureSeverity__c').isEmpty()
    runtimeError: {}
  - id: test8
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 899
      actual: 899
    conditionText:
      expected: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceCaptureSeverity__c'))"
      actual: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceCaptureSeverity__c'))"
    runtimeError: {}
  - id: test9
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 999
      actual: 999
    conditionText:
      expected: extract('caJsonText__settingsJsonSourceUnloadSeverity__c').isEmpty()
      actual: extract('caJsonText__settingsJsonSourceUnloadSeverity__c').isEmpty()
    runtimeError: {}
  - id: test10
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 1099
      actual: 1099
    conditionText:
      expected: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceUnloadSeverity__c'))"
      actual: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceUnloadSeverity__c'))"
    runtimeError: {}
  - id: test11
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1100
      actual: 1100
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: test12
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()
      actual: extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()
    runtimeError: {}
  - id: test13
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()
      actual: extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()
    runtimeError: {}
  - id: test14
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()
      actual: extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()
    runtimeError: {}
  - id: test15
    match: true
    status:
      expected: UNDETERMINED
      actual: UNDETERMINED
    conditionIndex:
      expected: 103
      actual: 103
    conditionText:
      expected: extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.EnableLogging').isEvaluationFailed()
      actual: extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.EnableLogging').isEvaluationFailed()
    runtimeError:
      expected: UNDETERMINED condition:102
      actual: UNDETERMINED condition:102
  - id: test16
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()
      actual: extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()
    runtimeError: {}
  - id: test17
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()
      actual: extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()
    runtimeError: {}
  - id: test18
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()
      actual: extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()
    runtimeError: {}
usedFiles:
  - path: /ce/ca/aws/dms/migration-task-logging/policy.yaml
    md5Hash: ACCE68DE6436BCE24FCF1B86911024F3
    content: |
      ---
      names:
        full: AWS DMS Migration Task Logging is not enabled
        contextual: Migration Task Logging is not enabled
      description: >
        Ensure that CloudWatch logging is enabled for AWS DMS Replication Tasks.
      type: COMPLIANCE_POLICY
      categories:
        - SECURITY
      frameworkMappings:
        - "/frameworks/cloudaware/logging-and-monitoring/logging-and-monitoring-configuration"
        - "/frameworks/aws-fsbp-v1.0.0/dms/07"
        - "/frameworks/aws-fsbp-v1.0.0/dms/08"
      similarPolicies:
        awsSecurityHub:
          - name: "[DMS.7] DMS replication tasks for the target database should have logging enabled"
            url: "https://docs.aws.amazon.com/securityhub/latest/userguide/dms-controls.html#dms-7"
          - name: "[DMS.8] DMS replication tasks for the source database should have logging enabled"
            url: "https://docs.aws.amazon.com/securityhub/latest/userguide/dms-controls.html#dms-8"
  - path: /ce/ca/aws/dms/migration-task-logging/prod.logic.yaml
    md5Hash: 72B013D6D8DFFE59BDB71D994DDCA831
    content: "---\ninputType: \"CA10A1__CaAwsDmsMigrationTask__c\"\nimportExtracts:\n\
      \  - file: /types/CA10A1__CaAwsDmsMigrationTask__c/object.extracts.yaml\ntestData:\n\
      \  - file: \"test-data.json\"\nconditions:\n  - status: \"INCOMPLIANT\"\n  \
      \  currentStateMessage: \"CloudWatch logging is disabled for the DMS replication\
      \ task.\"\n    remediationMessage: \"Consider enable CloudWatch logging for\
      \ this DMS replication task.\"    \n    check:\n      IS_EMPTY:\n        arg:\n\
      \          EXTRACT: \"caJsonBoolean__settingsJsonEnableLogging__c\"\n  - status:\
      \ \"INCOMPLIANT\"\n    currentStateMessage: \"CloudWatch logging is disabled\
      \ for the DMS replication task.\"\n    remediationMessage: \"Consider enable\
      \ CloudWatch logging for this DMS replication task.\"    \n    check:\n    \
      \  NOT:\n        arg:\n          EXTRACT: \"caJsonBoolean__settingsJsonEnableLogging__c\"\
      \n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"Logging for the TARGET_APPLY\
      \ component is not enabled.\"\n    remediationMessage: \"Ensure the TARGET_APPLY\
      \ log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.\"\
      \    \n    check:\n      IS_EMPTY:\n        arg:\n          EXTRACT: \"caJsonText__settingsJsonTargetApplySeverity__c\"\
      \n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"Logging for the TARGET_APPLY\
      \ component is below the required LOGGER_SEVERITY_DEFAULT level.\"\n    remediationMessage:\
      \ \"Ensure the TARGET_APPLY log component is enabled with a minimum severity\
      \ of LOGGER_SEVERITY_DEFAULT.\"    \n    check:\n      CONTAINS:\n        arg:\n\
      \          SET:\n            itemType: TEXT\n            items:\n          \
      \    - LOGGER_SEVERITY_INFO\n              - LOGGER_SEVERITY_WARNING\n     \
      \         - LOGGER_SEVERITY_ERROR\n        search:\n          EXTRACT: \"caJsonText__settingsJsonTargetApplySeverity__c\"\
      \n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"Logging for the TARGET_LOAD\
      \ component is not enabled.\"\n    remediationMessage: \"Ensure the TARGET_LOAD\
      \ log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.\"\
      \    \n    check:\n      IS_EMPTY:\n        arg:\n          EXTRACT: \"caJsonText__settingsJsonTargetLoadSeverity__c\"\
      \n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"Logging for the TARGET_LOAD\
      \ component is below the required LOGGER_SEVERITY_DEFAULT level.\"\n    remediationMessage:\
      \ \"Ensure the TARGET_LOAD log component is enabled with a minimum severity\
      \ of LOGGER_SEVERITY_DEFAULT.\"    \n    check:\n      CONTAINS:\n        arg:\n\
      \          SET:\n            itemType: TEXT\n            items:\n          \
      \    - LOGGER_SEVERITY_INFO\n              - LOGGER_SEVERITY_WARNING\n     \
      \         - LOGGER_SEVERITY_ERROR\n        search:\n          EXTRACT: \"caJsonText__settingsJsonTargetLoadSeverity__c\"\
      \n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"Logging for the SOURCE_CAPTURE\
      \ component is not enabled.\"\n    remediationMessage: \"Ensure the SOURCE_CAPTURE\
      \ log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.\"\
      \    \n    check:\n      IS_EMPTY:\n        arg:\n          EXTRACT: \"caJsonText__settingsJsonSourceCaptureSeverity__c\"\
      \n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"Logging for the SOURCE_CAPTURE\
      \ component is below the required LOGGER_SEVERITY_DEFAULT level.\"\n    remediationMessage:\
      \ \"Ensure the SOURCE_CAPTURE log component is enabled with a minimum severity\
      \ of LOGGER_SEVERITY_DEFAULT.\"    \n    check:\n      CONTAINS:\n        arg:\n\
      \          SET:\n            itemType: TEXT\n            items:\n          \
      \    - LOGGER_SEVERITY_INFO\n              - LOGGER_SEVERITY_WARNING\n     \
      \         - LOGGER_SEVERITY_ERROR\n        search:\n          EXTRACT: \"caJsonText__settingsJsonSourceCaptureSeverity__c\"\
      \n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"Logging for the SOURCE_UNLOAD\
      \ component is not enabled.\"\n    remediationMessage: \"Ensure the SOURCE_UNLOAD\
      \ log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.\"\
      \    \n    check:\n      IS_EMPTY:\n        arg:\n          EXTRACT: \"caJsonText__settingsJsonSourceUnloadSeverity__c\"\
      \n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"Logging for the SOURCE_UNLOAD\
      \ component is below the required LOGGER_SEVERITY_DEFAULT level.\"\n    remediationMessage:\
      \ \"Ensure the SOURCE_UNLOAD log component is enabled with a minimum severity\
      \ of LOGGER_SEVERITY_DEFAULT.\"    \n    check:\n      CONTAINS:\n        arg:\n\
      \          SET:\n            itemType: TEXT\n            items:\n          \
      \    - LOGGER_SEVERITY_INFO\n              - LOGGER_SEVERITY_WARNING\n     \
      \         - LOGGER_SEVERITY_ERROR\n        search:\n          EXTRACT: \"caJsonText__settingsJsonSourceUnloadSeverity__c\"\
      \notherwise:\n  status: \"COMPLIANT\"\n  currentStateMessage: \"DMS Migration\
      \ Task Logging is enabled for all required components with the appropriate severity\
      \ level.\""
  - path: /types/CA10A1__CaAwsDmsMigrationTask__c/object.extracts.yaml
    md5Hash: 3B65C1EB3540C862016725CADD685D5B
    content: "---\nextracts:\n# Not Nullable. Can't have no access, retrieved via\
      \ dms:DescribeReplicationTasks\n  - name: caJsonFrom__settingsJson__c\n    value:\
      \ \n      JSON_FROM:\n        arg:\n          FIELD:\n            path: CA10A1__settingsJson__c\n\
      \        undeterminedIf:\n          isInvalid: \"The Task Settings JSON is invalid.\"\
      \n# Values: true/false\n  - name: caJsonBoolean__settingsJsonEnableLogging__c\n\
      \    value: \n      JSON_QUERY_BOOLEAN:\n        arg:\n          EXTRACT: \"\
      caJsonFrom__settingsJson__c\"\n        expression: \"Logging.EnableLogging\"\
      \n        undeterminedIf:\n          evaluationError: \"The JSON query has failed\"\
      \n          resultTypeMismatch: \"The JSON query did not return boolean type.\"\
      \n# Values from highest to lowest, the higher levels always include the lower:\
      \ \n# LOGGER_SEVERITY_DETAILED_DEBUG | LOGGER_SEVERITY_DEBUG | LOGGER_SEVERITY_DEFAULT\
      \ \n# LOGGER_SEVERITY_INFO | LOGGER_SEVERITY_WARNING | LOGGER_SEVERITY_ERROR\
      \ \n  - name: caJsonText__settingsJsonTargetApplySeverity__c\n    value: \n\
      \      JSON_QUERY_TEXT:\n        arg:\n          EXTRACT: \"caJsonFrom__settingsJson__c\"\
      \n        expression: \"Logging.LogComponents[?Id==`TARGET_APPLY`].Severity\
      \ | [0]\"\n        undeterminedIf:\n          evaluationError: \"The JSON query\
      \ has failed.\"\n          resultTypeMismatch: \"The JSON query did not return\
      \ text type.\"\n  - name: caJsonText__settingsJsonTargetLoadSeverity__c\n  \
      \  value: \n      JSON_QUERY_TEXT:\n        arg:\n          EXTRACT: \"caJsonFrom__settingsJson__c\"\
      \n        expression: \"Logging.LogComponents[?Id==`TARGET_LOAD`].Severity |\
      \ [0]\"\n        undeterminedIf:\n          evaluationError: \"The JSON query\
      \ has failed.\"\n          resultTypeMismatch: \"The JSON query did not return\
      \ text type.\"\n  - name: caJsonText__settingsJsonSourceCaptureSeverity__c\n\
      \    value: \n      JSON_QUERY_TEXT:\n        arg:\n          EXTRACT: \"caJsonFrom__settingsJson__c\"\
      \n        expression: \"Logging.LogComponents[?Id==`SOURCE_CAPTURE`].Severity\
      \ | [0]\"\n        undeterminedIf:\n          evaluationError: \"The JSON query\
      \ has failed.\"\n          resultTypeMismatch: \"The JSON query did not return\
      \ text type.\"\n  - name: caJsonText__settingsJsonSourceUnloadSeverity__c\n\
      \    value: \n      JSON_QUERY_TEXT:\n        arg:\n          EXTRACT: \"caJsonFrom__settingsJson__c\"\
      \n        expression: \"Logging.LogComponents[?Id==`SOURCE_UNLOAD`].Severity\
      \ | [0]\"\n        undeterminedIf:\n          evaluationError: \"The JSON query\
      \ has failed.\"\n          resultTypeMismatch: \"The JSON query did not return\
      \ text type.\"\n"
  - path: /ce/ca/aws/dms/migration-task-logging/test-data.json
    md5Hash: 44246BC726AD7A1BAD52D8F80CEA5FB3
    content: |-
      [
          {
              "expectedResult": {
                  "status": "DISAPPEARED",
                  "conditionIndex": "99",
                  "conditionText": "isDisappeared(CA10A1__disappearanceTime__c)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test1",
              "CA10A1__disappearanceTime__c": "2025-07-10T05:32:43Z",
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"TARGET_LOAD\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "299",
                  "conditionText": "not(extract('caJsonBoolean__settingsJsonEnableLogging__c'))",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test2",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":false,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test3",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "499",
                  "conditionText": "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetApplySeverity__c'))",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test4",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_INFO\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "599",
                  "conditionText": "extract('caJsonText__settingsJsonTargetLoadSeverity__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test5",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "699",
                  "conditionText": "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetLoadSeverity__c'))",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test6",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_INFO\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "799",
                  "conditionText": "extract('caJsonText__settingsJsonSourceCaptureSeverity__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test7",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "899",
                  "conditionText": "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceCaptureSeverity__c'))",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test8",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_INFO\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "999",
                  "conditionText": "extract('caJsonText__settingsJsonSourceUnloadSeverity__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test9",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "1099",
                  "conditionText": "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceUnloadSeverity__c'))",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test10",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_INFO\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "COMPLIANT",
                  "conditionIndex": "1100",
                  "conditionText": "otherwise",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test11",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test12",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[]}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test13",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":true}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "199",
                  "conditionText": "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test14",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"Key\":true}}"
          },
          {
              "expectedResult": {
                  "status": "UNDETERMINED",
                  "conditionIndex": "103",
                  "conditionText": "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.EnableLogging').isEvaluationFailed()",
                  "runtimeError": "UNDETERMINED condition:102"
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test15",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\":{\"EnableLogging\":\"true\"}}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "199",
                  "conditionText": "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test16",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{\"Logging\": \"value\"}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "199",
                  "conditionText": "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test17",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": "{}"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "199",
                  "conditionText": "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-07-10T05:32:43Z"
              },
              "Id": "test18",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__settingsJson__c": null
          }
      ]
script: |-
  CREATE TEMP FUNCTION mock_ExpectedResult()
  RETURNS ARRAY<STRUCT<
          Id STRING,
          expectedResult STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, runtimeError STRING>
      >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "Id" : "test1",
    "expectedResult" : {
      "status" : "DISAPPEARED",
      "conditionIndex" : "99",
      "conditionText" : "isDisappeared(CA10A1__disappearanceTime__c)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test2",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "299",
      "conditionText" : "not(extract('caJsonBoolean__settingsJsonEnableLogging__c'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "test3",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test4",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "499",
      "conditionText" : "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetApplySeverity__c'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "test5",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "599",
      "conditionText" : "extract('caJsonText__settingsJsonTargetLoadSeverity__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test6",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "699",
      "conditionText" : "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetLoadSeverity__c'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "test7",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "799",
      "conditionText" : "extract('caJsonText__settingsJsonSourceCaptureSeverity__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test8",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "899",
      "conditionText" : "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceCaptureSeverity__c'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "test9",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "999",
      "conditionText" : "extract('caJsonText__settingsJsonSourceUnloadSeverity__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test10",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "1099",
      "conditionText" : "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceUnloadSeverity__c'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "test11",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "1100",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "test12",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test13",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test14",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test15",
    "expectedResult" : {
      "status" : "UNDETERMINED",
      "conditionIndex" : "103",
      "conditionText" : "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.EnableLogging').isEvaluationFailed()",
      "runtimeError" : "UNDETERMINED condition:102"
    }
  }, {
    "Id" : "test16",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test17",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test18",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10A1__CaAwsDmsMigrationTask__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10A1__disappearanceTime__c TIMESTAMP,
      CA10A1__settingsJson__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test1",
    "CA10A1__disappearanceTime__c" : new Date("2025-07-10T05:32:43Z"),
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"TARGET_LOAD\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test2",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":false,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test3",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test4",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_INFO\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test5",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test6",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_INFO\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test7",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test8",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_INFO\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test9",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test10",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_INFO\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test11",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_APPLY\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"TARGET_LOAD\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_CAPTURE\"},{\"Severity\":\"LOGGER_SEVERITY_DEFAULT\",\"Id\":\"SOURCE_UNLOAD\"}]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test12",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true,\"LogComponents\":[]}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test13",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":true}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test14",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"Key\":true}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test15",
    "CA10A1__settingsJson__c" : "{\"Logging\":{\"EnableLogging\":\"true\"}}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test16",
    "CA10A1__settingsJson__c" : "{\"Logging\": \"value\"}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test17",
    "CA10A1__settingsJson__c" : "{}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-07-10T05:32:43Z")
    },
    "Id" : "test18",
    "CA10A1__settingsJson__c" : null
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10A1__CaAwsDmsMigrationTask__c(
      obj STRUCT<
          Id STRING,
          CA10A1__disappearanceTime__c TIMESTAMP,
          CA10A1__settingsJson__c STRING
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  OPTIONS (library=['gs://compliance-platform-public/jmespath.min.js'])
  AS r"""
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
          this.containsAll = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
          };
          this.containsAny = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
          };
      }();
      var IsEmptyLib = new function () {
          this.simpleIsEmpty = function(arg) {
              return arg == null;
          };
          this.simpleIsNotEmpty = function(arg) {
              return arg != null;
          };
      }();
      var CollectionLib = new function () {
          this.parse = function(arg, separator, skipEmpty, skipDuplicates, sort, normalize) {
              if (arg == null) return [];
              let parts = arg.split(separator);
              return this.fromArray(parts, skipEmpty, skipDuplicates, sort, normalize);
          };
          this.fromArray = function(arr, skipEmpty, skipDuplicates, sort, normalize) {
              if (arr == null) return [];
              let result = [];
              let seen = new Set();
              arr.forEach(el => {
                  let normalized = normalize ? TextLib.normalize(el) : BytesLib.normalize(el);
                  if (!skipEmpty || (normalize ? TextLib.isNotEmpty(el) : BytesLib.isNotEmpty(el))) {
                      if (!skipDuplicates || !seen.has(normalized)) {
                          if (skipDuplicates) seen.add(normalized);
                          result.push(normalized);
                      }
                  }
              });
              if (sort) result.sort();
              return result;
          };
          this.equal = function(left, right) {
              left = left == null ? [] : left;
              right = right == null ? [] : right;
              if (left.length !== right.length) return false;
              for (let i = 0; i < left.length; i++) {
                  if (left[i] !== right[i]) return false;
              }
              return true;
          };
          this.notEqual = function(left, right) {
              return !this.equal(left, right);
          };
          this.size = function(collection) {
              return collection == null ? 0 : collection.length;
          };
          this.startsWith = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search);
              return collection[0] === normalizedSearch;
          };
          this.endsWith = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search);
              return collection[collection.length - 1] === normalizedSearch;
          };
          this.contains = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              return collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search));
          };
          this.containsAll = function(collection, searchArray, normalize) {
              if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false;
              return searchArray.every(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)));
          };
          this.containsAny = function(collection, searchArray, normalize) {
              if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false;
              return searchArray.some(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)));
          };
      }();
      var BytesLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg;
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
          this.containsAll = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
          };
          this.containsAny = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10A1__disappearanceTime__c]: ' + obj.CA10A1__disappearanceTime__c);
      if (obj.CA10A1__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10A1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      function jsonQueryChecked4() {
          var input = extract6.call(extract6);
          var out;
          try {
              out = jmespath.search(input, 'Logging.EnableLogging');
          if (out != null && typeof out != 'boolean') {
              throw new Error("UNDETERMINED condition:102", {cause: {status: 'UNDETERMINED', conditionIndex: 102, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.EnableLogging').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return boolean type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:103", {cause: {status: 'UNDETERMINED', conditionIndex: 103, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.EnableLogging').isEvaluationFailed()", currentStateMessage: "The JSON query has failed", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked7() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract6() { if (!this.out) { this.out = jsonChecked7(); } return this.out; };
      function extract3() { if (!this.out) { this.out = jsonQueryChecked4(); } return this.out; };
      references1.push('Settings JSON [obj.CA10A1__settingsJson__c]: ' + obj.CA10A1__settingsJson__c);
      try {
          if (IsEmptyLib.simpleIsEmpty(extract3.call(extract3))) {
              return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('caJsonBoolean__settingsJsonEnableLogging__c').isEmpty()", currentStateMessage: "CloudWatch logging is disabled for the DMS replication task.", currentStateReferences: references1.join('\n'), remediation: "Consider enable CloudWatch logging for this DMS replication task.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[2], conditionIndex:[200..299]
      function jsonQueryChecked11() {
          var input = extract13.call(extract13);
          var out;
          try {
              out = jmespath.search(input, 'Logging.EnableLogging');
          if (out != null && typeof out != 'boolean') {
              throw new Error("UNDETERMINED condition:202", {cause: {status: 'UNDETERMINED', conditionIndex: 202, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.EnableLogging').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return boolean type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:203", {cause: {status: 'UNDETERMINED', conditionIndex: 203, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.EnableLogging').isEvaluationFailed()", currentStateMessage: "The JSON query has failed", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked14() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract13() { if (!this.out) { this.out = jsonChecked14(); } return this.out; };
      function extract10() { if (!this.out) { this.out = jsonQueryChecked11(); } return this.out; };
      try {
          if (!extract10.call(extract10)) {
              return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "not(extract('caJsonBoolean__settingsJsonEnableLogging__c'))", currentStateMessage: "CloudWatch logging is disabled for the DMS replication task.", currentStateReferences: references1.join('\n'), remediation: "Consider enable CloudWatch logging for this DMS replication task.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[3], conditionIndex:[300..399]
      function jsonQueryChecked18() {
          var input = extract20.call(extract20);
          var out;
          try {
              out = jmespath.search(input, 'Logging.LogComponents[?Id==`TARGET_APPLY`].Severity | [0]');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:302", {cause: {status: 'UNDETERMINED', conditionIndex: 302, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`TARGET_APPLY`].Severity | [0]').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return text type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:303", {cause: {status: 'UNDETERMINED', conditionIndex: 303, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`TARGET_APPLY`].Severity | [0]').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked21() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:301", {cause: {status: 'UNDETERMINED', conditionIndex: 301, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract20() { if (!this.out) { this.out = jsonChecked21(); } return this.out; };
      function extract17() { if (!this.out) { this.out = jsonQueryChecked18(); } return this.out; };
      try {
          if (TextLib.isEmpty(extract17.call(extract17))) {
              return {status: 'INCOMPLIANT', conditionIndex: 399, conditionText: "extract('caJsonText__settingsJsonTargetApplySeverity__c').isEmpty()", currentStateMessage: "Logging for the TARGET_APPLY component is not enabled.", currentStateReferences: references1.join('\n'), remediation: "Ensure the TARGET_APPLY log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[4], conditionIndex:[400..499]
      function jsonQueryChecked25() {
          var input = extract27.call(extract27);
          var out;
          try {
              out = jmespath.search(input, 'Logging.LogComponents[?Id==`TARGET_APPLY`].Severity | [0]');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:402", {cause: {status: 'UNDETERMINED', conditionIndex: 402, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`TARGET_APPLY`].Severity | [0]').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return text type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:403", {cause: {status: 'UNDETERMINED', conditionIndex: 403, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`TARGET_APPLY`].Severity | [0]').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked28() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:401", {cause: {status: 'UNDETERMINED', conditionIndex: 401, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract27() { if (!this.out) { this.out = jsonChecked28(); } return this.out; };
      function extract24() { if (!this.out) { this.out = jsonQueryChecked25(); } return this.out; };
      try {
          if (CollectionLib.contains(CollectionLib.fromArray(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR'], true, true, true, true), extract24.call(extract24), true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 499, conditionText: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetApplySeverity__c'))", currentStateMessage: "Logging for the TARGET_APPLY component is below the required LOGGER_SEVERITY_DEFAULT level.", currentStateReferences: references1.join('\n'), remediation: "Ensure the TARGET_APPLY log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[5], conditionIndex:[500..599]
      function jsonQueryChecked32() {
          var input = extract34.call(extract34);
          var out;
          try {
              out = jmespath.search(input, 'Logging.LogComponents[?Id==`TARGET_LOAD`].Severity | [0]');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:502", {cause: {status: 'UNDETERMINED', conditionIndex: 502, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`TARGET_LOAD`].Severity | [0]').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return text type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:503", {cause: {status: 'UNDETERMINED', conditionIndex: 503, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`TARGET_LOAD`].Severity | [0]').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked35() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:501", {cause: {status: 'UNDETERMINED', conditionIndex: 501, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract34() { if (!this.out) { this.out = jsonChecked35(); } return this.out; };
      function extract31() { if (!this.out) { this.out = jsonQueryChecked32(); } return this.out; };
      try {
          if (TextLib.isEmpty(extract31.call(extract31))) {
              return {status: 'INCOMPLIANT', conditionIndex: 599, conditionText: "extract('caJsonText__settingsJsonTargetLoadSeverity__c').isEmpty()", currentStateMessage: "Logging for the TARGET_LOAD component is not enabled.", currentStateReferences: references1.join('\n'), remediation: "Ensure the TARGET_LOAD log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[6], conditionIndex:[600..699]
      function jsonQueryChecked39() {
          var input = extract41.call(extract41);
          var out;
          try {
              out = jmespath.search(input, 'Logging.LogComponents[?Id==`TARGET_LOAD`].Severity | [0]');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:602", {cause: {status: 'UNDETERMINED', conditionIndex: 602, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`TARGET_LOAD`].Severity | [0]').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return text type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:603", {cause: {status: 'UNDETERMINED', conditionIndex: 603, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`TARGET_LOAD`].Severity | [0]').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked42() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:601", {cause: {status: 'UNDETERMINED', conditionIndex: 601, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract41() { if (!this.out) { this.out = jsonChecked42(); } return this.out; };
      function extract38() { if (!this.out) { this.out = jsonQueryChecked39(); } return this.out; };
      try {
          if (CollectionLib.contains(CollectionLib.fromArray(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR'], true, true, true, true), extract38.call(extract38), true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 699, conditionText: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonTargetLoadSeverity__c'))", currentStateMessage: "Logging for the TARGET_LOAD component is below the required LOGGER_SEVERITY_DEFAULT level.", currentStateReferences: references1.join('\n'), remediation: "Ensure the TARGET_LOAD log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[7], conditionIndex:[700..799]
      function jsonQueryChecked46() {
          var input = extract48.call(extract48);
          var out;
          try {
              out = jmespath.search(input, 'Logging.LogComponents[?Id==`SOURCE_CAPTURE`].Severity | [0]');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:702", {cause: {status: 'UNDETERMINED', conditionIndex: 702, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`SOURCE_CAPTURE`].Severity | [0]').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return text type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:703", {cause: {status: 'UNDETERMINED', conditionIndex: 703, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`SOURCE_CAPTURE`].Severity | [0]').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked49() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:701", {cause: {status: 'UNDETERMINED', conditionIndex: 701, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract48() { if (!this.out) { this.out = jsonChecked49(); } return this.out; };
      function extract45() { if (!this.out) { this.out = jsonQueryChecked46(); } return this.out; };
      try {
          if (TextLib.isEmpty(extract45.call(extract45))) {
              return {status: 'INCOMPLIANT', conditionIndex: 799, conditionText: "extract('caJsonText__settingsJsonSourceCaptureSeverity__c').isEmpty()", currentStateMessage: "Logging for the SOURCE_CAPTURE component is not enabled.", currentStateReferences: references1.join('\n'), remediation: "Ensure the SOURCE_CAPTURE log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[8], conditionIndex:[800..899]
      function jsonQueryChecked53() {
          var input = extract55.call(extract55);
          var out;
          try {
              out = jmespath.search(input, 'Logging.LogComponents[?Id==`SOURCE_CAPTURE`].Severity | [0]');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:802", {cause: {status: 'UNDETERMINED', conditionIndex: 802, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`SOURCE_CAPTURE`].Severity | [0]').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return text type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:803", {cause: {status: 'UNDETERMINED', conditionIndex: 803, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`SOURCE_CAPTURE`].Severity | [0]').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked56() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:801", {cause: {status: 'UNDETERMINED', conditionIndex: 801, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract55() { if (!this.out) { this.out = jsonChecked56(); } return this.out; };
      function extract52() { if (!this.out) { this.out = jsonQueryChecked53(); } return this.out; };
      try {
          if (CollectionLib.contains(CollectionLib.fromArray(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR'], true, true, true, true), extract52.call(extract52), true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 899, conditionText: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceCaptureSeverity__c'))", currentStateMessage: "Logging for the SOURCE_CAPTURE component is below the required LOGGER_SEVERITY_DEFAULT level.", currentStateReferences: references1.join('\n'), remediation: "Ensure the SOURCE_CAPTURE log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[9], conditionIndex:[900..999]
      function jsonQueryChecked60() {
          var input = extract62.call(extract62);
          var out;
          try {
              out = jmespath.search(input, 'Logging.LogComponents[?Id==`SOURCE_UNLOAD`].Severity | [0]');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:902", {cause: {status: 'UNDETERMINED', conditionIndex: 902, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`SOURCE_UNLOAD`].Severity | [0]').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return text type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:903", {cause: {status: 'UNDETERMINED', conditionIndex: 903, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`SOURCE_UNLOAD`].Severity | [0]').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked63() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:901", {cause: {status: 'UNDETERMINED', conditionIndex: 901, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract62() { if (!this.out) { this.out = jsonChecked63(); } return this.out; };
      function extract59() { if (!this.out) { this.out = jsonQueryChecked60(); } return this.out; };
      try {
          if (TextLib.isEmpty(extract59.call(extract59))) {
              return {status: 'INCOMPLIANT', conditionIndex: 999, conditionText: "extract('caJsonText__settingsJsonSourceUnloadSeverity__c').isEmpty()", currentStateMessage: "Logging for the SOURCE_UNLOAD component is not enabled.", currentStateReferences: references1.join('\n'), remediation: "Ensure the SOURCE_UNLOAD log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[10], conditionIndex:[1000..1099]
      function jsonQueryChecked67() {
          var input = extract69.call(extract69);
          var out;
          try {
              out = jmespath.search(input, 'Logging.LogComponents[?Id==`SOURCE_UNLOAD`].Severity | [0]');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:1002", {cause: {status: 'UNDETERMINED', conditionIndex: 1002, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`SOURCE_UNLOAD`].Severity | [0]').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return text type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:1003", {cause: {status: 'UNDETERMINED', conditionIndex: 1003, conditionText: "extract('caJsonFrom__settingsJson__c').jsonQueryText('Logging.LogComponents[?Id==`SOURCE_UNLOAD`].Severity | [0]').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function jsonChecked70() {
          var input = obj.CA10A1__settingsJson__c;
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:1001", {cause: {status: 'UNDETERMINED', conditionIndex: 1001, conditionText: "CA10A1__settingsJson__c.asJson().isInvalid()", currentStateMessage: "The Task Settings JSON is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract69() { if (!this.out) { this.out = jsonChecked70(); } return this.out; };
      function extract66() { if (!this.out) { this.out = jsonQueryChecked67(); } return this.out; };
      try {
          if (CollectionLib.contains(CollectionLib.fromArray(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR'], true, true, true, true), extract66.call(extract66), true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 1099, conditionText: "setOfText(['LOGGER_SEVERITY_INFO', 'LOGGER_SEVERITY_WARNING', 'LOGGER_SEVERITY_ERROR']).contains(extract('caJsonText__settingsJsonSourceUnloadSeverity__c'))", currentStateMessage: "Logging for the SOURCE_UNLOAD component is below the required LOGGER_SEVERITY_DEFAULT level.", currentStateReferences: references1.join('\n'), remediation: "Ensure the SOURCE_UNLOAD log component is enabled with a minimum severity of LOGGER_SEVERITY_DEFAULT.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      return {status: 'COMPLIANT', conditionIndex: 1100, conditionText: "otherwise", currentStateMessage: "DMS Migration Task Logging is enabled for all required components with the appropriate severity level.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;


  SELECT
    expectedResult.Id as Id,
    IF (
      IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '')
      AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1)
      AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '')
      AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''),
      "MATCH",
      "FAIL"
    ) as match,
    expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus,
    expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex,
    expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText,
    expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError
  FROM UNNEST(mock_ExpectedResult()) expectedResult
  LEFT JOIN (
      SELECT
          sObject.Id AS Id,
          sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
          sObject.CA10A1__settingsJson__c AS CA10A1__settingsJson__c,
          process_CA10A1__CaAwsDmsMigrationTask__c(
              STRUCT(
                  sObject.Id AS Id,
                  sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                  sObject.CA10A1__settingsJson__c AS CA10A1__settingsJson__c
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10A1__CaAwsDmsMigrationTask__c()) AS sObject
  ) sObject ON sObject.Id = expectedResult.Id;
