|
Re: Accessing referring elements? [message #1853316 is a reply to message #1853187] |
Mon, 27 June 2022 17:29 |
|
You can only do this directly if the reference relationship in question is a containment relation: in that case, you can use refImmediateComposite() to navigate back to the containing element.
If your reference is not a containment reference, you can still use the object indexing pattern, for example:
--- Store all inverse values for MM!B::reference
helper def : bByReference : Map(MM!C, MM!B) =
MM!B.allInstances()->mappedBySingle(b | b.reference);
--- Define a helper attribute on MM!C for the inverse of MM!B::reference
helper context MM!C def : inverseReference : MM!B =
thisModule.bByReference.get(self);
Cheers,
Dennis
|
|
|
|
Powered by
FUDForum. Page generated in 0.01461 seconds