X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.structural2%2Fsrc%2Forg%2Fsimantics%2Fstructural2%2FFunctions.java;h=e9bb272d3d4442d07184c2bed0437a63f67a5562;hp=8bf4e3df68b6ac62dc30b2575ddb3eb75b1b9bf2;hb=HEAD;hpb=71b33c0f964d2ff1b06fa32bab2a3b47346753c9 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 8bf4e3df6..e9bb272d3 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/Functions.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/Functions.java @@ -50,7 +50,6 @@ import org.simantics.db.layer0.variable.Variable; import org.simantics.db.layer0.variable.VariableMap; import org.simantics.db.layer0.variable.VariableMapImpl; import org.simantics.db.layer0.variable.VariableNode; -import org.simantics.db.layer0.variable.Variables; import org.simantics.db.service.CollectionSupport; import org.simantics.issues.common.IssueUtils; import org.simantics.layer0.Layer0; @@ -333,11 +332,10 @@ public class Functions { public static List getProceduralDesc(ReadGraph graph, final Variable context) throws DatabaseException { StructuralResource2 STR = StructuralResource2.getInstance(graph); - Variable config = Variables.getConfigurationVariable(graph, context); - final Resource type = config.getPossibleType(graph); + final Resource type = context.getPossibleType(graph); if(type != null) { if(graph.isInstanceOf(type, STR.ProceduralComponentType)) { - return graph.syncRequest(new SubstructureRequest(config)); + return graph.syncRequest(new SubstructureRequest(context)); } } return null; @@ -637,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); @@ -655,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);