Skip to main content



      Home
Home » Modeling » Epsilon » [Flock] Delete and element and all of its children(Is it possible to delete all containment references at once?)
[Flock] Delete and element and all of its children [message #1101371] Wed, 04 September 2013 07:22 Go to next message
Eclipse UserFriend
Hi,

I have a delete rule that deletes an Type. However, the result after execution is that all elements that where contained by elements of the deleted Type are left on the model (since they are now parent-less they reside at the root).

Is there any way to make a delete rule to delete all of the elements of containment relations too? Or at least a way of specifying a when statement in the lines of

when : owner.deleted() 


Regards,
Re: [Flock] Delete and element and all of its children [message #1101417 is a reply to message #1101371] Wed, 04 September 2013 08:39 Go to previous messageGo to next message
Eclipse UserFriend
Hi Horacio,

Would the following do the trick?

when : owner.equivalent().isUndefined()


If you need to compute the owner of a model element, x, and you're using EMF, you can use: x.eContainer

Cheers,
Louis.
Re: [Flock] Delete and element and all of its children [message #1101434 is a reply to message #1101417] Wed, 04 September 2013 09:02 Go to previous messageGo to next message
Eclipse UserFriend
Hi Louis,

eContainer.equivalent() generates a null pointer exception, even with the isUndefined() method.

Cheers,
Re: [Flock] Delete and element and all of its children [message #1102103 is a reply to message #1101434] Thu, 05 September 2013 07:14 Go to previous messageGo to next message
Eclipse UserFriend
Hi Horacio,

Oh dear -- that doesn't sound good. Could you create a minimal example [1] and I'll take a look at the cause...

Cheers,
Louis.

[1] http://eclipse.org/epsilon/doc/articles/minimal-examples/
Re: [Flock] Delete and element and all of its children [message #1105826 is a reply to message #1102103] Tue, 10 September 2013 06:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Horacio,

I've now had a chance to look at this again, and I realise that calling .equivalent() in the guard of a delete (or a retype) statement will never work! This is because it is the delete and retype statements that Flock uses to build up its equivalence table.

Instead, you can use the following:

when : owner.isKindOf(OwnerType)


Or, if the delete rule for OwnerType contains a guard:

delete OwnerType when : self.X

delete ChildType when : owner.isKindOf(OwnerType) and owner.X


Hope that helps!

Cheers,
Louis.

[Updated on: Tue, 10 September 2013 06:21] by Moderator

Re: [Flock] Delete and element and all of its children [message #1131293 is a reply to message #1105826] Thu, 10 October 2013 07:44 Go to previous message
Eclipse UserFriend
Hi,

It seems Louis managed to work on this and has created a bug entry for it. If you are interested in this functionality please subscribe and helps us test this fix:

Epsilon bug 418494

Regards,
Previous Topic:Eugenia Compartment Layout
Next Topic:Iterator in an attribute
Goto Forum:
  


Current Time: Wed Jul 23 17:06:14 EDT 2025

Powered by FUDForum. Page generated in 0.05874 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top