howto constrain port in maximum one relation |
Post Reply |
Author | |
edward22243
Major Contributor Joined: 19.Apr.2019 Points: 41 |
Post Options
Thanks(0)
Posted: 11.Oct.2020 at 10:01 |
Hello, i have a graph with a 'skillscontainter' object which has defined a decomposition to the same graph. So when I insert a 'skillscontainer' and open it I can make a productdefinition there as well (kind of like a product-assembly with subassemblies, and subassembly may have other subassemblies etc.).
I defined an 'InPort' object which functions as a kind of feedthrough, so relation from top-level can connect to skillcontainer. These ports will also show up graphically (done with a template in symbol editor of skillscontainer; use subobjects as ports), see pic below with 2 Inports shown. So far intro. Problem: I cannot constrain the amount of relations to the Inport shown on the outer rim of the skillscontainer. It should only be in one relationship, but if I add contraints to the Inport object or the Skillscontainer than this does not seem to hold true for the Inports object used as ports in the decomposition (long story, hope it is not confusing). Short story: look at picture, i have two lines to yellow "2" and I do not want to allow this, only one allowed. How to constrain this? |
|
jpt
MetaCase Joined: 25.Mar.2008 Points: 239 |
Post Options
Thanks(0)
|
This type of constraints can be set with
MERL executed e.g. in a port symbol to highlight ports with multiple relations or shown
in LiveCheck pane at modeling time below the diagram. MERL would be like:
do #() { and () above for port and role could be replaced with your metamodel
concepts. Some extra considerations: 1. You may also have own constraints if a port can be a source for multiple relations but not a target for multiple connections (using different port in ~()) 2. If case the same port (like '2' in the example you provided) is reused as port for some other object then the above script should include also the context, so that when port '2' is connected with 'subassy'it is different case than when the same port '2' is used with 'subassy2' (another object). Also, while not directly related to your
question: if ports (e.g. '1' and '2') would be
of different type, there could be own constraints for them. And in case connections would be based on
different values given by modeler, port constraints could be set with Graph
Tool allow setting constraints per value (like below). |
|
edward22243
Major Contributor Joined: 19.Apr.2019 Points: 41 |
Post Options
Thanks(0)
|
thanks for the response. I will try what you suggest.
|
|
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Post Options
Thanks(1)
|
|
|
Post Reply | |
Tweet |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |