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
@Override
public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {
@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);
if(type == null) return null;
StructuralComponentClass clazz = StructuralComponentClass.get(graph, type);
}
return map;
} else if (StructuralComponentClass.DEFINED.equals(clazz)) {
}
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);
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);