Community
Participate
Working Groups
Horacio and Dimitris have identified a need for deleting a model element and all of its children as part of a model migration strategy. Whilst this can be achieved via a post block, it would be helpful to have first-class support for this in the language.
My proposed syntax for this feature is: @cascade delete Type I've pushed an initial implementation in SVN r2411. The test cases are in SVN and also here: https://gist.github.com/louismrose/6792033 Before I mark this as fixed and add user documentation, do you have any thoughts? I'll ping Horacio too.
@cascade looks good. +1 from me!
Looks good to me as well :-).
Thanks chaps. I'm going to mark this as fixed for now, but might reopen after speaking with Horacio about his use case.
I have finally managed to test this and in my use case it seems to be working ok. I will continue to use is and see how it goes. I will report any issues here. Any idea on when this will go into release?
Great -- thanks Horacio. Do keep us posted. This will make it into the next release, though we're not quite sure when that will be yet.
Fixed in the latest interim version.
Hi, I have found a case where the cascade behavior seems to be not working. I haven't been able to pinpoint the cause. So far the only difference I find with the cases were it is working is the multiplicity of the containment associations. I'll do more testing to see if I can figure out the cause. Sorry that I can't provide a test case, but the current state of the project makes it very hard to setup in someone else's environment. Regards,
Are there any updates on this?
Hi, haven't had much time to go over this. However, it seems to be related to delete and migrate rules for the same type not being exclusive. But I don't know how Flock decides between delete and merge in such cases.
Louis, Can you comment on how this works for types with super types. It seems the issues I am having are related with the cascade operation not deleteting attributes inherited from super classes but only the ones defined in the type. Regards,
Created attachment 245809 [details] Test Case Finally managed to put an example togethere. The metamodel is a striped down version of the QVTc metamodel I actually use. I have to simple rules, one to delete nested (local) Mappings and one to delete unnamed domains. If you run the migration you will see that the nameless domian in Mapping CToD is correctly deleted in cascade (its guard and bottom patterns are deleted too). However, altough the nested mapping in AToB is deleted, its guard and bottom patterns are not and end up at the root level. I am convinced is something related to inheritance, but not sure what exactly. Maybe multiple inheritance? Hope the example helps.