on ‎2011 Sep 06 3:38 PM
I have a Map property in a transaction that I would like to set a key's value to.
I first check that the key is there using containskey(map,value)
If it doesn't exists I assign the value using put(map, key, value)
If it does exists I can't get it to assign the value to a certain key.
I am using an Assignment action:
Target XPath = Local.TestMap{"#Dynamic Variable#"}
Expression = "Test"
I am running MII version 12.1.7.50
Request clarification before answering.
Thanks Diana,
I found another route using XPath and MII Documents.
I think I will stear clear of map properties from now on.
Jasper
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that is correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Diana,
I tried doing multiple puts and it works the first time but the second time I get this error:
[ERROR] [Assignment_0] Link ('Local.TestMap' [Assign] from "put(Local.TestMap, Transaction.testmatgroup, For_Next_Loop_0.CurrentItem)") execution threw an exception. Exception: [The first parameter for the 'put' function must be a map type. [The first parameter for the 'put' function must be a map type.]]
[ERROR] [Assignment_0] Action: Runtime threw an exception. Exception: [The first parameter for the 'put' function must be a map type. [The first parameter for the 'put' function must be a map type.]]
I also tried changing the Key to make sure it didn't like the duplicates and it still gave me this error. And yes Local.TestMap is a Map property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jasper,
I've been doing some experimenting, and I cannot make an assignment that way, even without a dynamic reference. However, I did find that I could assign a new value to an existing key by using the put function. For example, where Local.myKey holds the name of the key I want to assign a new value, in this case, of type string:
Source: put(Transaction.myMap, Local.myKey, "Sugar")
Destination: Transaction.myMap
Let me know if this works for you.
Warm Regards,
Diana Hoppe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.