import org.simantics.db.common.request.WriteRequest;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.request.PossibleActiveModel;
+import org.simantics.db.layer0.util.Layer0Utils;
import org.simantics.district.network.ontology.DistrictNetworkResource;
import org.simantics.layer0.Layer0;
Resource ttt = graph.syncRequest(new PossibleTechTypeTable(model, componentType), TransientCacheListener.instance());
+ graph.getSession().markUndoPoint();
+
if (ttt == null) {
ttt = graph.newResource();
graph.claim(ttt, L0.InstanceOf, DN.TechType_TechTypeTable);
graph.claimLiteral(ttt, L0.HasName, UUID.randomUUID().toString());
graph.claim(model, L0.ConsistsOf, ttt);
graph.claim(ttt, DN.TechType_TechTypeTable_HasComponentType, componentType);
+ Layer0Utils.addCommentMetadata(graph, "Create tech type table");
+ } else {
+ graph.deny(ttt, DN.TechType_TechTypeTable_HasEnabledItems);
+ Layer0Utils.addCommentMetadata(graph, "Update tech type table");
}
graph.claimLiteral(ttt, DN.TechType_TechTypeTable_HasData, data);