|
|
|
Re: Arches in petri net [message #1795924 is a reply to message #1795921] |
Tue, 02 October 2018 13:30 |
|
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 Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
|
Re: Arches in petri net [message #1795982 is a reply to message #1795970] |
Wed, 03 October 2018 13:48 |
|
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 Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
|
Re: Arches in petri net [message #1795990 is a reply to message #1795988] |
Wed, 03 October 2018 15:03 |
|
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 Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
|
|
|
Re: Arches in petri net [message #1796119 is a reply to message #1796082] |
Fri, 05 October 2018 13:11 |
|
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 Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Arches in petri net [message #1796126 is a reply to message #1796121] |
Fri, 05 October 2018 14:11 |
|
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 Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.07566 seconds