Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Question on matching a UML model

Hi Christian,

 

Thank you for the suggestion.

 

I also tried specifying only one :Type node, but this does work as expected. In the UML model there are two separate instances of Type (you can verify this, for instance, by looking in the text version of the .uml file). So the graph with only one :Type node will always fail to match.

 

The only workable solution that I was able to adopt was to pre-process the .uml file to add explicit type names.

 

I think I will take this question to the MDT maintainers, since it looks like it is not specifically a Papyrus issue. Types are also handled this way when editing UML models in the UML tree editor.

 

Cheers,

Vlad

 

From: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] On Behalf Of Christian Krause
Sent: Saturday, December 20, 2014 7:18 PM
To: Henshin developers mailing list
Subject: Re: [henshin-dev] Question on matching a UML model

 

Hi Vlad,

 

you should specify only one :Type node in your rule. Both :Property nodes should point to this :Type node. This make sure that it is really the same type, independently from its name.

 

Cheers,

Christian

 

2014-12-17 10:59 GMT+01:00 Vlad Acretoaie <rvac@xxxxxx>:

Hi,

 

I routinely use Henshin to transform UML models, and I sometimes come across tricky situations such as the one I describe below. It is not really a Henshin issue – it is more likely caused by how UML is implemented in Ecore. Still, I am running out of ideas, so I thought I could ask here.

 

I have a source model containing two Classes, each having one attribute. The attributes have different types. I would like to write a Henshin transformation that matches two Classes only if they have an attribute of the same time. So, my Henshin transformation should not match my source model. However, it does.

 

The problem lies with the Type nodes in the Henshin transformation. It is, as far as I can tell, impossible to state which UML PrimitiveType they represent. Their name meta-attribute is blank (even though according to the UML standard it should not be), and by looking at the UML file in text mode I can see that the “type” tags only contain a “href” attribute as identification. However, no href Attribute is available in the Henshin transformation.

 

In this case, how could I write the Henshin transformation such that it fails to match my source model?

 

The source model and the Henshin transformation are attached.

 

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

 

 

 


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev

 


Back to the top