Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 22.1a
Div
Classe2e-refDiv

Otp
Floatingfalse

Rp

Hint_designer
PageMemory Adapter
TopicMemory Adapter

The memory add-on allows to store and retrieve values to respectively from the memory.

Multiexcerpt include
MultiExcerptNamememory
nopaneltrue
PageWithExcerptINTERNAL:_examples_BRIDGE

Memory Scope

By default, the memory is in scope of the service composite (server process), but it is also possible to store values in a request session context. Basically, the memory adapter is a thread-safe hash list allowing to

  • share objects among requests (service scope, also called global scope)
    To store objects in service scope and to share them between requests to the same service, set scope to global on the Memory adapter. In this case, you need to propagate the memory key between requests, or use a static key.
  • keep data for one request (session scope)
    To keep data within the request, set scope to session on the Memory adapter. At the end of the request session, the memory will be cleared.

Anchor
store
store

Storing Data to Memory

To store data to memory, provide the Memory adapter with the following:

  • the data in parameter value
  • a key, that can be used to access the data in memory
  • the Memory Adapter action store

Figure: Storing a Data to memory

If an element with the given key already exists in memory, it will be overwritten by the Memory Adapter. In this case, parameter oldValue returns the value that got overwritten.

Anchor
retrieve
retrieve

Retrieving Data From Memory

To retrieve data that has been stored to memory, provide the Memory adapter with the following:

  • the key that has been used to store the data to memory
  • the Memory Adapter action retrieve

Figure: Retrieving Data from Memory

If no data with the given key can be found, the Memory adapter throws an error.

Related Error Codes

Find a list of all persistent state error codes on System Errors of the Memory Adapter.

Error CodeDescription
MEMADSM/9The message is not stored here.

Anchor
remove
remove

Removing Stored Data

To remove data from memory, provide the Memory adapter with the following:

  • the key that has been used to store the data to memory
  • the Memory Adapter action remove

Figure: Removing Data from Memory

Parameter oldValue returns the value that has been removed. If no data with the given key can be found, the Memory adapter throws an error (MEMADSM/12, see also the list of system errors).

Related Error Codes

Find a list of all persistent state error codes on System Errors of the Memory Adapter.

Error CodeDescription
MEMADSM/12The message is not stored here.

Anchor
clear
clear

Clearing the Memory

Multiexcerpt
MultiExcerptNameclear_memory

To clear the complete used memory, provide the Memory adapter with the following:

  • the Memory Adapter action clear

Figure: Clearing the Memory