]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Remove an unnecessary async transaction from experiment initialization (caused a...
authorjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 11 Jun 2015 09:43:38 +0000 (09:43 +0000)
committerjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 11 Jun 2015 09:43:38 +0000 (09:43 +0000)
refs #5895

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@31402 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiment.java

index 54f8aa28f2a72777482032c02448841053cbc148..852153bc9c62f97f90dac3c25e449d839b341058 100644 (file)
@@ -97,7 +97,7 @@ public class SysdynExperiment extends Experiment implements IDynamicExperiment,
         * Initialize this experiment\r
         * @param g ReadGraph\r
         */\r
-       public void init(ReadGraph g) {\r
+       public void init(ReadGraph g) throws DatabaseException {\r
                try {\r
                        this.experimentName = NameUtils.getSafeName(g, experiment);\r
                } catch (DatabaseException e) {\r
@@ -108,16 +108,10 @@ public class SysdynExperiment extends Experiment implements IDynamicExperiment,
                state = ExperimentState.STOPPED;\r
                for(IExperimentListener listener : listeners.getListeners())\r
                        listener.stateChanged(state);\r
-\r
-               session.asyncRequest(new ReadRequest() {\r
-\r
-                       @Override\r
-                       public void run(ReadGraph graph) throws DatabaseException {\r
-                               final Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
-                               sysdynModel = SysdynModelManager.getInstance(session).getModel(graph, configuration);\r
-                               toggleActivation(graph, true);\r
-                       }\r
-               });\r
+               \r
+               final Resource configuration = g.getPossibleObject(model, SimulationResource.getInstance(g).HasConfiguration);\r
+               sysdynModel = SysdynModelManager.getInstance(session).getModel(g, configuration);\r
+               toggleActivation(g, true);\r
 \r
                setSysdynExperimentState(ExperimentState.INITIALIZING);\r
        }\r