scripting: Execute the analysis to get the state systems

Existing state systems were never picked up because the analysis that
gets them never got executed.

Change-Id: I615c5761a99df3c546fd574f40e763a3cb888d7d
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/154040
Tested-by: CI Bot
diff --git a/analyses/org.eclipse.tracecompass.incubator.scripting.core/src/org/eclipse/tracecompass/incubator/scripting/core/analysis/ScriptedAnalysis.java b/analyses/org.eclipse.tracecompass.incubator.scripting.core/src/org/eclipse/tracecompass/incubator/scripting/core/analysis/ScriptedAnalysis.java
index b07be39..c995649 100644
--- a/analyses/org.eclipse.tracecompass.incubator.scripting.core/src/org/eclipse/tracecompass/incubator/scripting/core/analysis/ScriptedAnalysis.java
+++ b/analyses/org.eclipse.tracecompass.incubator.scripting.core/src/org/eclipse/tracecompass/incubator/scripting/core/analysis/ScriptedAnalysis.java
@@ -71,10 +71,12 @@
         if (analysisModule == null) {
             return null;
         }
+        analysisModule.schedule();
+        analysisModule.waitForCompletion();
+
         stateSystem = (ITmfStateSystemBuilder) analysisModule.getStateSystem(fName, useExisting);
         fStateSystem = stateSystem;
         return stateSystem;
-
     }
 
     /**