import org.simantics.databoard.util.Bean;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.request.PossibleModel;\r
import org.simantics.history.HistoryException;\r
import org.simantics.history.HistorySamplerItem;\r
import org.simantics.history.ItemManager;\r
\r
try {\r
\r
- Resource model = graph.syncRequest(new PossibleModel(subscriptionItem));\r
+ Resource model = graph.syncRequest(new PossibleIndexRoot(subscriptionItem));\r
if ( model == null ) {\r
throw new DatabaseException("There is no model for " + subscriptionItem);\r
}\r
\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
import org.simantics.db.common.request.ResourceRead;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.layer0.Layer0;\r
@Override\r
public Resource perform(ReadGraph graph) throws DatabaseException {\r
\r
- Resource model = graph.sync(new PossibleModel(resource));\r
+ Resource model = graph.sync(new PossibleIndexRoot(resource));\r
if(model == null) return null;\r
\r
Layer0 b = Layer0.getInstance(graph);\r
public TIntIntHashMap inverses = new TIntIntHashMap();\r
public TIntHashSet externals = new TIntHashSet();\r
public TIntIntHashMap ids = new TIntIntHashMap(100, 0.6f, -1, -1);\r
+ public TIntHashSet pending = new TIntHashSet();\r
\r
public int statementCount;\r
public int valueCount;\r
int p = state.otherStatementsInput.readInt();\r
int o = state.otherStatementsInput.readInt();\r
if(!exclude) {\r
- if(state.excludedShared.contains(o)) {\r
+ if(state.pending.contains(o)) {\r
+ System.err.println("excluding garbage statement " + s + " " + p + " " + o + ", object resource is garbage");\r
+ } else if(state.excludedShared.contains(o)) {\r
System.err.println("excluding shared " + s + " " + p + " " + o);\r
} else {\r
\r
String uri = graph.getPossibleURI(r);\r
if(uri != null)\r
state.externals.add(transientId);\r
- else\r
+ else {\r
+ state.pending.add(transientId);\r
System.err.println("Pending status in export: " + NameUtils.getSafeName(graph, r, true) + " (" + graph.getPossibleURI(r) + ")");\r
+ }\r
}\r
}\r
\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.RequestProcessor;\r
import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
import org.simantics.db.common.request.TernaryRead;\r
import org.simantics.db.common.utils.Logger;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.exception.MissingVariableException;\r
import org.simantics.db.layer0.request.Model;\r
import org.simantics.db.layer0.request.PossibleActiveVariableFromVariable;\r
-import org.simantics.db.layer0.request.PossibleModel;\r
import org.simantics.db.layer0.request.PossibleVariableIndexRoot;\r
import org.simantics.db.layer0.request.PossibleVariableModel;\r
import org.simantics.db.layer0.request.PropertyInfo;\r
\r
public static Variable getPossibleConfigurationContext(ReadGraph graph, Resource resource) throws DatabaseException {\r
SimulationResource SIMU = SimulationResource.getInstance(graph);\r
- if (!graph.isInstanceOf(resource, SIMU.Model)) resource = graph.sync(new PossibleModel(resource));\r
+ if (!graph.isInstanceOf(resource, SIMU.Model)) resource = graph.sync(new PossibleIndexRoot(resource));\r
if (resource == null)\r
return null;\r
Resource configurationResource = graph.getPossibleObject(resource, SIMU.HasConfiguration);\r
\r
public static Variable getPossibleConfigurationContext(ReadGraph graph, Variable variable) throws DatabaseException {\r
SimulationResource SIMU = SimulationResource.getInstance(graph);\r
- Resource model = getPossibleModel(graph, variable);\r
+ Resource model = getPossibleIndexRoot(graph, variable);\r
if (model == null)\r
return null;\r
Resource configurationResource = graph.getPossibleObject(model, SIMU.HasConfiguration);\r
bb(DIA.FlagIsJoinedBy, Element, Join)\r
),\r
deny(bb(STR.Joins, Join, Connection)))\r
+ ),\r
+ if_(and(bf(L0.ConsistsOf, Diagram, Element),\r
+ bf(MOD.DiagramConnectionToConnectionSpecial, Element, Connection),\r
+ not(b(new Tag(STR.Connects), Connection))),\r
+ deny(exists(Connection))\r
));\r
}\r
\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.exception.PendingVariableException;\r
-import org.simantics.db.layer0.request.PossibleModel;\r
import org.simantics.db.layer0.request.PossibleVariableValue;\r
import org.simantics.db.layer0.variable.RVI;\r
import org.simantics.db.layer0.variable.Variable;\r
if (rvi == null)\r
return NO_VARIABLE_ID;\r
\r
- Resource model = graph.syncRequest(new PossibleModel(item));\r
+ Resource model = graph.syncRequest(new PossibleIndexRoot(item));\r
if (model != null) {\r
ModelContexts contexts = graph.syncRequest(new ModelContextsRequest(model), TransientCacheAsyncListener.<ModelContexts>instance());\r
Variable configurationContext = contexts.getConfigurationContext();\r
import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;\r
import org.simantics.db.common.procedure.adapter.TransientCacheListener;\r
import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
import org.simantics.db.common.request.ResourceRead;\r
import org.simantics.db.common.uri.UnescapedChildMapOfResource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.function.All;\r
import org.simantics.db.layer0.function.StandardChildDomainChildren;\r
-import org.simantics.db.layer0.request.PossibleModel;\r
import org.simantics.db.layer0.request.PropertyInfo;\r
import org.simantics.db.layer0.request.PropertyInfoRequest;\r
import org.simantics.db.layer0.request.VariableRead;\r
\r
Layer0 L0 = Layer0.getInstance(graph);\r
SimulationResource SIMU = SimulationResource.getInstance(graph);\r
- Resource model = graph.sync(new PossibleModel(resource));\r
+ Resource model = graph.sync(new PossibleIndexRoot(resource));\r
if(graph.isInstanceOf(model, L0.RVIContext)) {\r
return fromContext(graph, model);\r
}\r