Reputation: 45
I have a data container, with 9 values in it. The order I want in my data container when it arrives is as follows:
<entry name="userId">
<valstr>u517775</valstr>
</entry>
<entry name="beginTime">
<valstr>2017-08-11 - 09:44:00</valstr>
</entry>
<entry name="endTime">
<valstr>2017-08-11 - 09:44:15</valstr>
</entry>
<entry name="mailOffice">
<valstr>insert function here</valstr>
</entry>
<entry name="eersteScore">
<valstr>25.0</valstr>
</entry>
<entry name="verbetering">
<valstr>-20.0</valstr>
</entry>
<entry name="procentueleScore">
<valstr>5.0</valstr>
</entry>
<entry name="aantalVragen">
<valstr>20</valstr>
</entry>
<entry name="pogingen">
<valstr>2.0</valstr>
</entry>
But somehow it always ends up in the same order, but not the one I want. I know this is because the array in Movilizer is actually a hashmap, and a way to solve it is using keys from 0-8 instead of strings. But is there a way I could achieve this without changing the keys?
My MEL code:
data['userId'] = $global: userID;
data['beginTime'] = $local: beginTime;
data['endTime'] = call($global: getDateTime)();
data['mailOffice'] = "insert function here";
data['eersteScore'] = $local: firstScore;
data['verbetering'] = verbetering;
data['procentueleScore'] = procentScore;
data['aantalVragen'] = $local: aantalVragen;
data['pogingen']= $local: pogingen;
writeContainer(concat(data['userId'], "-", strReplace(data['endTime'], " - ", "-")), data, 0);
Thanks in advance!
Upvotes: 1
Views: 90
Reputation: 608
I believe you require help in other areas of your system design. The order of the elements in the hashtable itself and the order of the entry elements in the xml response should not have any impact. Maybe it will help to open another question in which you describe what you want to achieve to receive input about a best practice approach for that
Upvotes: 3