Unable to fetch KeyValue map data in defult.xml

I have created one Key Value Map with visibility as environment and in that map i have added one Key as flag and its value as either true or false.

I want to use the flag to execute the policy in proxy. Lets say i have quota policy and one service callout policy . If the flag is true i want to execute quota policy and if it is false then want to execute callout.

I tried using that in defult.xml with condition tag but i am unable to get the value from KVM.

<Condition>(flag==true)</Condition>

I inserted flag as true in KVM

Key Value map Policy

8088-kvm.png

Quota Policy

8089-quotapolicy.png

based on kvm flag value i want to execute quota policy.

Change i made in default.xml

<PreFlow name="PreFlow"> <Request> <Step> <Name>Key-Value-Map-Operations-1</Name> </Step> <Step> <Name>Quota-1</Name> <Conditon>(globalvalues.flag="false")</Conditon> </Step> </Request> <Response/> </PreFlow>

0 2 120
2 REPLIES 2

@raju Yadav, it's not clear from your question as to how you are trying to fetch the values from the KVM. You need to include the KVM operations policy with the GET operation to fetch the values in the KVM into variables.

<Get assignTo="flag"><Key><Parameter>flag</Parameter></Key></Get>

The KVM policy should be included before the quota policy where you are validating the condition.

Secondly the condition should have just a single = sign

<Condition>flag = "true"</Condition>

vsphanindra
Participant II

As per KVM policy shared above value "true" gets assigned to "globalvalues", basing on this field conditional check needs to be performed whether to execute Quota policy or not