import java.util.Set;
import org.simantics.databoard.Bindings;
-import org.simantics.datatypes.literal.GUID;
import org.simantics.db.ReadGraph;
import org.simantics.db.RequestProcessor;
import org.simantics.db.Resource;
Resource component = ir.perform(g);
g.claim(component, L0.HasName, Layer0Utils.literal(g, name));
g.claim(component, L0.HasLabel, Layer0Utils.literal(g, ""));
- g.addLiteral(component, L0.identifier, L0.identifier_Inverse, L0.GUID, GUID.random(), GUID.BINDING);
g.claim(parent, L0.ConsistsOf, component);
+ Layer0Utils.claimNewIdentifier(g, component, true);
// Add comment to change set.
CommentMetadata cm = g.getMetadata(CommentMetadata.class);
g.addMetadata(cm.add("Created component " + component));
if(property == null) return null;
Connection conn = property.getPossibleValue(graph);
if(conn == null) return null;
- Collection<Variable> cps = conn.getConnectionPoints(graph, null);
+ Collection<Variable> cps = conn.getConnectionPoints(graph, component, null);
if(cps.size() == 2) {
for(Variable var : cps) {
if(property.equals(var)) continue;
;
}
- public static List<Variable> structuralConnectionConnectionPoints(ReadGraph graph, Connection conn, Resource relationType) throws DatabaseException {
- return new ArrayList<Variable>(conn.getConnectionPoints(graph, relationType));
+ public static List<Variable> structuralConnectionConnectionPoints(ReadGraph graph, Variable component, Connection conn, Resource relationType) throws DatabaseException {
+ return new ArrayList<Variable>(conn.getConnectionPoints(graph, component, relationType));
}
}