Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Superclass created when creating subclass
Superclass created when creating subclass [message #1712293] Thu, 22 October 2015 16:50 Go to next message
Erlend Rommetveit is currently offline Erlend RommetveitFriend
Messages: 10
Registered: July 2015
Junior Member
Hello.

I have a meta-model which has two superclasses and some subclasses of these two.
The superclasses are: Transition and Place
A subclass called Substitution transition inherits from transition
Two subclasses Port and Socket inherits from Place.
I've attached a picture of the whole meta-model.

index.php/fa/23670/0/

Onto the problem: I have a creation tool for each of the classes. I can create Places and Transitions just fine, but when I try to create a Port or a Substitution transition, they are created along with an instance of it's superclass. So when I try to create a Port, I also get a Place. And when i connect an edge to one of them, there are two edges created to each of them. I also cannot delete one without the other.

I have a feeling this comes down to the semantic candidates expression but I have no idea what to put there.

The creation tools for both Port and Place use the same reference name. But since one is a subclass of the other I thought that was how it was supposed to be done.

This is the result when I try to create a Port (the circle with the double outline). The normal circle is the Place I don't want. It also gets the same name I give the Port

index.php/fa/23671/0/

Re: Superclass created when creating subclass [message #1712514 is a reply to message #1712293] Mon, 26 October 2015 09:09 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 267
Registered: July 2009
Senior Member
Le 22/10/2015 18:50, Erlend Rommetveit a écrit :
> Hello.
>

Hi,

> I have a meta-model which has two superclasses and some subclasses of these two.
> The superclasses are: Transition and Place
> A subclass called Substitution transition inherits from transition
> Two subclasses Port and Socket inherits from Place.
> I've attached a picture of the whole meta-model.
>
>
>
> Onto the problem: I have a creation tool for each of the classes. I can create Places and Transitions just fine, but when I try to create a Port or a Substitution transition, they are created along with an instance of it's superclass. So when I try to create a Port, I also get a Place. And when i connect an edge to one of them, there are two edges created to each of them. I also cannot delete one without the other.
>
> I have a feeling this comes down to the semantic candidates expression but I have no idea what to put there.
>
> The creation tools for both Port and Place use the same reference name. But since one is a subclass of the other I thought that was how it was supposed to be done.
>
> This is the result when I try to create a Port (the circle with the double outline). The normal circle is the Place I don't want. It also gets the same name I give the Port
>

This problem is only a "graphical problem" or is your semantic model
also wrong? When you create a Port, 2 semantic elements are created, a
Port and a Place in the semantic model?

Regards,

--
Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Superclass created when creating subclass [message #1712524 is a reply to message #1712514] Mon, 26 October 2015 09:56 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 267
Registered: July 2009
Senior Member
Hi Erlend,

Here is an example of project with your problem (if it is a graphical
problem as I think).

The representation "diagramWithSuperTypesKO" has your described problem:
attribute1 is represented in blue, ie EAttribute, AND in light blue, ie
EStructuralFeature that is the superTypes of EAttribute.

I create a second representation "diagramWithSuperTypesOK" that has not
this problem. The difference is on the semantic candidate expression has
you suspect.

Regards,

Laurent

Le 26/10/2015 10:09, Laurent Redor a écrit :
> Le 22/10/2015 18:50, Erlend Rommetveit a écrit :
>> Hello.
>>
>
> Hi,
>
>> I have a meta-model which has two superclasses and some subclasses of
>> these two.
>> The superclasses are: Transition and Place
>> A subclass called Substitution transition inherits from transition
>> Two subclasses Port and Socket inherits from Place.
>> I've attached a picture of the whole meta-model.
>>
>>
>>
>> Onto the problem: I have a creation tool for each of the classes. I
>> can create Places and Transitions just fine, but when I try to create
>> a Port or a Substitution transition, they are created along with an
>> instance of it's superclass. So when I try to create a Port, I also
>> get a Place. And when i connect an edge to one of them, there are two
>> edges created to each of them. I also cannot delete one without the
>> other.
>>
>> I have a feeling this comes down to the semantic candidates expression
>> but I have no idea what to put there.
>>
>> The creation tools for both Port and Place use the same reference
>> name. But since one is a subclass of the other I thought that was how
>> it was supposed to be done.
>>
>> This is the result when I try to create a Port (the circle with the
>> double outline). The normal circle is the Place I don't want. It also
>> gets the same name I give the Port
>>
>
> This problem is only a "graphical problem" or is your semantic model
> also wrong? When you create a Port, 2 semantic elements are created, a
> Port and a Place in the semantic model?
>
> Regards,
>


--
Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Superclass created when creating subclass [message #1712707 is a reply to message #1712524] Tue, 27 October 2015 14:52 Go to previous message
Erlend Rommetveit is currently offline Erlend RommetveitFriend
Messages: 10
Registered: July 2015
Junior Member
Hi.

It is as you say only a graphical problem. There is only one "Substitution Transition" instance in the business model.

I have tried several variations of what you had put in your semantic candidates expression. The most recent one I tried was
"aql:self.containsTransitions->select(i | i.oclIsTypeOf(SubstitutionTransition))".

What happens is that the element with the custom style I wanted (the double outline) disappears and the normal styled one remains.

The other variants I tried simply had no effect. I'm at a loss for what I'm supposed to put in there now.

EDIT: Disregard this post. I found the right expressions. I forgot to handle the expression on Place as well. Thank you for the help

[Updated on: Tue, 27 October 2015 17:37]

Report message to a moderator

Previous Topic:How to move endpoint of edges when Ends Centering configured as Both
Next Topic:Label Expression :: "Unknown EMF Problem"
Goto Forum:
  


Current Time: Wed Jan 27 08:21:16 GMT 2021

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

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

Back to the top