Handling Large Messages Using Claim Check Pattern

Prerequisites

You must ensure that you have a Process Orchestration installation including a BPM and an AEX system.

Context

Messaging is a reliable and fast way to transmit information, but if messages contain a large amount of data, this can reduce the efficiency of a system. The Claim Check pattern reduces data volume by filtering the message content. It stores complete message information in a persistent store, from where it can be retrieved later using a unique key. The Claim Check pattern solves the problem of moving large amounts of data across systems.

When a message with a large volume of data arrives, the Claim Check component, generates a unique Claim Check key for the information. The data required for processing in BPM is extracted from the original large message to create a smaller message. The Claim Check key is added to the smaller message. The Claim Check component then stores the large message in a persistent store and assigns it a unique key. BPM processing runs more efficiently using the smaller message and when the complete message is required, the Claim Check key is used to retrieve the data from the store.

In Process Orchestration systems, the unused data of large messages in the memory reduces efficiency. Efficiency improves if the process contains smaller messages as most of the BPM processes require only a limited part of the content of the individual PI messages. Using the Claim Check pattern, you can replace the message content with a Claim Check key, which is used to retrieve the entire message content later. The original message is stored temporarily while the intermediate steps are provided with a smaller message along with a key, which is used to retrieve the original message later for processing.

You use the SAP PI Message Store, which gives you control on the life cycle of the messages stored in a Claim Check scenario. You retrieve messages and change the status of the message. The PI standard delete job automatically deletes the messages that are scheduled for deletion.

Procedure

  1. Define the Interfaces

    The original large message has all fields, however, you have to define a lean and an aggregated message to implement the Claim Check pattern. The smaller lean message has the basic fields from the large message that are required for processing and one additional field to establish the link between the large and lean message during retrieval. The aggregated message has the collection of related smaller messages with the same correlation key. You use the SAP PI Enterprise Services Repository to model the interface.

    For more information on how to create a new smaller interface with the fields required by BPM from your existing large interface, see also Working with Process Component Architecture Models .

  2. Create the PI Operations Mapping

    You create two mappings to execute the Claim Check pattern. The first mapping extracts a few fields from the large PI message to the small message. The second mapping merges several individual messages into one large aggregated message.

    For more information, see also Mapping Messages to Each Other Using Mapping Objects .

  3. Configure the Integration Flows and an Adapter Module

    You must configure the integration flows to use the smaller message as the receiver channel for integration flows. The integration flows must be enhanced using the SCPMappingBean adapter module at the receiver channel. Adapter modules are stateless EJBs, which are used to enhance adapters for special data handling. You can define the generic modules in the module processor with each adapter. The module forwards the message to the adapter, which transfers the message to the connected system. The adapter addresses the module processor in the form of a bean for transferring the message object as a PI message or its own format. The SCPMappingBean adapter module has the following module parameters:

    • mappingID: This is the object ID of the PI operation mapping in the ESR that is used for the transformation of larger messages to smaller messages.

    • persistuntil: This is the estimated time period in days for which the large message is to be stored in the message store.

    • xpath: This is the field of the lean interface in which the message ID will be placed by the bean. It contains the link (an ID), identified to connect the large and small message for retrieval of the original message later, for example, xpath of PI Message ID.

    For more information, see also Configuring the Integration Flows and an Adapter Module .

  4. Configure the BPM Processes Using Web Services

    The SAP BPM process uses the smaller message for processing, however at the end you will need the original large message for further processing. You retrieve the payload by using two Web services.

    The first Web service calls the OriginalMessageAccessorBean at the end of the BPM process to retrieve those messages from the message store, for which the messageID has been handed over as a parameter. You can configure it by using the input and output mapping:

    1. Input mapping:

      • MESSAGE_ID_LIST: List of message IDs to be read from the message store.

      • PROCESS_INSTANCE_ID: The This process instance ID of the process calling the bean. This is used for tracing and logging for supportability.

      • OPERATION_MAPPING_GUID and SWCV_GUID: GUIDs of the associated operation mapping in the ESR, created from the list of large messages to the aggregated message.

    2. Output mapping:

      • Cast the result XML-string to the target data object.

    The second Web service calls the MessageStatusUpdaterBean after the step for the retrieval of all messages. You can configure it by using the input mapping.

    1. Input mapping:

      • MESSAGE_ID_LIST: List of message IDs to be read from the message store

      • PROCESS_INSTANCE_ID: The process Instance ID of the process calling the bean. This is used for tracing and logging for supportability.

    For more information, see also Configuring the BPM Processes Using Web Services .