Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cds/cdl.md
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +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.
* 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`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm, compared to the other entries in this list, this is a rather long and detailed description for a special case

Copy link
Contributor

Choose a reason for hiding this comment

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

yes that's right, it's a special case that (what I think) needs some more detailed explanation (all others in this list are straight forward and will always work)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

During draft augmentation `$draft.IsActiveEntity` is rewritten to `$self.IsActiveEntity` for all draft enabled
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
During draft augmentation `$draft.IsActiveEntity` is rewritten to `$self.IsActiveEntity` for all draft enabled
During draft augmentation `$draft.IsActiveEntity` is rewritten to `$self.IsActiveEntity` for all root and sub nodes of draft enabled

does this rewrite mean that it's $draft.IAE in some handlers and then it's always $self.IAE?

Copy link
Contributor

Choose a reason for hiding this comment

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

it has nothing to do with handlers...

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
During draft augmentation `$draft.IsActiveEntity` is rewritten to `$self.IsActiveEntity` for all draft enabled
It can be reffered to by `$self.IsActiveEntity` in all root and sub nodes of draft enabled

Copy link
Contributor

@hjboth hjboth Jul 26, 2024

Choose a reason for hiding this comment

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

no please not. $self.IsActiveEntity IS A REFERENCE, a reference can't be referenced.... Why is there always the urge to improve something that is already exactly what it should be and by that turning it into something semantically and vocally wrong (even the spelling referred and to by is grammatically just wrong).

entities (root and sub nodes but not for named types or entity parameters).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
entities (root and sub nodes but not for named types or entity parameters).
entities (but not for named types or entity parameters).

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, no in a draft context the state elements are available in both the root and the sub nodes, that's important to know.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mentioned that in the previous line.

Copy link
Contributor

Choose a reason for hiding this comment

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

so what's the difference? In fact the content in parentheses are more like an additional information... Just leave it as it is, it's good enough

* 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.
Expand Down