import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.exception.ManyObjectsForFunctionalRelationException;\r
import org.simantics.db.exception.ServiceException;\r
-import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.db.layer0.request.PossibleModel;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.sysdyn.manager.SysdynModel;\r
import org.simantics.sysdyn.representation.Configuration;\r
\r
public static String getTimeUnit(ReadGraph graph, SysdynModel model) {\r
try {\r
- Resource modelResource = graph.getPossibleObject(model.getConfigurationResource(), SimulationResource.getInstance(graph).IsConfigurationOf);\r
+ Resource modelResource = graph.syncRequest(new PossibleModel(model.getConfigurationResource()));\r
if(modelResource != null) {\r
String timeUnit = graph.getPossibleRelatedValue(modelResource, SysdynResource.getInstance(graph).SysdynModel_timeUnit);\r
if(timeUnit == null)\r
timeUnit = "month";\r
return timeUnit;\r
}\r
- \r
} catch (ManyObjectsForFunctionalRelationException e) {\r
e.printStackTrace();\r
} catch (ServiceException e) {\r
e.printStackTrace();\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
}\r
\r
return null;\r