create key value map using kvm policy ,but not able

Not applicable

I have created keyvalue map using below policy .

<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="KV-Key-Value-Map-Operations-Create" mapIdentifier="VehicleId">
    <DisplayName>KV-Key Value Map Operations-Create</DisplayName>
    <Properties />
    <ExclusiveCache>false</ExclusiveCache>
    <ExpiryTimeInSecs>300</ExpiryTimeInSecs>
    <InitialEntries>
        <Entry>
            <Key>
                <Parameter>VIN</Parameter>
            </Key>
            <Value>112233 </Value>
        </Entry>
    </InitialEntries>
    <Scope>environment</Scope>
</KeyValueMapOperations>

I have used another proxy with endpoint to fetch key value created in environment using KVM policy get and Assignmessage policy to display as response.But AM is not getting the value.

KVM policy:

<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="KV-Key-Value-Map-Operations-GET" mapIdentifier="VehicleId">
    <DisplayName>KV-Key Value Map Operations-GET</DisplayName>
    <Properties />
    <ExclusiveCache>false</ExclusiveCache>
    <ExpiryTimeInSecs>300</ExpiryTimeInSecs>
    <Get assignTo="VINkey" index="1">
        <Key>
            <Parameter ref="VIN" />
        </Key>
    </Get>
    <Scope>environment</Scope>
</KeyValueMapOperations>

Assign message policy:

<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-Assign-Message-GET">
    <DisplayName>AM-Assign Message-GET</DisplayName>
    <Properties />
    <Set>
        <Payload contentType="text/xml">
            <root>
                <countryname>{VINkey.VIN}</countryname>
            </root>
        </Payload>
    </Set>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="response" />
</AssignMessage>

can any please suggest me ,what went wrong.

Solved Solved
0 3 381
1 ACCEPTED SOLUTION

@veeraraghavendra ,

Couple of issue in your policy code,

1. In GET KVM, Whey you say ,

<Parameter ref="VIN" />

In above code you are referring to VIN variable for key name. It should be like this below,

<Parameter>VIN</Parameter>

It's the most common pitfall when it comes to KVM, I was in similar situation few times. ref referes to a variable which has value as key name.

2. In Assign message policy instead of ,

<countryname>{VINkey.VIN}</countryname>

It should be ,

<countryname>{VINkey}</countryname>

Hope it helps. See working proxies attached for your referencekvm-proxy1-rev1-2017-02-23.zipkvm-proxy2-rev1-2017-02-23.zip. If you think your query is resolved, Please accept answer. Keep us posted if any.

View solution in original post

3 REPLIES 3

@veeraraghavendra ,

Couple of issue in your policy code,

1. In GET KVM, Whey you say ,

<Parameter ref="VIN" />

In above code you are referring to VIN variable for key name. It should be like this below,

<Parameter>VIN</Parameter>

It's the most common pitfall when it comes to KVM, I was in similar situation few times. ref referes to a variable which has value as key name.

2. In Assign message policy instead of ,

<countryname>{VINkey.VIN}</countryname>

It should be ,

<countryname>{VINkey}</countryname>

Hope it helps. See working proxies attached for your referencekvm-proxy1-rev1-2017-02-23.zipkvm-proxy2-rev1-2017-02-23.zip. If you think your query is resolved, Please accept answer. Keep us posted if any.

@Anil sagar ,It is working .Thanks a lot

Anytime @veeraraghavendra , Keep us posted moving forward if any.