I'm currently trying to implement a unique constraint dependent on a particular root node concept. Let's say I have a root node concept R, I want to ensure that this concept has only one instance per model. Hence, I implemented two checks/restrictions:
- I used a Non-Typesystem Rule for reporting an error in case of multiple instances of R. B
- I created a concept constraint for "can be root" as follows:
model.roots(R).size == 0
To my current understanding, the concept constraint is for restraining the auto-completion menu when creating a new node. To my surprise, the second check is also performed after node creation. Since it seems to be not possible to access the node, that is "currently in creation" I haven't found any way to condition my second rule.
Does anybody have an idea? Do I miss anything?
Thank you very much in advance,