Arches in petri net [message #1795916] |
Tue, 02 October 2018 06:24  |
Eclipse User |
|
|
|
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 #1795982 is a reply to message #1795970] |
Wed, 03 October 2018 09:48   |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Arches in petri net [message #1796126 is a reply to message #1796121] |
Fri, 05 October 2018 10:11   |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.49557 seconds