Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Arches in petri net
Arches in petri net [message #1795916] Tue, 02 October 2018 10:24 Go to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
Hi!
I'm modeling a petri net in eclipse using the sirius tool.
I'm having trouble figuring out how to relate posts and transitions using arches and give weight to them. could someone help me please? thank you!
Re: Arches in petri net [message #1795920 is a reply to message #1795916] Tue, 02 October 2018 12:40 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hello,

Can you describe your trouble? From what I remember of Petri net, you have places and transitions linked by arcs. The label on an arc is the weight.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1795921 is a reply to message #1795920] Tue, 02 October 2018 12:46 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
Hi Steve!
I have previously created a metamodel of the petri net and now I have created my diagram and the design, the problem is created an instance that allows me to freely create an arc from the diagram in a graphic way, being able to also give weight to it. previously I have already created instances regarding places and transitions by first creating nodes and then using the create section.
I hope I was clear in my problem.

Regards,
Annachiara
Re: Arches in petri net [message #1795924 is a reply to message #1795921] Tue, 02 October 2018 13:30 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hello,

If I understood correctly what you need now is to add an "Edge mapping"[1] to represent your arcs on a diagram. There is two different kinds of "Edge mapping" and your choice depends on how you specified the reference between an arc and a transition in your metamodel. If you only have an EReference "arcs" between the metaclass of "Place" and "Transition", you will want to create a "Relation-Based Edge Mapping". If you have a metaclass "Arc" inbetween the metaclasses "Place" and "Transition" then you will need an "Element-Based Edge Mapping".
Now that you can represent the arcs of your models on the diagram, you want a tool to create new arcs on the diagram. For this, you will need an "Edge Creation Tool" [2]. In this tool you will define the operation to be processed by the tool. The first operation will be to add the arc. If you defined a "Relation-Based Edge Mapping", you will need a "Set" operation to set the EReference. If you defined an "Element-Based Edge Mapping", you will need a "Create instance" to create the "Arc" and then "Set" operations to reference the "Place" and "Transition". Finally, you will need an "Open Dialog"[3] operation in order to open a pop-up dialog window to fill in the weight of the arc.

Did I understood correctly your question?

Regards,
Steve

[1] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#edges
[2] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#edge_tools
[3] https://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html#dialog


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1795963 is a reply to message #1795924] Wed, 03 October 2018 08:33 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
Hi,

yes, you understood the problem perfectly! but now I do not understand how to go to define the edges to link the relationships, do you know some tutorials that could help me?
Thank you very much for helping!

Annachiara
Re: Arches in petri net [message #1795965 is a reply to message #1795963] Wed, 03 October 2018 08:43 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hello,

You can look at: https://wiki.eclipse.org/Sirius/Tutorials/BasicFamily
There is a part concerning Edge Mappings: https://wiki.eclipse.org/Sirius/Tutorials/StarterTutorial#Add_a_Relation_Based_Edge

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1795970 is a reply to message #1795965] Wed, 03 October 2018 12:08 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
Hi,

thank you very much for your availability, I was really very helpful. eclipse but still gives me a problem, when from the "palette" I select the creation of a new edge, and select the interested nodes of origin and end, the arc is not created and I can not identify the problem, even if I followed the guide every moment. how can I do?

Regards,
Annachiara
Re: Arches in petri net [message #1795982 is a reply to message #1795970] Wed, 03 October 2018 13:48 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hi,

First thing to check, if you add an arc in your semantic model (not from the diagram but with the default Ecore tree editor), can you see the arc on the diagram? If you can't see it, you have an issue on your Edge Mapping (probably a wrong Semantic Candidate Expression). If it is the case, please describe your metamodel concerning arcs and the semantic candidate expression of your mapping.

If you can see existing arcs on your diagram, but the Edge Creation Tool from the Palette has no effect, then you have an issue in your Edge Creation Tool that is probably located in one of the Model Operation of your tool. In this case, can you describe your model operations?

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1795986 is a reply to message #1795982] Wed, 03 October 2018 14:28 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
Hi,

this is my metamodel. do not consider the relationship between place and transition because it was added by mistake and now I do not know how to delete it, even if I do not think the problem is this.

Reguards,
Annachiara
  • Attachment: petrinet.jpg
    (Size: 1.88MB, Downloaded 34 times)

[Updated on: Wed, 03 October 2018 14:32]

Report message to a moderator

Re: Arches in petri net [message #1795987 is a reply to message #1795986] Wed, 03 October 2018 14:47 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Ok, I see that you have a metaclass for "Arc" but is it your Edge Mapping or your Edge Creation Tool that is the issue?

Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1795988 is a reply to message #1795987] Wed, 03 October 2018 14:49 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
I think it's the edge creation tool because in going to connect place and transition gives me the opportunity to do it but I do not create an arrow.
Re: Arches in petri net [message #1795990 is a reply to message #1795988] Wed, 03 October 2018 15:03 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Just to be sure, if you add an arc in your semantic model (not from the diagram but with the default Ecore tree editor), can you see the arc on the diagram?

Do you have created an Element-Based Edge Mapping[1] with the following configuration:
- Semantic Candidate Expression -> aql:arc
- Source Finder Expression -> aql:from
- Source Mapping -> NodeMapping concerning your "Nodo" Metaclass
- Target Finder Expression -> aql:to
- Target Mapping -> NodeMapping concerning your "Nodo" Metaclass

The Edge mapping contains a Style?

[1] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#edges


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1795992 is a reply to message #1795990] Wed, 03 October 2018 15:16 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
now I have modified the configurations putting them equal to yours, as I had put them differently, but the problem has not been solved.
Yes, the edge mapping contains a Style.
Re: Arches in petri net [message #1795993 is a reply to message #1795992] Wed, 03 October 2018 15:20 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Ok, can you describe the model operations of your Edge Creation Tool?

Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1795994 is a reply to message #1795993] Wed, 03 October 2018 15:26 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
in practice I created an instance in the "palette" that allows me to create relationships between places and transition, but when I select the instance and click on places or transition to start and then select the node to arrive the arrow is not created.
Re: Arches in petri net [message #1796020 is a reply to message #1795994] Thu, 04 October 2018 08:11 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hello,

I understand that your tool/instance in the palette does not create your arrow/arc, but what are the operations processed by this tool. If it does not work, some operations[1] must be missing or wrong. You have an Edge Creation Tool in your odesign, right? Or did you contributed a tool in the palette with some custom code somehow?

Regards,
Steve

[1] https://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1796082 is a reply to message #1796020] Thu, 04 October 2018 18:40 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
Hi,

I followed exactly what were the instructions of the guide that you kindly gave me, thus creating an instance to create bows in my "palette" then creating first a relationship based on the element and then in the "create" section I created a "edge creation" going to specify all the characteristics given by the link where there were.

Regards,
Annachiara
Re: Arches in petri net [message #1796119 is a reply to message #1796082] Fri, 05 October 2018 13:11 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hello,

Ok, you have an "Edge Creation Tool" in the section of your RepresentationDescription. The Edge Creation Tool by itself, only adds a tool available in the palette. In this tool, there is a field to link it with your Edge mappings. This way the tool "knows" witch element are candidates to me linked (here Nodos element). From what I understood, you have these steps done. Finally, in the Edge Creation Tool you need to define model operations in order to create the "Arc" element in the semantic model and reference both selected nodes. How did you define these model operations?

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1796121 is a reply to message #1796119] Fri, 05 October 2018 13:24 Go to previous messageGo to next message
annachiara marano is currently offline annachiara maranoFriend
Messages: 15
Registered: October 2018
Junior Member
Hi,

in the edge creation tool I set the "element-based edge" to which I refer. after the begin I added a "change context" and I put "var: source". finally I added a "set" putting the name of the node from which I leave and as "value expression" I put "var: target".

Regards,
Annachiara
Re: Arches in petri net [message #1796126 is a reply to message #1796121] Fri, 05 October 2018 14:11 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Unfortunately, this is not how it works, you are trying to set on your source node a feature nammed as your target node, with your target node.

If we go back to your metamodel, you can see that there is no reference from node to node, you need to go through an Arc element. Therefore our first goal is to create an Arc element. In your metamodel, an Arc is contained by the root element "PetriNet". This means that your first operation is to change context to this root element (the container of source node for instance).
Next step, under this ChangeContext operation, we want to create an Arc. For this, you need to add a "Create Instance" model operation. The Reference Name is your containment feature "arc" (from PetriNet to Arc), the TypeName is Arc and you can leave the variable name as "instance".
Now, the Arc is created but without source or target. Therefore, under the "CreateInstance", you need 2 "Set" Operation. One for the feature "from" referencing the source with "var:source". The other one for the feature "to" referencing the target with "var:target".
The Arc is now connected. With this you can fill the weight of the arc directly in the property view. You can also add a New Dialog model operation to your tool if you want to open a popup at the end of the arc creation.

Note that I think that on your metamodel you have some multiplicity issues for the feature of an arc. I think that the attribute weight and references to and from are 1-1.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Arches in petri net [message #1808409 is a reply to message #1796126] Mon, 24 June 2019 08:13 Go to previous message
Arcangelo Palma is currently offline Arcangelo PalmaFriend
Messages: 1
Registered: June 2019
Junior Member
Hi everyone, thank you for support cause i've had the same problem with Sirius and I've resolved with this topic by last Steve Monnier's answer
and using source.eCointainer() , explained in this topic:
https://www.eclipse.org/forums/index.php/t/1079236/
Regards
Arcangelo
Previous Topic:A couple of questions on "edge" handling
Next Topic:[ANN] Sirius 6.2.1
Goto Forum:
  


Current Time: Mon Aug 19 16:13:48 GMT 2019

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

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

Back to the top