I am using below condition which works if I pass cid = 123 in my request.
<Step> <Name>Raise-Fault-1</Name> <Condition>NOT(cid=123)</Condition> </Step>
But when I tried passing any varchar it fails. Tried using both as below:
<Condition>NOT(cid='apigee')</Condition>
OR
<Condition>NOT(cid=apigee)</Condition>
Is there any syntax to use this in fault policy? Please advice. Let me know how this can be achieved using Fault Policy.
Solved! Go to Solution.
Is there any syntax to use this in fault policy?
Yes. It's not really the fault policy you're asking about. I think you're asking, what's the correct syntax to use in a Condition element?
Sadly, the thing you're running into is, the string needs to be delimited in double quotes. You used single quotes. I would prefer if Apigee would reject your Condition statement that uses single quotes, and tell you that. but today, it doesn't.
In any case, all of the following are equivalent, and any of these will work:
<Condition>cid != "apigee"</Condition> <Condition>NOT(cid="apigee")</Condition> <Condition>NOT (cid = "apigee")</Condition> <Condition>cid NotEquals "apigee"</Condition> <Condition>NOT (cid Equals "apigee")</Condition>
Can you try below.
<Condition>NOT(cid Equals "apigee")</Condition>
Or, simpler still
<Condition>cid != "apigee"</Condition>
Is there any syntax to use this in fault policy?
Yes. It's not really the fault policy you're asking about. I think you're asking, what's the correct syntax to use in a Condition element?
Sadly, the thing you're running into is, the string needs to be delimited in double quotes. You used single quotes. I would prefer if Apigee would reject your Condition statement that uses single quotes, and tell you that. but today, it doesn't.
In any case, all of the following are equivalent, and any of these will work:
<Condition>cid != "apigee"</Condition> <Condition>NOT(cid="apigee")</Condition> <Condition>NOT (cid = "apigee")</Condition> <Condition>cid NotEquals "apigee"</Condition> <Condition>NOT (cid Equals "apigee")</Condition>
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |