import org.simantics.databoard.Bindings;
import org.simantics.databoard.util.ObjectUtils;
import org.simantics.datatypes.literal.GUID;
-import org.simantics.db.AsyncReadGraph;
import org.simantics.db.ChangeSet;
import org.simantics.db.ChangeSet.StatementChange;
import org.simantics.db.MetadataI;
import org.simantics.db.layer0.genericrelation.DependencyChanges.ComponentModification;
import org.simantics.db.layer0.genericrelation.DependencyChanges.ComponentRemoval;
import org.simantics.db.layer0.genericrelation.DependencyChanges.LinkChange;
-import org.simantics.db.procedure.AsyncContextMultiProcedure;
-import org.simantics.db.procedure.AsyncContextProcedure;
+import org.simantics.db.procedure.SyncContextMultiProcedure;
+import org.simantics.db.procedure.SyncContextProcedure;
import org.simantics.db.service.CollectionSupport;
import org.simantics.db.service.DirectQuerySupport;
import org.simantics.db.service.GraphChangeListenerSupport;
class Process {
final ArrayList<Entry> result = new ArrayList<Entry>();
- final AsyncContextMultiProcedure<Resource, Resource> structure;
- final AsyncContextProcedure<Entry, String> names;
- final AsyncContextProcedure<Entry, Resource> type;
+ final SyncContextMultiProcedure<Resource, Resource> structure;
+ final SyncContextProcedure<Entry, String> names;
+ final SyncContextProcedure<Entry, Resource> type;
Process(ReadGraph graph, final Resource resource) throws DatabaseException {
final DirectQuerySupport dqs = graph.getService(DirectQuerySupport.class);
final CollectionSupport cs = graph.getService(CollectionSupport.class);
- names = dqs.compilePossibleRelatedValue(graph, L0.HasName, new AsyncContextProcedure<Entry, String>() {
+ names = dqs.compilePossibleRelatedValue(graph, L0.HasName, new SyncContextProcedure<Entry, String>() {
@Override
- public void execute(AsyncReadGraph graph, Entry entry, String name) {
+ public void execute(ReadGraph graph, Entry entry, String name) {
entry.name = name;
}
@Override
- public void exception(AsyncReadGraph graph, Throwable throwable) {
+ public void exception(ReadGraph graph, Throwable throwable) {
LOGGER.error("Could not compile possible related value for resource {}", resource, throwable);
}
});
- type = new AsyncContextProcedure<Entry, Resource>() {
+ type = new SyncContextProcedure<Entry, Resource>() {
@Override
- public void execute(AsyncReadGraph graph, Entry entry, Resource type) {
+ public void execute(ReadGraph graph, Entry entry, Resource type) {
entry.principalType = type;
}
@Override
- public void exception(AsyncReadGraph graph, Throwable throwable) {
+ public void exception(ReadGraph graph, Throwable throwable) {
LOGGER.error("Could not find type for resource {}", resource, throwable);
}
};
- structure = dqs.compileForEachObject(graph, L0.ConsistsOf, new AsyncContextMultiProcedure<Resource, Resource>() {
+ structure = dqs.compileForEachObject(graph, L0.ConsistsOf, new SyncContextMultiProcedure<Resource, Resource>() {
@Override
- public void execute(AsyncReadGraph graph, Resource parent, Resource child) {
+ public void execute(ReadGraph graph, Resource parent, Resource child) {
// WORKAROUND: don't browse virtual child resources
if(!child.isPersistent()) return;
Entry entry = new Entry(parent, child, "", "", "");
}
@Override
- public void finished(AsyncReadGraph graph, Resource parent) {
+ public void finished(ReadGraph graph, Resource parent) {
}
@Override
- public void exception(AsyncReadGraph graph, Throwable throwable) {
+ public void exception(ReadGraph graph, Throwable throwable) {
if (throwable instanceof NoSingleResultException) {
// Ignore
if (LOGGER.isDebugEnabled())
ArrayList<Object[]> result = new ArrayList<Object[]>();
for (Entry entry : entries) {
+ if(entry.name == null) continue;
result.add(new Object[] { ss.getRandomAccessId(entry.parent), ss.getRandomAccessId(entry.resource), entry.name, entry.types, entry.id });
}
return result;