Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [Edge] Problem with Edge creation([Edge] Edge between child node and top level node not getting created)
[Edge] Problem with Edge creation [message #1400434] Mon, 14 July 2014 07:39 Go to next message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 171
Registered: July 2009
Location: Canada
Senior Member
Hi,

For a simple DSL [0], I was able to quickly create a working editor [1]. The edges between the top level models (Entities) get created, however the ones (represented by attribute "type" in the dsl) between the attributes (child node) and the entity (top level node) don't show up in the editor. Do I need to crate a separate model (say. DataTypeRef) and an edge (perhaps an Domain-Based Edge) in the odesign file to make it work ? Or am I missing something in the .odesign file [2] ?

[0] https://github.com/nbhusare/Sirius-test-project/blob/master/org.xtext.example.entity/src/org/xtext/example/entity/EntityDSL.xtext

[1] https://github.com/nbhusare/Sirius-test-project/blob/master/entity.modeling/020.png

[2] https://github.com/nbhusare/Sirius-test-project/blob/master/entity.design/description/entity.odesign

[3] https://github.com/nbhusare/Sirius-test-project.git

Thanks in advance.


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
Re: [Edge] Problem with Edge creation [message #1401158 is a reply to message #1400434] Tue, 15 July 2014 07:56 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 503
Registered: July 2009
Location: Nantes, France
Senior Member
Le 14/07/2014 09:39, Neeraj Bhusare a écrit :
> Hi,

Hi,
>
> For a simple DSL [0], I was able to quickly create a working editor [1].
> The edges between the top level models (Entities) get created, however
> the ones (represented by attribute "type" in the dsl) between the
> attributes (child node) and the entity (top level node) don't show up in
> the editor. Do I need to crate a separate model (say. DataTypeRef) and
> an edge (perhaps an Domain-Based Edge) in the odesign file to make it
> work ?
You do not need to create a specific concept/class in your DSL.
Relation based Edge i sthe well choice in your case because your want to
represent a relation between two elements (represented by the "type"
feature). The Domain based Edge could be used if you had the DataTypeRef
(like Association in UML) in your DSL. But see my next comment.

Or am I missing something in the .odesign file [2] ?

Yes you are missing something: you choose the "list" children
presentation for your container and Sirius is not currently able to draw
edges from/to list elements (edges from/to the parent List container is
a supported structure).

You could use some bordered node (right click your sub node mapping,
refactor > Move to Contained/Bordered Node) or create a new Bordered
node on your container mapping. Then if you link your edge mapping to
this border mapping, your edges will be computed and displayed.



>
> [0]
> https://github.com/nbhusare/Sirius-test-project/blob/master/org.xtext.example.entity/src/org/xtext/example/entity/EntityDSL.xtext
>
>
> [1]
> https://github.com/nbhusare/Sirius-test-project/blob/master/entity.modeling/020.png
>
>
> [2]
> https://github.com/nbhusare/Sirius-test-project/blob/master/entity.design/description/entity.odesign
>
>
> [3] https://github.com/nbhusare/Sirius-test-project.git
>
> Thanks in advance.


Regards,

Maxime


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: [Edge] Problem with Edge creation [message #1403095 is a reply to message #1401158] Mon, 21 July 2014 11:13 Go to previous messageGo to next message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 171
Registered: July 2009
Location: Canada
Senior Member
Hi Maxime,

Thanks for the help.

Based on your suggestion, I refactored the child node (Attribute) to a Bordered node. The Edge (type) has the source mapping set to "Bordered Attribute.

However, the edges are not computed/displayed. Do you mind taking a look at the .odesign file - https://github.com/nbhusare/Sirius-test-project/blob/master/entity.design/description/entity.odesign

Secondly, after I made the above change, the attributes are not laid out properly in the generated diagram. Please see - https://github.com/nbhusare/Sirius-test-project/blob/master/entity.modeling/021.png

Sorry for the delayed reply.


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
Re: [Edge] Problem with Edge creation [message #1403289 is a reply to message #1403095] Mon, 21 July 2014 12:45 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 503
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Neeraj,

Le 21/07/2014 13:13, Neeraj Bhusare a écrit :
> Hi Maxime,
>
> Thanks for the help.
>
> Based on your suggestion, I refactored the child node (Attribute) to a
> Bordered node. The Edge (type) has the source mapping set to "Bordered
> Attribute.
> However, the edges are not computed/displayed. Do you mind taking a look
> at the .odesign file -
> https://github.com/nbhusare/Sirius-test-project/blob/master/entity.design/description/entity.odesign

First remark: all the fields whose name is diplayed in a bold font and
ended by a '*' are required. So you must put an id for all the mapping
and tools you defined in your odesign.

Then I looked into your odesign, and I think that your edge problem will
be solved by the add of an id, because now your two edge mappings have
the same empty id (if your try to validate your odesign, several errors
should tell you this).

>
>
> Secondly, after I made the above change, the attributes are not laid out
> properly in the generated diagram. Please see -
> https://github.com/nbhusare/Sirius-test-project/blob/master/entity.modeling/021.png

The attributes are now created as bordered nodes and displayed on the
border of the Class lists. Sirius places them to avoid overlap, and
starts from the upper left corner. You might try to write and execute a
command to change their layout (the layout constraint of the GMF
Notation Nodes corresponding to each bordered Attribute node) and call
it after/during your creation command.

>
>
> Sorry for the delayed reply.

Regards,

Maxime


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: [Edge] Problem with Edge creation [message #1403368 is a reply to message #1403289] Wed, 23 July 2014 09:49 Go to previous message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 171
Registered: July 2009
Location: Canada
Senior Member
Hi Maxime,

Thanks for the tip, the edge creation works. I'll look into the layout problem, will update soon. Thanks.


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
Previous Topic:launch an eclipse application with an editor
Next Topic:Creating some part of models textually
Goto Forum:
  


Current Time: Mon Apr 19 13:59:35 GMT 2021

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

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

Back to the top