eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot-uml] Stereotypes do not work in Xtext Console #1592

Closed eclipse-ocl-bot closed 2 hours ago

eclipse-ocl-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 474085 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Aug 01, 2015 05:00 EDT | | Modified | Aug 03, 2015 15:11 EDT | | Reporter | Ed Willink |

Description

Created attachment 255575\ Demo project

The attached example from the "How to query UML models with OCL?" newsgroup thread fails reports an unrecognized variable in

self.extension_ensureRole

query in the OCL Xtext Console after selecting a Transition. However

self.oclType().ownedProperties

shows that extension_ensureRole is a known Property.

The offending query works when emulated using a UML Console JUnit test once some problem default bounds are fixed.

:compression: ocltest.zip

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Aug 01, 2015 12:02

(In reply to Ed Willink from comment #0)

The offending query works when emulated using a UML Console JUnit test once some problem default bounds are fixed.

The JUnit test is:

ResourceSet maintained by test + Xtext Console

The failing usage is:

AdapterFactoryEditingDomainResourceSet maintained by UML editor + Xtext Console

In the successful test, the UML Console has the correct selection from the outset and the UML stereotypes are loaded and found.

In the unsuccessful usage, the UML Console uses its EmbeddedXtextEditor's OCL/ResourceSet and so the UML stereotypes are not found.

Solution: The EmbeddedXtextEditor's OCL should track the ResourceSet of the prevailing selection. This could solve the null selection kludge which requires a special useless OCL.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Aug 03, 2015 15:11

(In reply to Ed Willink from comment #1)

Solution: The EmbeddedXtextEditor's OCL should track the ResourceSet of the prevailing selection. This could solve the null selection kludge which requires a special useless OCL.

Yes. A nice simplification. Not possible to maintain 100% API compatibility. An API filter is needed to apologize for introducing an internalSetOCL method, so any user classes that derive from the examples EmbeddedXtextEditor and also introduce an internalSetOCL method could be broken.

commit e7b8b8ca4d78efc999a8afb61b34a50dad51ecf8 pushed to maintenance/R6_0 for SR1

commit b21da5f6734b2392d3a277967d3d9a39609c51ab pushed to master for M1