This blog will explain the concept of data store in SAP CPI (Cloud Platform Integration).
What is Data Store Operations
Data Store is a collection of operations to allow you to store and retrieve messages into/from the database. You can use these operations to store, retrieve or delete entries from the data store.
- Write
- Get
- Select
- Delete
Let’s talk about each operation in detail.
Write Operation.
Write allows storing entries in the data store.
Data Store Name: The name of the data store where you would like to store this message. The name should not contain any white spaces and can be 20 characters long.
Visibility: indicates if the data store is only visible within the integration flow where it is defined or to all the integration flows that are deployed on that tenant.
Entry ID: a unique identifier to identify the entry. It can be picked from a header or from the message using XPath. If nothing is provided, the system generates a random GUID for this entry.
Retention Threshold for Alerting (in d): defines the number of days by when the entry must be read. Else an alert is generated in the cloud platform account. Default – 2days.
Expiration Period (in d): the number of days (from when the entry is written into the data store) after which the entry must be deleted from the data store.
Encrypt Stored Message: check this if you want to encrypt the message before storing.
Overwrite Existing Message: check this if you want to overwrite a message (if one already exists) with the same Entry ID in this data store.
Get Operation.
Get is used to retrieve one entry from the data store:
Data Store Name: The name of the data store from where the entry needs to be retrieved.
Visibility: indicates if the data store is visible only to this integration flow or to all the integration flows on the tenant.
Entry ID: the unique identifier of the entry you want to retrieve from the data store. If this is left empty, the last entry that was added to the data store is retrieved. It can also be picked from a header or from the message using XPath.
Delta After Fetch: check this if you want to delete the entry from the data store after retrieving.
Select Operation
Select is used to retrieve multiple messages from the data store in one bulk:
Data Store Name: The name of the data store from where the entries need to be retrieved
Visibility: indicates if the data store is visible only to this integration flow or to all the integration flows on the tenant.
Number of Polled Messages: enter the number of messages that you would like to retrieve from the data store.
Delta After Fetch: check this if you want to delete the entry from the data store after retrieving.
Delete Operation
Delete allows you to delete messages from the data store.
Data Store Name: The name of the data store from where an entry needs to be deleted.
Visibility: indicates if the data store is visible only to this integration flow or to all the integration flows on the tenant.
Entry ID: the unique identifier of the entry you want to delete from the data store. If this is left empty, the last entry that was added to the data store is retrieved. It can also be picked from a header or from the message using XPath.
Additional Information:
- A data store works with the entire message, not part of it. It will write, read or delete an entire message.
- Never use the name sap_global_store for your data store as it is used by the system to store variables created by the Write Variable step.
- If the message processing fails, the transaction is rolled back and the entry added to the data store shall be deleted.
- If you try to Write an entry to the data store with an entry ID that already exists and “Overwrites Existing Message” is not checked, the message processing will fail.
For more details:
SAP Cloud Platform Integration- Library
More CPI Blogs