ItemSerializerValve

Valve for serializing the current set of items.

Item serializing means taking all items surviving the item include expression (if any) and convert them to json and store the result (encoded or not) in a property in the destination scope for later retrieval (deserialization).

Available destination scopes:

  • item
  • session
  • attributes

By default serialized items are encoded in base 64 to avoid problems with embedded json.

De-serialization can be done using ItemDeserializerValve.

Properties

Name Description Default value Mandatory Supports property expansion
dest_scope
Result scope item No No
dest_id
Result item id (only used if scope is 'item') result No Yes
dest_name
Result property name (applies to configured scope) items No Yes
keep_items
Flag controlling if serialized items should be removed false No No
encode Flag controlling if serialized items should encoded (base 64) or stored as plain json true No No

Example Configuration

{      
  "name": "ItemSerializerValve",
  "enabled": "true",
  "config": {
    "dest_scope": "session",
    "dest_name": "items",
    "item_include_expr": "item.serializable === 'true'",
    "keep_items": "true",
    "encode": "false"
  }
}

Requirements

If destination scope is session, session  must be loaded.