<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssertCondition">
<!-- Display name for this policy -->
<DisplayName>DISPLAY_NAME</DisplayName>
<!-- Assertion's condition where operators are defined -->
<Condition>CONDITIONAL_STATEMENT</Condition>
</AssertCondition>
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-05 UTC。"],[[["\u003cp\u003eThe AssertCondition policy in Apigee and Apigee hybrid evaluates a conditional statement based on flow variables in request or response flows, determining if it's true or false.\u003c/p\u003e\n"],["\u003cp\u003eThe result of the conditional evaluation is stored in the \u003ccode\u003eassertcondition.\u003c/code\u003e\u003cvar translate=no\u003epolicy-name\u003c/var\u003e\u003ccode\u003e.truthValue\u003c/code\u003e flow variable, which can be used in subsequent operations within the flow.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e<AssertCondition>\u003c/code\u003e element, a key part of this policy, allows for defining a conditional statement using one or more conditions joined by logical operators.\u003c/p\u003e\n"],["\u003cp\u003eThe policy has attributes like \u003ccode\u003ename\u003c/code\u003e, \u003ccode\u003econtinueOnError\u003c/code\u003e, and \u003ccode\u003eenabled\u003c/code\u003e, which control its behavior and can be set to customize the error response or enable/disable the policy.\u003c/p\u003e\n"],["\u003cp\u003eRuntime and deployment errors, such as \u003ccode\u003esteps.assertcondition.ConditionEvaluationFailed\u003c/code\u003e and \u003ccode\u003eInvalidCondition\u003c/code\u003e, can occur and are associated with specific fault codes and fault variables for error handling.\u003c/p\u003e\n"]]],[],null,["# AssertCondition policy\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nOverview\n--------\n\n\nThe AssertCondition policy evaluates a conditional statement at runtime in the\nrequest or response flows. You can define a condition based on the flow variables,\nand use this policy to assert the condition. A condition always evaluates to a\nboolean value, either true or false. For more information about writing a conditional statement, see\n[Conditions reference](/apigee/docs/api-platform/reference/conditions-reference).\n\nAfter evaluating the condition, the AssertCondition policy stores the result of\nthe evaluation in the `assertcondition.`\u003cvar translate=\"no\"\u003epolicy-name\u003c/var\u003e`.truthValue` flow variable.\nYou can use the resultant flow variable in your subsequent callouts or orchestrated logic.\nIf a condition evaluates to true, the value of the variable is set to\n`true`, `false` otherwise. If you have defined multiple\nAssertCondition policies, the `policy-name` in the\nvariable name helps you to uniquely identify the variable.\n\nThis policy is a *Standard policy* and can be deployed to any environment type. For\ninformation on policy types and availability with each environment type, see\n[Policy types](/apigee/docs/api-platform/reference/policies/reference-overview-policy#policy-types).\n\n`\u003cAssertCondition\u003e`\n-------------------\n\nDefines an `\u003cAssertCondition\u003e` policy. By using this policy, you can evaluate a\nconditional statement that has one or more conditions joined by a logical operator. For information\nabout all the supported operators in a condition, see [Operators](/apigee/docs/api-platform/reference/conditions-reference#operators).\nThe result of a conditional statement is a boolean which can be either a `true` or a `false`.\n\nThe following table provides a high-level description of the child elements of [`\u003cAssertCondition\u003e`](/apigee/docs/api-platform/reference/policies/assert-condition-policy#assertcondition):\n\nThe `\u003cAssertCondition\u003e` element uses the following syntax: \n\n### Syntax\n\n```scdoc\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n\u003cAssertCondition\"\u003e\n \u003c!-- Display name for this policy --\u003e\n \u003cDisplayName\u003eDISPLAY_NAME\u003c/DisplayName\u003e\n \u003c!-- Assertion's condition where operators are defined --\u003e\n \u003cCondition\u003eCONDITIONAL_STATEMENT\u003c/Condition\u003e\n\u003c/AssertCondition\u003e\n```\n\n### Example\n\nThe following example checks if the `google.dialogflow.my-prefix.claimAmount` variable is greater\nthan 0 and less than 1000. \n\n```text\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n\u003cAssertCondition continueOnError=\"false\" enabled=\"true\"\n name=\"MyAssertCondition\"\u003e\n \u003cDisplayName\u003eAssert My Condition\u003c/DisplayName\u003e\n \u003cCondition\u003e(google.dialogflow.my-prefix.claimAmount \u003e 0)\n and\n (google.dialogflow.my-prefix.claimAmount LesserThan 1000)\u003c/Condition\u003e\n\u003c/AssertCondition\u003e\n```\n\nIn this example:\n\n- If the value of `google.dialogflow.my-prefix.claimAmount` variable is 500, the condition evaluates to true and hence the `assertcondition.MyAssertCondition.truthValue` variable is set to `true`.\n- However, if the value of the `google.dialogflow.my-prefix.claimAmount` variable is 1200, the `assertcondition.MyAssertCondition.truthValue` variable is set to `false`.\n\nThis element has the following attributes that are common to all policies:\n\nChild element reference\n-----------------------\n\nThis section describes the child elements of [`\u003cAssertCondition\u003e`](/apigee/docs/api-platform/reference/policies/assert-condition-policy#assertcondition).\n\n### `\u003cCondition\u003e`\n\nSpecifies the condition to evaluate. For more information\nabout writing a conditional statement in Apigee, see\n[Conditions reference](/apigee/docs/api-platform/reference/conditions-reference).\n\n### `\u003cDisplayName\u003e`\n\nUse in addition to the `name` attribute to label the policy in the\nmanagement UI proxy editor with a different, more natural-sounding name.\n\nThe `\u003cDisplayName\u003e` element is common to all policies.\n\nThe `\u003cDisplayName\u003e` element uses the following syntax: \n\n### Syntax\n\n```scdoc\n\u003cPolicyElement\u003e\n \u003cDisplayName\u003e\u003cvar translate=\"no\"\u003ePOLICY_DISPLAY_NAME\u003c/var\u003e\u003c/DisplayName\u003e\n ...\n\u003c/PolicyElement\u003e\n```\n\n### Example\n\n```text\n\u003cPolicyElement\u003e\n \u003cDisplayName\u003eMy Validation Policy\u003c/DisplayName\u003e\n\u003c/PolicyElement\u003e\n```\n\nThe `\u003cDisplayName\u003e` element has no attributes or child elements.\n\nError codes\n-----------\n\n\nThis section describes the fault codes and error messages that are returned and fault variables that are set by Apigee when this policy triggers an error.\nThis information is important to know if you are developing fault rules to\nhandle faults. To learn more, see [What you need to know\nabout policy errors](/apigee/docs/api-platform/fundamentals/what-you-need-know-about-policy-errors) and [Handling\nfaults](/apigee/docs/api-platform/fundamentals/fault-handling).\n\n### Runtime errors\n\nThese errors can occur when the policy executes.\n\n### Deployment errors\n\nThese errors can occur when you deploy a proxy containing this policy.\n\n### Fault variables\n\nWhenever there are execution errors in a policy, Apigee generates error messages. You can view\nthese error messages in the error response. Many a time, system generated error messages might not be relevant\nin the context of your product. You might want to customize the error messages based on the\ntype of error to make the messages more meaningful.\n\nTo customize the error messages, you can use either fault rules or the RaiseFault policy. For\ninformation about differences between fault rules and the RaiseFault policy, see\n[FaultRules vs. the RaiseFault policy](/apigee/docs/api-platform/fundamentals/fault-handling#rulesvraisefault).\nYou must check for conditions using the `Condition` element in both the fault rules and the RaiseFault policy.\nApigee provides fault variables unique to each policy and the values of the fault variables are set when a policy triggers runtime errors.\nBy using these variables, you can check for specific error conditions and take appropriate actions. For more information about checking error\nconditions, see [Building conditions](/apigee/docs/api-platform/fundamentals/fault-handling#buildingconditions).\n\nThe following table describes the fault variables specific to this policy.\n\nFor more information about policy errors, see [What you\nneed to know about policy errors](/apigee/docs/api-platform/fundamentals/what-you-need-know-about-policy-errors).\n\n\u003cbr /\u003e"]]