Skip to content

document post-active switch and behavior#2450

Merged
smahati merged 3 commits intomainfrom
post_active_java
Mar 23, 2026
Merged

document post-active switch and behavior#2450
smahati merged 3 commits intomainfrom
post_active_java

Conversation

@rjayasinghe
Copy link
Contributor

No description provided.

@rjayasinghe rjayasinghe requested a review from smahati as a code owner March 12, 2026 12:48
@rjayasinghe rjayasinghe requested a review from t-bonk March 12, 2026 12:48
@rjayasinghe rjayasinghe self-assigned this Mar 12, 2026
These events have the same semantics as described in section [Handling CRUD events](./cqn-services/application-services#crudevents).

::: tip
With the 4.8.0 release CAP Java introduced a mode where POST without `IsActiveEnitity=true` results in the `CqnService.EVENT_CREATE` (creation of an active entity) for the given entity. This mode is only active when the CDS property `cds.draft.post-active` is set to `true` and an the entity is annotated with `@Common.DraftRoot.NewAction`. The value of entity should be the name of an unbound action in the same service of the entity. In case the entity has a key with the type `UUID` the action needs no further parameter. Otherwise the action needs the key value(s) of the entity as parameters.
Copy link
Contributor

@t-bonk t-bonk Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjayasinghe Isn't there also a compiler setting required in .cdsrc.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no. There is a compiler setting automatically creating the annotation and the action mentioned in the annotation. But an application developer can add the annotation and the action manually to their CDS model and then we can behave the same way.

Copy link
Contributor

@t-bonk t-bonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rjayasinghe
Copy link
Contributor Author

@smahati we're good to go. Please have a look. :)

Co-authored-by: Mahati Shankar <93712176+smahati@users.noreply.github.com>
@smahati smahati enabled auto-merge (squash) March 23, 2026 13:02
@smahati smahati merged commit d26e033 into main Mar 23, 2026
7 checks passed
@smahati smahati deleted the post_active_java branch March 23, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants