Read Data

This handler (com.rierino.handler.ReadEventHandler) provides ability to select one, multiple or all records from a state manager on demand, facilitating common REST API read calls.

Handler Parameters

This handler requires no parameters. This handler is cacheable.

Actions

Get

Reads and returns aggregate for a single ID from a specific state manager. Event metadata fields applicable for this action are as follows:

Field
Definition
Example
Default

Domain

Name of the state manager to read data from

product

-

Input Element

Json path for the input in request event payload

parameters

-

Output Element

Json path for the output in response event payload

product

-

With event metadata parameters as:

Parameter
Definition
Example
Default

Output Pattern

JMESPath pattern to apply on data output, before returning response

{id:id, name:data.name, description:data.description}

-

ID Path

Json path for the id field in input element

product.id

id

ID Value

Static ID to read instead of idPath value

1234

-

Fields

Comma separated list of fields to keep in response

data.name,data.description

-

Form

Form of response to produce (i.e. full=including custom data fields)

full

-

Customize By

Comma separated list of customizations to apply to data

luxury,tech_savvy

-

Version Type

Type of version data to return (history, snapshot, none)

history

none

chevron-rightExamplehashtag

Input

Event Metadata

GetList

Reads and returns aggregates for a list of ID from a specific state manager. Event metadata fields applicable for this action are as follows:

Field
Definition
Example
Default

Domain

Name of the state manager to read data from

product

-

Input Element

Json path for the input in request event payload

parameters.products

-

Output Element

Json path for the output in response event payload

list

-

circle-info

If input element ends with .*, it allows iteration of an array of {id:""} objects for injection of their details. Otherwise, this action expects a list of ids in [""] form.

With event metadata parameters as:

Parameter
Definition
Example
Default

Output Pattern

JMESPath pattern to apply on each data output, before returning response

{id:id, name:data.name, description:data.description}

-

Fields

Comma separated list of fields to keep in response

data.name,data.description

-

Form

Form of response to produce (i.e. full=including custom data fields)

full

-

Customize By

Comma separated list of customizations to apply to data

luxury,tech_savvy

-

Skip

Number of rows to skip in results

20

-

Limit

Maximum number of rows to return

10

-

Version Type

Type of version data to return (history, snapshot, none)

history

none

circle-info

For complex use cases with skip, limit, fields or outputPattern using QueryEventHandler could provide better performance, as it benefits from pass-thru query execution.

GetAll

Reads and returns all aggregates from a specific state manager. Event metadata fields applicable for this action are as follows:

Field
Definition
Example
Default

Domain

Name of the state manager to read data from

product

-

Output Element

Json path for the output in response event payload

list

-

With event metadata parameters as:

Parameter
Definition
Example
Default

Output Pattern

JMESPath pattern to apply on each data output, before returning response

{id:id, name:data.name, description:data.description}

-

Fields

Comma separated list of fields to keep in response

data.name,data.description

-

Form

Form of response to produce (i.e. full=including custom data fields)

full

-

Customize By

Comma separated list of customizations to apply to data

luxury,tech_savvy

-

First

Whether only the first record should be returned as a single value or not

true

-

Skip

Number of rows to skip in results

20

-

Limit

Maximum number of rows to return

10

-

Order By

Order by field for results with direction

name desc

-

Count As

Json path to return total number of rows on event payload

total

-

Last updated