eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[OCL Xtext Editor Console In Papyrus] Editor does not react to deletion of elements in model #1386

Open eclipse-ocl-bot opened 4 hours ago

eclipse-ocl-bot commented 4 hours ago

| --- | --- | | Bugzilla Link | 447693 | | Status | NEW | | Importance | P3 enhancement | | Reported | Oct 17, 2014 07:48 EDT | | Modified | Oct 17, 2014 10:44 EDT | | Version | 5.0.0 | | Reporter | Ronan Bar |

Description

Assume I have a UML model open in papyrus. I run the OCL Xtext interpreter and I get a result of true for the following constraint, where the Context Element is Class 1:

if (self.getNearestPackage()->collect(e|e.allOwnedElements())->select(e|e.oclIsTypeOf(Association))->select(e|e.oclAsType(Association).memberEnd.type.oclAsType(Class)->includes(self))->size() > 0) then\ self.getNearestPackage()->collect(e|e.allOwnedElements())->select(e|e.oclIsTypeOf(Class))->select(e|e.oclAsType(Class).isAbstract=false)->collect(e|e.oclAsType(Class).allParents())->includes(self)\ else\ true\ endif

Now I delete the inheritance between Class2 and Class1. I re-run the OCL evaluation and get true again. This is incorrect.

I must reselect the Context element Class 1, in either the diagram or diagram, after deleting the inheritance relationship. If I do the query correctly now evaluates to false.

It seems that a deletion of an element does not cause the evaluator to realise the model has been updated. Even after saving the model the evaluation is based on the original model. I must reselect the context.

Note: Adding an element that changes the result of the query does not show this behaviour.

eclipse-ocl-bot commented 4 hours ago

By Ronan Bar on Oct 17, 2014 07:49

Created attachment 247971 Sample Model/Profile

:compression: 447693.zip

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on Oct 17, 2014 10:44

There was a general view that changing the metamodel of a loaded model was illegal. When you did this in Ecore all EClass references were changed to proxies that never re-resolved; tools had to be restarted to reload, and that is the current Eclipse OCL philosophy.

However despite WONTFIXing a bug report for the above behaviour, EMF has now improved so OCL could improve too.

Changed to an enhancement request. Hopefully the autogeneration of incremental model conversions will allow resynchronization with very low overhead.

For now you need to close and reopen the OCL Console.