From 4dc00deffed3cc6be0f7e5e61e5dea9d9e5985a4 Mon Sep 17 00:00:00 2001 From: Steffen Weinstock <79531202+stewsk@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:01:30 +0200 Subject: [PATCH 1/2] cds: use "IsActiveEntity" in anno expressions --- cds/cdl.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cds/cdl.md b/cds/cdl.md index 13389267d..46e6beeb6 100644 --- a/cds/cdl.md +++ b/cds/cdl.md @@ -1105,6 +1105,7 @@ Each path in the expression is checked: * If the annotation is assigned to a subelement of a structured element, the top level elements of the entity can be accessed via `$self`. * A parameter `par` can be accessed via `:par`, just like parameters of a parametrized entity in queries. +* For a draft-enabled entity, element `IsActiveEntity` can be accessed via prefix `$draft`. * If a path cannot be resolved successfully, compilation fails with an error. In contrast to `@aReference: foo.bar`, a single reference written as expression `@aRefExpr: ( foo.bar )` From fbde2a547db3a77f726c19a336917a45c76d1453 Mon Sep 17 00:00:00 2001 From: hjboth <124381150+hjboth@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:06:47 +0200 Subject: [PATCH 2/2] Update cdl.md --- cds/cdl.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cds/cdl.md b/cds/cdl.md index 46e6beeb6..c079395b4 100644 --- a/cds/cdl.md +++ b/cds/cdl.md @@ -1105,8 +1105,10 @@ Each path in the expression is checked: * If the annotation is assigned to a subelement of a structured element, the top level elements of the entity can be accessed via `$self`. * A parameter `par` can be accessed via `:par`, just like parameters of a parametrized entity in queries. -* For a draft-enabled entity, element `IsActiveEntity` can be accessed via prefix `$draft`. -* If a path cannot be resolved successfully, compilation fails with an error. +* The draft specific element `IsActiveEntity` can be referred to with the magic variable `$draft.IsActiveEntity`. + During draft augmentation `$draft.IsActiveEntity` is rewritten to `$self.IsActiveEntity` for all draft enabled + entities (root and sub nodes but not for named types or entity parameters). +* If a path can't be resolved successfully, compilation fails with an error. In contrast to `@aReference: foo.bar`, a single reference written as expression `@aRefExpr: ( foo.bar )` is checked by the compiler.