|
Re: [Edge] Problem with Edge creation [message #1401158 is a reply to message #1400434] |
Tue, 15 July 2014 07:56 |
|
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 #1403289 is a reply to message #1403095] |
Mon, 21 July 2014 12:45 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03379 seconds