3030import org .eclipse .emf .transaction .impl .InternalTransactionalEditingDomain ;
3131import org .eclipse .emf .transaction .util .TransactionUtil ;
3232import org .gemoc .executionframework .engine .Activator ;
33- import org .gemoc .executionframework .engine .mse .MseFactory ;
3433import org .gemoc .executionframework .engine .mse .GenericMSE ;
35- import org .gemoc .executionframework .engine .mse .LogicalStep ;
3634import org .gemoc .executionframework .engine .mse .MSE ;
3735import org .gemoc .executionframework .engine .mse .MSEModel ;
3836import org .gemoc .executionframework .engine .mse .MSEOccurrence ;
37+ import org .gemoc .executionframework .engine .mse .MseFactory ;
38+ import org .gemoc .executionframework .engine .mse .SequentialStep ;
39+ import org .gemoc .executionframework .engine .mse .Step ;
3940import org .gemoc .xdsmlframework .api .core .IExecutionContext ;
4041import org .gemoc .xdsmlframework .api .core .ISequentialExecutionEngine ;
4142import org .gemoc .xdsmlframework .api .engine_addon .IEngineAddon ;
@@ -47,7 +48,7 @@ public abstract class AbstractSequentialExecutionEngine extends AbstractExecutio
4748 private Runnable _runnable ;
4849 private MSEModel _actionModel ;
4950 private EMFCommandTransaction currentTransaction ;
50- private Deque <LogicalStep > currentLogicalSteps = new ArrayDeque <LogicalStep >();
51+ private Deque <SequentialStep < Step >> currentLogicalSteps = new ArrayDeque <>();
5152 protected InternalTransactionalEditingDomain editingDomain ;
5253 private IMultiDimensionalTraceAddon traceAddon ;
5354
@@ -94,16 +95,16 @@ private void cleanCurrentTransactionCommand() {
9495 @ Override
9596 public final Deque <MSEOccurrence > getCurrentStack () {
9697 Deque <MSEOccurrence > result = new ArrayDeque <MSEOccurrence >();
97- for (LogicalStep ls : currentLogicalSteps ) {
98- result .add (ls .getMseOccurrences (). get ( 0 ));
98+ for (SequentialStep < Step > ls : currentLogicalSteps ) {
99+ result .add (ls .getMseoccurrence ( ));
99100 }
100101 return result ;
101102 }
102103
103104 @ Override
104105 public final MSEOccurrence getCurrentMSEOccurrence () {
105106 if (currentLogicalSteps .size () > 0 )
106- return currentLogicalSteps .getFirst ().getMseOccurrences (). get ( 0 );
107+ return currentLogicalSteps .getFirst ().getMseoccurrence ( );
107108 else
108109 return null ;
109110 }
@@ -121,31 +122,31 @@ protected final Runnable getRunnable() {
121122 return _runnable ;
122123 }
123124
124- private void notifyMSEOccurenceExecuted (MSEOccurrence occurrence ) {
125- for (IEngineAddon addon : getExecutionContext ().getExecutionPlatform ().getEngineAddons ()) {
126- try {
127- addon .mseOccurrenceExecuted (this , occurrence );
128- } catch (EngineStoppedException ese ) {
129- Activator .getDefault ().info ("Addon has received stop command (" + addon + "), " + ese .getMessage (), ese );
130- stop ();
131- } catch (Exception e ) {
132- Activator .getDefault ().error ("Exception in Addon (" + addon + "), " + e .getMessage (), e );
133- }
134- }
135- }
136-
137- private void notifyMSEOccurrenceAboutToStart (MSEOccurrence occurrence ) {
138- for (IEngineAddon addon : getExecutionContext ().getExecutionPlatform ().getEngineAddons ()) {
139- try {
140- addon .aboutToExecuteMSEOccurrence (this , occurrence );
141- } catch (EngineStoppedException ese ) {
142- Activator .getDefault ().info ("Addon has received stop command (" + addon + "), " + ese .getMessage (), ese );
143- stop ();
144- } catch (Exception e ) {
145- Activator .getDefault ().error ("Exception in Addon (" + addon + "), " + e .getMessage (), e );
146- }
147- }
148- }
125+ // private void notifyMSEOccurenceExecuted(MSEOccurrence occurrence) {
126+ // for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) {
127+ // try {
128+ // addon.mseOccurrenceExecuted(this, occurrence);
129+ // } catch (EngineStoppedException ese) {
130+ // Activator.getDefault().info("Addon has received stop command (" + addon + "), " + ese.getMessage(), ese);
131+ // stop();
132+ // } catch (Exception e) {
133+ // Activator.getDefault().error("Exception in Addon (" + addon + "), " + e.getMessage(), e);
134+ // }
135+ // }
136+ // }
137+
138+ // private void notifyMSEOccurrenceAboutToStart(MSEOccurrence occurrence) {
139+ // for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) {
140+ // try {
141+ // addon.aboutToExecuteMSEOccurrence(this, occurrence);
142+ // } catch (EngineStoppedException ese) {
143+ // Activator.getDefault().info("Addon has received stop command (" + addon + "), " + ese.getMessage(), ese);
144+ // stop();
145+ // } catch (Exception e) {
146+ // Activator.getDefault().error("Exception in Addon (" + addon + "), " + e.getMessage(), e);
147+ // }
148+ // }
149+ // }
149150
150151 private EMFCommandTransaction createTransaction (InternalTransactionalEditingDomain editingDomain , RecordingCommand command ) {
151152 return new EMFCommandTransaction (command , editingDomain , null );
@@ -184,17 +185,17 @@ private void startNewTransaction(InternalTransactionalEditingDomain editingDomai
184185 }
185186 }
186187
187- private LogicalStep createLogicalStep (EObject caller , String className , String methodName ) {
188- LogicalStep logicalStep = MseFactory .eINSTANCE .createLogicalStep ();
188+ private SequentialStep < Step > createLogicalStep (EObject caller , String className , String methodName ) {
189+ SequentialStep < Step > logicalStep = MseFactory .eINSTANCE .createGenericSequentialStep ();
189190 MSE mse = findOrCreateMSE (caller , className , methodName );
190191 MSEOccurrence occurrence = null ;
191192 if (traceAddon == null ) {
192193 occurrence = MseFactory .eINSTANCE .createMSEOccurrence ();
193- logicalStep .getMseOccurrences (). add (occurrence );
194+ logicalStep .setMseoccurrence (occurrence );
194195 occurrence .setMse (mse );
195196 } else {
196197 occurrence = traceAddon .getFactory ().createMSEOccurrence (mse , new ArrayList <Object >(), new ArrayList <Object >());
197- logicalStep .getMseOccurrences (). add (occurrence );
198+ logicalStep .setMseoccurrence (occurrence );
198199 }
199200 currentLogicalSteps .push (logicalStep );
200201 return logicalStep ;
@@ -205,8 +206,8 @@ private boolean isInLogicalStep() {
205206
206207 boolean containsNotNull = false ;
207208
208- for (LogicalStep ls : currentLogicalSteps ) {
209- if (ls != null && ls .getMseOccurrences (). get ( 0 ) != null ) {
209+ for (SequentialStep < Step > ls : currentLogicalSteps ) {
210+ if (ls != null && ls .getMseoccurrence ( ) != null ) {
210211 containsNotNull = true ;
211212 break ;
212213 }
@@ -361,11 +362,11 @@ protected final void beforeExecutionStep(Object caller, String className, String
361362 EObject caller_cast = (EObject ) caller ;
362363
363364 // We create a logical step with a single mse occurrence
364- LogicalStep logicalStep = createLogicalStep (caller_cast , className , operationName );
365+ SequentialStep < Step > logicalStep = createLogicalStep (caller_cast , className , operationName );
365366
366367 // We notify addons
367368 notifyAboutToExecuteLogicalStep (logicalStep );
368- notifyMSEOccurrenceAboutToStart (logicalStep .getMseOccurrences (). get ( 0 ));
369+ // notifyMSEOccurrenceAboutToStart(logicalStep.getMseoccurrence( ));
369370
370371 }
371372
@@ -393,15 +394,15 @@ protected final void afterExecutionStep() {
393394
394395 try {
395396
396- LogicalStep logicalStep = currentLogicalSteps .pop ();
397+ SequentialStep < Step > logicalStep = currentLogicalSteps .pop ();
397398
398399 // We commit the transaction (which might be a different one
399400 // than the one created earlier, or null if two operations
400401 // end successively)
401402 commitCurrentTransaction ();
402403
403404 // We notify addons that the MSE occurrence ended.
404- notifyMSEOccurenceExecuted (logicalStep .getMseOccurrences (). get ( 0 ));
405+ // notifyMSEOccurenceExecuted(logicalStep.getMseoccurrence( ));
405406 notifyLogicalStepExecuted (logicalStep );
406407
407408 // If we are still in the middle of a step, we start a new
0 commit comments