cancel
Showing results for 
Search instead for 
Did you mean: 

How to abort event handler?

03-18-2022 9:50 AM
1083 views 1 comments
0 Likes
SAP Managed Tags
Subscribe

Hello.

I am trying to create a CAP Java application and override the standard update logic. So that when we update, the entity does not change, but there are 2 entities. For example, one with old data and version 1, and the second with new data and version 2.

And the question is how to stop the execution of event handlers so that the request ends at before and does not go further into on and after.

Are there any ways to do this somehow?

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

marcbecker
Product and Topic Expert
Product and Topic Expert
0 Likes

I'd recommend to read our documentation about the event phases Before, On and After: https://cap.cloud.sap/docs/java/provisioning-api#phases

In your Before handler you can skip the On handlers, by completing the event or returning a result.
After handlers are always executed after that.

However usually it is best to simply define your own On handler and overwrite the default logic with that, as the On handler should be responsible for the "core processing" and should compute the result of the event.