Community
Participate
Working Groups
An Event (ExecutionEvent SendOperationEvent...) is created during the creation of an OccurenceSpecification. If the OccurenceSpecification is deleted, its referenced Event becomes meaningless and should be deleted as well. It is not currently the case because these elements are indirectly referenced but not contained by their OccurenceSpecification.
Now supported in the sequence diagram. the algo is : when deleting an occurence specification, delete its associated event if this event is not referenced elsewhere in the model.
Thanks Thibault. In fact the implementation is not exactly what is expected, such action should be provided to the Element Edit Service as it is an action on the model itself. In other words it should provide the same behavior when the delete command is executed from the model explorer, the sequence diagram or any other diagram that would give access to "Delete from model" command on such element. Also the result should not necessarily required diagrams where involved elements appears to be opened (in other words it should provide correct result even if edit part is not activated). I planned to do this, in case you prefer doing it yourself, no problem but I'd prefer that you provide the patch for validation from me before commit. The reason is that contributing to the edit service is not fully trivial (I tried to provide some description in bug324966) and may result in undesired effect on other diagrams. Currently I was waiting for some info from GMF Runtime team (bug328232) to decide how we should deal with it. If you are ok with this, I can provide the implementation (your algo is fine) for the Element Edit Service, and you will be able to test it via the "Delete from model" in model explorer before deciding to use the EEService for this in the Sequence diagram. Note that other element deletion that are supposed to delete not contained (directly or indirectly) elements will have to be supported in the EEService as well. You can add tasks under bug324966 for these.
sorry it was me for the previous comment, we had some account problems with mylyn when sharing eclipse platform between devs. anyway, please find attached an attempt to implement this. I didn't add it to the plugin.xml because I don't really know where to put it : if I put it on the OS metatype does this also will apply for subtypes like MOS ? There is a lot of "elements not contained" to delete in the sequence diagram like associated time constraint, duration etc.
Created attachment 181479 [details] os delete
Created attachment 181480 [details] mylyn/context/zip
Thanks Mathieu, I applied your patch with minor changes (in r3007). By the way, I'm not quite sure where the best place to put dependent element deletion is. If you put it in the EditHelper, then you need to add it to each relevant ElementType (e.g. MOS, not OS), could not find out yet if this is normal. I found it better to add this command in an EditHelperAdvice, doing this, we can take advantage of the meta-model by adding the advice directly on OS. The EditHelperAdvice will be used by any element inheriting from OS.
Fixed in r3007.
In r3008 : Basic refactoring.