Support for modeling queues and lists
dirkbolte opened this issue · comments
Proposal
Reported by: @ioanngolovko
In order to support modeling collections and messaging queues a new data container should be added. The current approach only has one state
with CRUD operations. Adding a dynamic list is challenging.
Idea is to add a new container: list
. The syntax can look like this:
serveEventListeners
recordState
{ "context": "...", "list": { "addLast": { "stateValue": "..." }, "addFirst": { "stateValue": "..." } }
deleteState
{ "context": "...", "list": { "deleteFirst": true, "deleteLast": true, "deleteIndex": 1, "deleteWhere": { "property": "...", "value": "...", }
- response
{ "jsonBody": { "id": "{{state context=... list.last='id'}}", "firstName": "{{state context=... list.first='firstName'}}", "lastName": "{{state context=... list.[1]='lastName'}}" } }
Templating will be supported for all values.
References
No response
Syntax for recordState
and deleteState
is as described.
For Response Templating, the syntax had to be adapted:
{
"jsonBody": {
"id": "{{state context=... list.last='id'}}",
"firstName": "{{state context=... list='[0].firstName'}}",
"lastName": "{{state context=... list='[-1].lastName'}}"
}
}
merged