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;
public static List<SubstructureElement> 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;
@Override
public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> 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);
}
return map;
} else if (StructuralComponentClass.DEFINED.equals(clazz)) {
- StructuralResource2 STR = StructuralResource2.getInstance(graph);
Resource def = graph.getSingleObject(type, STR.IsDefinedBy);
Map<String, Resource> children = graph.syncRequest(new UnescapedChildMapOfResource(def), TransientCacheListener.instance());
return StandardChildDomainChildren.getStandardChildDomainChildVariables(graph, context, children, map);