Implement virtual opposite references
With commit afe7ea, some opposite references had to be removed due to
limitations of EMF. This commit reintroduces these references as virtual
opposites. The content of a virtual references V for an object O is not
stored in a field, but on access derived from that non-transient
reference R to which V shall be the opposite. A special cross reference
adapter, Bpmn2OppositeReferenceAdapter, keeps track of instances of the
non-transient reference R (in fact, it does so for several references at
once). When R is accessed for O, the adapter is asked to return all
elements E that are associated with O through the reference V.
The cross reference adapter is attached to a resource, respectively to
the resource set containing the resource. Only elements E loaded into
the same resource set as O can be returned.
The virtual references are marked as read-only in the edit plugin. Two
tests for the behavior are included (as they are not dependent on
serialization, they could later be moved to a new test class).
20 files changed