Write Data
This handler (com.rierino.handler.WriteEventHandler) provides ability to create, update, delete records on a state manager on demand, facilitating common REST API write calls.
Handler Parameters
Parameter
Definition
Example
Default
Actions
Field
Definition
Example
Default
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Write Data action eventMeta fields",
"type": "object",
"properties": {
"eventMeta": {
"type": "object",
"properties": {
"domain": {
"type": "string",
"definition": "Name of the state manager to read data from",
"example": "product"
},
"inputElement": {
"type": "string",
"definition": "Json path for the input in request event payload",
"example": "parameters"
},
"outputElement": {
"type": "string",
"definition": "Json path for the output in response event payload",
"example": "$.product"
}
}
}
}
}Parameter
Definition
Example
Default
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Write Data action eventMeta.parameters",
"type": "object",
"properties": {
"eventMeta": {
"type": "object",
"properties": {
"parameters": {
"type": "object",
"properties": {
"inputPattern": {
"type": "string",
"definition": "JMESPath pattern to apply on data input",
"example": "{id:parameters.id, data:parameters.data}"
},
"outputPattern": {
"type": "string",
"definition": "JMESPath pattern to apply on data output, before returning response",
"example": "{id:id, name:data.name, description:data.description}"
},
"useDiff": {
"type": "boolean",
"definition": "Whether handler should generate journals keeping only actual updates from current data for the event",
"default": false,
"example": true
},
"ifPattern": {
"type": "string",
"definition": "JMES path pattern evaluating condition on current data to decide whether to execute update",
"example": "data.status == 'A'"
},
"failStale": {
"type": "boolean",
"definition": "Whether to fail in case a request with old instance version or offset arrives",
"default": true,
"example": false
},
"returnResult": {
"type": "boolean",
"definition": "Whether the action should return updated data after the change",
"default": true,
"example": false
},
"immediate": {
"type": "boolean",
"definition": "Whether the action should be executed immediately, or can be buffered for bulk execution",
"default": true,
"example": false
},
"keepImpact": {
"type": "boolean",
"definition": "Whether the action should also return the impact created on current record",
"default": false,
"example": true
},
"keepUndo": {
"type": "boolean",
"definition": "Whether the action should also return the undo action required to revert the impact",
"default": false,
"example": true
},
"structure": {
"type": "string",
"definition": "Type of input to apply updates for (array / each / multi / single)",
"default": "single",
"example": "array"
},
"dataPath": {
"type": "string",
"definition": "Json path for the data to use in update, when form is \"multi\"",
"default": "data",
"example": "newData"
},
"idsPath": {
"type": "string",
"definition": "Json path for the ids to update, when form is \"multi\"",
"default": "ids",
"example": "productids"
},
"itemPath": {
"type": "string",
"definition": "Json path for the array field to update (for SetElement and RemoveElement)",
"example": "parameters"
},
"allowManualId": {
"type": "boolean",
"definition": "When creating a new record, whether IDs can be given manually, if there is already an ID generator",
"default": false,
"example": true
}
}
}
}
}
}
}Create
Update
Set
Upsert
Delete
Undelete
Remove
SetElement
RemoveElement
CallSP
Parameter
Definition
Example
Default
Last updated

