Show TOC Start of Content Area

Function documentation Event Data Recording  Locate the document in its SAP Library structure

Use

You can use this function to prevent multiple events from being sent when an entity instance was created, changed, or deleted in a transaction. This function is necessary even if several CRUD (create, read, update, or delete) methods were sent in the same transaction for the same entity service.

Features

You use the CAF-implemented event cache feature to store mapping between the transaction, the entity instance, and the corresponding event. You need this feature because an event receiver may not be notified about the changes to an entity service during the transaction. All operations that take place within the transaction are hidden from the receiver. This is achieved by:

     Each value object of an entity service that records which changes took place on the object (ValueObjectChangedEvent)

     An entity service that maintains a list of entity instances which are currently in use by a transaction (ValueObjectChangedEvent)

Value Object Changed Event

Each value object references its own instance of the class ValueObjectChangedEvent. If a setter method for one attribute is sent, the old and new attribute values will be stored in the ValueObjectChangedEvent instance.

As soon as an event transaction is finished, the event data that has been stored in a list maintained by the entity service is sent. Each time a value object is stored or deleted by the entity service, the instance of ValueObjectChangedEvent that is associated with this value object will be merged with the event that is associated with the corresponding transaction.

Event Cache

This class is described in detail in the section Event Cache.

End of Content Area