Previously it would return ComponentLocation.isInsideStructure = false
for Variables representing the insides of a procedural UC instance.
gitlab #532
Change-Id: I26ae30c8e4217e7c4cde03b884604ee59aa7e85b
Variable firstRepresentedParent = findFirstParentWithRepresentation(graph, parameter, STR);
if (firstRepresentedParent == null)
return null;
Variable firstRepresentedParent = findFirstParentWithRepresentation(graph, parameter, STR);
if (firstRepresentedParent == null)
return null;
- Resource realParentComposite = graph.getPossibleObject(firstRepresentedParent.getRepresents(graph), L0.PartOf);
- if (realParentComposite == null)
- return null;
- isInsideStructure = graph.hasStatement(realParentComposite, STR.Defines);
+ Resource representedParent = firstRepresentedParent.getRepresents(graph);
+ Resource representedParentType = graph.getPossibleType(representedParent, STR.Component);
+ if (representedParentType != null && graph.isInstanceOf(representedParentType, STR.ProceduralComponentType)) {
+ isInsideStructure = !parameter.equals(firstRepresentedParent);
+ } else {
+ Resource realParentComposite = graph.getPossibleObject(representedParent, L0.PartOf);
+ if (realParentComposite == null)
+ return null;
+ isInsideStructure = graph.hasStatement(realParentComposite, STR.Defines);
+ }
Variable firstParentComposite = findFirstParentComposite(graph, firstRepresentedParent, STR);
if (firstParentComposite != null) {
Variable firstParentComposite = findFirstParentComposite(graph, firstRepresentedParent, STR);
if (firstParentComposite != null) {