eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot2ecore] Nested collections not supported #1045

Open eclipse-ocl-bot opened 1 month ago

eclipse-ocl-bot commented 1 month ago

| --- | --- | | Bugzilla Link | 401938 | | Status | NEW | | Importance | P3 normal | | Reported | Feb 27, 2013 13:09 EDT | | Modified | May 15, 2015 09:56 EDT | | Blocks | 356243 | | Reporter | Ed Willink |

Description

Atrtempting to define a nested collection operation parameter such as

operation extendPaths(currentC : Component, currentP : OrderedSet(OrderedSet(Component)))

fails with loss of the OrderedSet(OrderedSet(Component)) type when roun-tripped from OCLinECore to Ecore to OCLinEcore.

Need to synthesize nested collection types.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Feb 27, 2013 16:27

Tuples are not supported either; testAggregatesRoundTrip has the relevant sub-test commented out.

For collections, it would be sufficient to provide an auto-generated OCLstdlib.ecore so that Collection types can be specialized using normal Ecore mechanisms.

Tuples, we could either hide everything in EAnnotations, or reify the anonymous types.

[Same problems apply to Pivot2UML as well.]

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Mar 18, 2013 05:50

See also Bug 356243.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Oct 25, 2013 02:46

(In reply to Ed Willink from comment #0)

Need to synthesize nested collection types.

Rubbish. That's what EGenericType does.

class C { property path : Set<Sequence> }

could be expressed in Ecore as:

<eStructuralFeatures xsi:type="ecore:EReference" name="path" ordered="false" upperBound="-1">\
  <eGenericType eClassifier="ecore:EClass ../org.eclipse.ocl.examples.library/model/oclstdlib.ecore#//Sequence">\
    <eTypeArguments eClassifier="#//C"/>\
  </eGenericType>\
</eStructuralFeatures>

Just need to make the standard Sequence etc genuinely visible to Ecore (Sequence was hand-edited into oclstdlib.ecore to support the above example)

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Oct 30, 2013 10:34

Bug 392059 has been marked as a duplicate of this bug.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Dec 12, 2013 06:06

commit ebb1267df0ce42698c1590ee55ca8baaec9f13fa pushed to master for M4, provides support for nested collection types in *.ecore.

However more work is needed for:

The roundtrip test on an OCL collection declaration, fails due to mismatching xmi:ids in the synthesized types. This may just be a testing artefact requiring use of more stable xmi:ids, or may be an indication that some type has gone wrong.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on May 15, 2015 09:56

(In reply to Ed Willink from comment #5)

The roundtrip test on an OCL collection declaration, fails due to mismatching xmi:ids in the synthesized types. This may just be a testing artefact requiring use of more stable xmi:ids

There was a missing use of ASSaver to localize the specialization.

Tuple types still a problem.