From e89ad0dd828fd8c628288d416590b1f8ec0194ef Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Wed, 17 Jun 2020 12:22:52 +0300 Subject: [PATCH] Synchronization can now read children for multi-instantiated composites org.simantics.structural2.Functions.structuralChildDomainChildren getVariables implementation still relied on getPossibleType(ReadGraph), which returns null for multi-instances. The previous similar flaw was fixed in #259. gitlab #562 Change-Id: I55421a32310c7a55c089637faeb3186dd43a0e4b --- .../src/org/simantics/structural2/Functions.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bundles/org.simantics.structural2/src/org/simantics/structural2/Functions.java b/bundles/org.simantics.structural2/src/org/simantics/structural2/Functions.java index e43007637..e9bb272d3 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/Functions.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/Functions.java @@ -635,8 +635,8 @@ public class Functions { @Override public Map getVariables(ReadGraph graph, Variable context, Map map) throws DatabaseException { - - Resource type = context.getPossibleType(graph); + StructuralResource2 STR = StructuralResource2.getInstance(graph); + Resource type = context.getPossibleType(graph, STR.Component); if(type == null) return null; StructuralComponentClass clazz = StructuralComponentClass.get(graph, type); @@ -653,7 +653,6 @@ public class Functions { } return map; } else if (StructuralComponentClass.DEFINED.equals(clazz)) { - StructuralResource2 STR = StructuralResource2.getInstance(graph); Resource def = graph.getSingleObject(type, STR.IsDefinedBy); Map children = graph.syncRequest(new UnescapedChildMapOfResource(def), TransientCacheListener.instance()); return StandardChildDomainChildren.getStandardChildDomainChildVariables(graph, context, children, map); -- 2.47.1