import org.simantics.application.arguments.SimanticsArguments;
import org.simantics.db.ReadGraph;
import org.simantics.db.RequestProcessor;
-import org.simantics.db.RequestProcessorSpecific;
import org.simantics.db.Resource;
import org.simantics.db.Session;
import org.simantics.db.WriteGraph;
} catch (ValueNotFound e) {
throw new DatabaseException("SCL Value not found: " + e.name);
} catch (Throwable t) {
+ if (t instanceof DatabaseException)
+ throw (DatabaseException) t;
throw new DatabaseException(t);
}
}
- @SuppressWarnings({ "unchecked", "rawtypes" })
public static <T> T applySCL(String module, String function, ReadGraph graph, Object ... args) throws DatabaseException {
SCLContext sclContext = SCLContext.getCurrent();
Object oldGraph = sclContext.put("graph", graph);
try {
return (T)f.applyArray(args);
} catch (Throwable t) {
+ if (t instanceof DatabaseException)
+ throw (DatabaseException) t;
throw new DatabaseException(t);
} finally {
sclContext.put("graph", oldGraph);
try {
return (T)f.applyArray(args);
} catch (Throwable t) {
+ if (t instanceof DatabaseException)
+ throw (DatabaseException) t;
throw new DatabaseException(t);
} finally {
sclContext.put("graph", oldGraph);
try {
return function.apply(p0);
} catch (Throwable t) {
+ if (t instanceof DatabaseException)
+ throw (DatabaseException) t;
throw new DatabaseException(t);
} finally {
sclContext.put("graph", oldGraph);
try {
return function.apply(p0);
} catch (Throwable t) {
+ if (t instanceof DatabaseException)
+ throw (DatabaseException) t;
throw new DatabaseException(t);
} finally {
sclContext.put("graph", oldGraph);
try {
return function.apply(p0, p1);
} catch (Throwable t) {
+ if (t instanceof DatabaseException)
+ throw (DatabaseException) t;
throw new DatabaseException(t);
} finally {
sclContext.put("graph", oldGraph);