Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[henshin-dev] UML: deleting an ownedAttribute from a Class

Hi,

 

I wrote a simple transformation for deleting an ownedAttribute from a UML class. While trying to get the transformation to run, I encountered an (in my opinion) unexpected behavior of the Henshin engine. I am attaching the transformation model and a test source model here.

 

In short, the Henshin diagram contains a Class Node, a Property Node, and an ownedAttribute Edge connecting them. When the Action of the ownedAttribute Edge is set to <<delete>> and the Actions of the Class Node and the Property Node are set to <<preserve>>, the Property is removed from the source model. This is indeed the behavior I would like to achieve, but the fact that it occurs is somewhat surprising to me. Here’s why: the Property Node is deleted although it appears in both the LHS Graph and the RHS Graph, and there is a Mapping between the corresponding Nodes in the two graphs. In my understanding of the Henshin semantics, this should not happen.

 

To make things even more confusing, setting the Action of the Property Node to <<delete>> causes a runtime error. I suspect this is caused by a dangling edge, since setting the checkDangling flag to false avoids the error. But then why doesn’t this error occur in the scenario described above, when the Property Node is also removed?

 

Could anyone explain why the scenario I describe in the second paragraph deletes the Property, and why it doesn’t cause a dangling edge error?

 

Also, how can I mitigate against the dangling edge error? Without any hints on what edge is left dangling, I could only guess by looking at the UML metamodel, but so far my guessing has been unsuccessful.

 

Cheers,

Vlad

 

Vlad Acretoaie

PhD student

DTU Compute

 

Technical University of Denmark

Department of Applied Mathematics and Computer Science

Matematiktorvet

Building 303B, Room 055

DK - 2800 Kgs. Lyngby

Denmark

Direct +45 45253645

rvac@xxxxxx

www.compute.dtu.dk/~rvac

 

 

 

Attachment: remove_attribute.henshin
Description: remove_attribute.henshin

Attachment: source.uml
Description: source.uml


Back to the top