Browse Source

Fixed issue in WorkspaceClassLoaderFactory and extended new C code generator.

terfloth@itemis.de 13 years ago
parent
commit
e2b73c0f3a

+ 11 - 2
plugins/org.yakindu.sct.commons/src/org/yakindu/sct/commons/WorkspaceClassLoaderFactory.java

@@ -54,14 +54,23 @@ public class WorkspaceClassLoaderFactory {
 	/**
 	 * Creates a {@link ClassLoader} that can be used to load resources from the
 	 * workspace.
+	 * 
+	 * @deprecated use factory method that takes a parent {@link ClassLoader}
 	 */
 	public ClassLoader createClassLoader(IProject project) {
+		return createClassLoader(project, WorkspaceClassLoaderFactory.class.getClassLoader());
+	}
+
+	/**
+	 * Creates a {@link ClassLoader} that can be used to load resources from the
+	 * workspace.
+	 */
+	public ClassLoader createClassLoader(IProject project, ClassLoader parent) {
 		final List<URL> urls = Lists.newArrayList();
 
 		addClasspathEntries(project, urls);
 
-		return URLClassLoader.newInstance(urls.toArray(new URL[urls.size()]),
-				WorkspaceClassLoaderFactory.class.getClassLoader());
+		return URLClassLoader.newInstance(urls.toArray(new URL[urls.size()]), parent);
 	}
 
 	protected void addClasspathEntries(IProject project, List<URL> urls) {

+ 7 - 13
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CSCTGenerator.xtend

@@ -15,29 +15,23 @@ import org.yakindu.sct.model.sgraph.Statechart
 class CSCTGenerator implements IExecutionFlowGenerator {
 	 
 	@Inject extension Types
-	@Inject extension Timer 
 	@Inject extension Statemachine
+	@Inject extension StatemachineC
+	@Inject extension StatemachineRequired
  	
 
-//	override public runGenerator(Statechart statechart, GeneratorEntry entry) {
-//		entry.injector.injectMembers(this);
-//		
-//		val flow = statechart.createExecutionFlow(entry)
-//		//val fsa = entry.fileSystemAccess
-//				
-//		flow.generateStatemachineH(statechart, fsa)
-//	}
-	
-	
 	
 	override generate(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
 
 		flow.generateTypesH(flow.sourceElement as Statechart, fsa)
 		
-		flow.generateTimerH(flow.sourceElement as Statechart, fsa)
-		flow.generateTimerC(flow.sourceElement as Statechart, fsa)
+//		flow.generateTimerH(flow.sourceElement as Statechart, fsa)
+//		flow.generateTimerC(flow.sourceElement as Statechart, fsa)
 
 		flow.generateStatemachineH(flow.sourceElement as Statechart, fsa)
+		flow.generateStatemachineClientH(flow.sourceElement as Statechart, fsa)
+
+		flow.generateStatemachineC(flow.sourceElement as Statechart, fsa)
 
 	}
 

+ 122 - 0
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/FlowCode.xtend

@@ -0,0 +1,122 @@
+package org.yakindu.sct.generator.c
+
+import com.google.inject.Inject
+import org.yakindu.sct.model.sexec.Call
+import org.yakindu.sct.model.sexec.Check
+import org.yakindu.sct.model.sexec.CheckRef
+import org.yakindu.sct.model.sexec.EnterState
+import org.yakindu.sct.model.sexec.Execution
+import org.yakindu.sct.model.sexec.ExitState
+import org.yakindu.sct.model.sexec.HistoryEntry
+import org.yakindu.sct.model.sexec.If
+import org.yakindu.sct.model.sexec.SaveHistory
+import org.yakindu.sct.model.sexec.ScheduleTimeEvent
+import org.yakindu.sct.model.sexec.Sequence
+import org.yakindu.sct.model.sexec.StateSwitch
+import org.yakindu.sct.model.sexec.Step
+import org.yakindu.sct.model.sexec.UnscheduleTimeEvent
+import org.yakindu.sct.model.sgraph.Statement
+
+class FlowCode {
+	
+	@Inject extension Naming
+	@Inject extension Navigation
+	
+	def expCode (Statement it) '''
+		#warning TODO: generate code for «getClass().name»
+	'''
+ 
+	def stepComment(Step it) '''
+		«IF comment != null && ! comment.empty»
+			/* «comment» */
+		«ENDIF»
+	'''
+	
+	def dispatch code(Step it) '''
+		#warning ActionCode for Step '«getClass().name»' not defined
+	'''
+
+	def dispatch code(SaveHistory it) '''
+		«stepComment»
+		handle->historyVector[«region.historyVector.offset»] = handle->stateConfVector[«region.stateVector.offset»];
+	'''
+	
+	def dispatch code(HistoryEntry it) '''
+		«stepComment»
+		if (handle->historyVector[«region.historyVector.offset»] != last_state) {
+			«historyStep.code»
+		} else {
+			«initialStep.code»
+		}
+	'''
+
+	def dispatch code(StateSwitch it) '''
+		«stepComment»
+		«IF historyRegion != null»
+			switch(handle->historyVector[ «historyRegion.historyVector.offset» ]) {
+		«ELSE»
+			switch(handle->stateConfVector[ «stateConfigurationIdx» ]) {
+		«ENDIF»
+			«FOR caseid : cases»
+				case «caseid.state.name.asIdentifier» : {
+					«caseid.step.code»
+					break;
+				}
+			«ENDFOR»
+			default: break;
+		}
+	'''
+
+	def dispatch code(ScheduleTimeEvent it) '''
+		«stepComment»
+		// TODO: schedule time event id:
+		«flow.type.toFirstLower»_setTimer( EVID , «timeValue.expCode», «IF timeEvent.periodic»true«ELSE»false«ENDIF»);
+	'''
+
+	def dispatch code(UnscheduleTimeEvent it) '''
+		«stepComment»
+		// TODO: unschedule time event id:
+		«flow.type.toFirstLower»_unsetTimer( EVID );		
+	'''
+
+	def dispatch code(Execution it) '''
+		«statement.expCode»
+	'''
+	
+	def dispatch code(Call it) '''
+		#warning TODO: call function(handle)
+	'''
+
+	def dispatch code(Sequence it) '''
+		«stepComment»
+		«FOR s : steps»«s.code»«ENDFOR»
+	'''	
+
+	def dispatch code(Check it) '''
+		«IF condition != null»«condition.expCode»«ELSE»true«ENDIF»
+	'''
+	
+	def dispatch code(CheckRef it) '''
+		«IF check != null»callcheckfunc(handle)«ELSE»true«ENDIF»
+	'''
+
+	def dispatch code(If it) '''
+		«stepComment»
+		if («check.code») { 
+			«thenStep.code»
+		} «IF (elseStep != null)» else {
+			«elseStep.code»
+		}
+		«ENDIF»
+	'''
+	
+	def dispatch code(EnterState it) '''
+		handle->stateConfVector[«state.stateVector.offset»] = «state.name.asIdentifier»;
+		handle->stateConfVectorPosition = «state.stateVector.offset»;
+	'''
+
+	def dispatch code(ExitState it) '''
+		handle->stateConfVector[«state.stateVector.offset»] = last_state;
+		handle->stateConfVectorPosition = «state.stateVector.offset»;
+	'''
+}

+ 14 - 0
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Naming.xtend

@@ -7,6 +7,7 @@ import org.yakindu.sct.model.stext.stext.InternalScope
 import org.yakindu.sct.model.sgraph.Scope
 import org.yakindu.sct.model.stext.stext.VariableDefinition
 import org.yakindu.sct.model.stext.stext.EventDefinition
+import org.yakindu.sct.model.stext.stext.OperationDefinition
 
 class Naming {
 
@@ -16,6 +17,10 @@ class Naming {
 		name.asIdentifier.toFirstUpper	
 	}
 	
+	def client(String it) {
+		it + "Required"	
+	}
+	
 	def timerModule(ExecutionFlow it) {
 		'sc_timer'	
 	}
@@ -88,6 +93,10 @@ class Naming {
 	def asSetter(VariableDefinition it) {
 		scope.functionPrefix + '_set_' + name.asIdentifier.toFirstLower	
 	}
+
+	def asFunction(OperationDefinition it) {
+		scope.functionPrefix + '_' + name.asIdentifier.toFirstLower	
+	}
 	
 	
 	def h(String it) { it + ".h" }
@@ -100,4 +109,9 @@ class Naming {
 		replaceAll('[^a-z&&[^A-Z&&[^0-9]]]', '_')
 	}
 	
+	
+	def dispatch scopeDescription(Scope it) '''scope'''
+	
+	def dispatch scopeDescription(InterfaceScope it) '''«IF name==null || name.empty»default interface scope«ELSE»interface scope '«name»'«ENDIF»'''
+	def dispatch scopeDescription(InternalScope it) '''internal scope'''
 }

+ 18 - 2
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Navigation.xtend

@@ -9,18 +9,29 @@ import org.yakindu.sct.model.sgraph.Scope
 import org.yakindu.sct.model.sexec.TimeEvent
 import org.yakindu.sct.model.sgraph.Declaration
 import org.yakindu.sct.model.stext.stext.EventDefinition
+import java.util.ArrayList
+import org.yakindu.sct.model.stext.stext.OperationDefinition
+import org.eclipse.emf.ecore.EObject
 
 class Navigation {
 	
-	def ExecutionFlow flow(Scope scope) {
+	def dispatch ExecutionFlow flow(Scope scope) {
 		if (scope.eContainer instanceof ExecutionFlow) scope.eContainer as ExecutionFlow
 		else null
 	}
 	
-	def ExecutionFlow flow(Declaration it) {
+	def dispatch ExecutionFlow flow(Declaration it) {
 		scope?.flow
 	}
 	
+	def dispatch ExecutionFlow flow(EObject it) {
+		eContainer.flow
+	}
+	
+	def dispatch ExecutionFlow flow(ExecutionFlow it) {
+		it
+	}
+	
 	def Scope scope(Declaration it) {
 		if (eContainer instanceof Scope) eContainer as Scope
 		else null
@@ -39,4 +50,9 @@ class Navigation {
 		type != null && type.name != 'void'
 	}
 	
+	def operations(ExecutionFlow it) {
+		scopes.fold(new ArrayList<OperationDefinition>(), [ l, s | l.addAll(s.declarations.filter( typeof(OperationDefinition))) return l ])
+	}
+	
+
 }

+ 43 - 27
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Statemachine.xtend

@@ -7,7 +7,6 @@ import org.yakindu.sct.model.sgraph.Statechart
 import org.yakindu.sct.model.stext.stext.InterfaceScope
 import org.yakindu.sct.model.stext.stext.EventDefinition
 import org.yakindu.sct.model.stext.stext.VariableDefinition
-import org.yakindu.sct.model.stext.stext.InternalScope
 import org.yakindu.sct.model.sgraph.Declaration
 import org.yakindu.sct.model.sgraph.Scope
 import org.yakindu.sct.model.stext.stext.StatechartScope
@@ -31,33 +30,40 @@ class Statemachine {
 			#define «module.define»_H_
 
 			#include "«typesModule.h»"
-			#include "«timerModule.h»"
-
+			
 			#ifdef __cplusplus
-			extern "C" {
+			extern "C" { 
 			#endif 
 
+			/*! \file Header of the state machine '«name»'.
+			*/
+			
 			«statesEnumDecl»
 			
 			«FOR s : it.scopes»«s.scopeTypeDecl»«ENDFOR»
 			
 			«statemachineTypeDecl»
 
-			/* Initializes the «type» state machine data structures. Must be called before first usage.*/
-			extern void «type.toFirstLower»_init(«type»* handle «IF timed», «timerType»* timer«ENDIF»);
+			/*! Initializes the «type» state machine data structures. Must be called before first usage.*/
+			extern void «type.toFirstLower»_init(«type»* handle);
 			
-			/* Activates the state machine */
+			/*! Activates the state machine */
 			extern void «type.toFirstLower»_enter(«type»* handle);
 			
-			/* Deactivates the state machine */
+			/*! Deactivates the state machine */
 			extern void «type.toFirstLower»_exit(«type»* handle);
 			
-			/* Performs a 'run to completion' step. */
+			/*! Performs a 'run to completion' step. */
 			extern void «type.toFirstLower»_runCycle(«type»* handle);
 
-			«FOR s : it.scopes.filter( typeof(InterfaceScope) )»
-			«s.scopeFunctionPrototypes»
+			«IF timed»
+				/*! Raises a time event. */
+				extern void «type.toFirstLower»_raiseTimeEvent(«type»* handle, sc_eventid evid);
+			«ENDIF»
 			
+			«FOR s : it.scopes.filter( typeof(InterfaceScope) )»
+				«s.scopeFunctionPrototypes»
+				
 			«ENDFOR»
 			
 			#ifdef __cplusplus
@@ -68,7 +74,7 @@ class Statemachine {
 	'''
 
 	def statesEnumDecl(ExecutionFlow it) '''
-		// enumeration of all states 
+		//! enumeration of all states 
 		typedef enum {
 			«FOR state : states »
 			«state.name.asIdentifier» ,
@@ -95,7 +101,7 @@ class Statemachine {
 	
 	
 	def dispatch scopeTypeDecl(Scope it) '''
-		// Type definition of the data structure for the «it.type» interface scope.
+		//! Type definition of the data structure for the «it.type» interface scope.
 		typedef struct {
 			«FOR d : declarations »
 			«d.structDeclaration »
@@ -107,24 +113,22 @@ class Statemachine {
 //	def dispatch scopeTypeDecl(Scope it) ''''''	
 
 	def statemachineTypeDecl(ExecutionFlow it) '''
-		// the maximum number of orthogonal states defines the dimension of the state configuration vector.
-		#define MAX_ORTHOGONAL_STATES «stateVector.size»
+		//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
+		#define «type.toUpperCase»_MAX_ORTHOGONAL_STATES «stateVector.size»
 		«IF ! historyVector.empty»
-		// dimension of the state configuration vector for history states
-		#define MAX_HISTORY_STATES «historyVector.size»«ENDIF»
+		//! dimension of the state configuration vector for history states
+		#define «type.toUpperCase»_MAX_HISTORY_STATES «historyVector.size»«ENDIF»
 		
-		// Type definition of the data structure for the «type» state machine.
-		// This data structure has to be allocated by the client code.
+		/*! Type definition of the data structure for the «type» state machine.
+		This data structure has to be allocated by the client code. */
 		typedef struct {
-			«statesEnumType» stateConfVector[MAX_ORTHOGONAL_STATES];
-			«IF ! historyVector.empty»«statesEnumType» historyVector[MAX_HISTORY_STATES];«ENDIF»
+			«statesEnumType» stateConfVector[«type.toUpperCase»_MAX_ORTHOGONAL_STATES];
+			«IF ! historyVector.empty»«statesEnumType» historyVector[«type.toUpperCase»_MAX_HISTORY_STATES];«ENDIF»
 			sc_ushort stateConfVectorPosition; 
 			
 			«FOR iScope : scopes »
 			«iScope.type» «iScope.instance»;
-			«ENDFOR»
-			
-			«IF timed»SCTimer*    timer;«ENDIF»
+			«ENDFOR»			
 		} «type»;
 	'''
 
@@ -142,16 +146,28 @@ class Statemachine {
 
 	def dispatch functionPrototypes(EventDefinition it) '''
 		«IF direction == Direction::IN»
+		/*! Raises the in event '«name»' that is defined in the «scope.scopeDescription». */ 
 		extern «type.cPrimitive» «asRaiser»(«it.flow.type»* handle«valueParams»);
+		
 		«ELSE»
-		extern sc_boolean «asRaised»(«it.flow.type»* handle);
-		extern «type.cPrimitive» «asGetter»(«it.flow.type»* handle);
+			/*! Checks if the out event '«name»' that is defined in the «scope.scopeDescription» has been raised. */ 
+			extern sc_boolean «asRaised»(«it.flow.type»* handle);
+			
+			«IF hasValue»
+				/*! Gets the value of the out event '«name»' that is defined in the «scope.scopeDescription». */ 
+				extern «type.cPrimitive» «asGetter»(«it.flow.type»* handle);
+				
+			«ENDIF»
 		«ENDIF»
 	'''
 
 	def dispatch functionPrototypes(VariableDefinition it) '''
+		/*! Gets the value of the variable '«name»' that is defined in the «scope.scopeDescription». */ 
 		extern «type.cPrimitive» «it.asGetter»(«it.flow.type»* handle);
-		«IF ! readonly »extern void «asSetter»(«it.flow.type»* handle, «type.cPrimitive» value);«ENDIF»
+		«IF ! readonly »
+			/*! Sets the value of the variable '«name»' that is defined in the «scope.scopeDescription». */ 
+			extern void «asSetter»(«it.flow.type»* handle, «type.cPrimitive» value);
+		«ENDIF»
 	'''
 
 	def valueParams(EventDefinition it) {

+ 74 - 0
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineC.xtend

@@ -0,0 +1,74 @@
+package org.yakindu.sct.generator.c
+
+import com.google.inject.Inject
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgraph.Statechart
+import org.eclipse.xtext.generator.IFileSystemAccess
+
+class StatemachineC {
+	
+	@Inject extension Naming
+	@Inject extension Navigation
+	@Inject extension Base
+	@Inject extension FlowCode
+	
+	
+	def generateStatemachineC(ExecutionFlow flow, Statechart sc, IFileSystemAccess fsa) {
+		 fsa.generateFile(flow.module.c, flow.statemachineCContent )
+	}
+	
+	
+	
+	def statemachineCContent(ExecutionFlow it) '''
+		#include "«module.h»"
+		#include <stdlib.h>
+		#include <string.h>
+
+
+		// function prototypes
+		// function implementations
+
+		«initFunction»
+		
+		«enterFunction»
+		
+		«exitFunction»
+	'''
+	
+	
+	def initFunction(ExecutionFlow it) '''
+		void «type.toFirstLower»_init(«type»* handle)
+		{
+			int i;
+
+			for (i = 0; i < «type.toUpperCase»_MAX_ORTHOGONAL_STATES; ++i)
+				handle->stateConfVector[i] = last_state;
+			
+			«IF ! historyVector.empty»
+			for (i = 0; i < «type.toUpperCase»_MAX_HISTORY_STATES; ++i)
+				handle->historyVector[i] = last_state;
+			«ENDIF»
+			
+			handle->stateConfVectorPosition = 0;
+
+			// TODO: initialize all events ...
+			// TODO: initialize all variables ... (set default values - here or inenter sequence ?!?)
+
+		}
+	'''
+	
+	def enterFunction(ExecutionFlow it) '''
+		void «type.toFirstLower»_enter(«type»* handle)
+		{
+			«enterSequence.code»
+		}
+	'''
+	
+	def exitFunction(ExecutionFlow it) '''
+		void «type.toFirstLower»_exit(«type»* handle)
+		{
+			«exitSequence.code»
+		}
+	'''
+	
+}

+ 109 - 0
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineRequired.xtend

@@ -0,0 +1,109 @@
+package org.yakindu.sct.generator.c
+
+import com.google.inject.Inject
+import org.eclipse.xtext.generator.IFileSystemAccess
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgraph.Declaration
+import org.yakindu.sct.model.sgraph.Statechart
+import org.yakindu.sct.model.stext.stext.OperationDefinition
+import org.yakindu.sct.model.stext.stext.StatechartScope
+
+class StatemachineRequired {
+
+	@Inject extension Naming cNaming
+	@Inject extension Navigation
+	@Inject extension Base
+	
+	def generateStatemachineClientH(ExecutionFlow flow, Statechart sc, IFileSystemAccess fsa) {
+		 fsa.generateFile(flow.module.client.h, flow.statemachineClientHContent )
+	}
+	
+	
+	
+	def statemachineClientHContent(ExecutionFlow it) '''
+			#ifndef «module.client.define»_H_
+			#define «module.client.define»_H_
+
+			#include "«typesModule.h»"
+
+			#ifdef __cplusplus
+			extern "C" {
+			#endif 
+			
+			
+
+			/*! \file This header defines prototypes for all functions that are required by the state machine implementation.
+			
+			«IF timed»
+				This is a state machine uses time events which require access to a timing service. Thus the function prototypes:
+					- «type.toFirstLower»_setTimer and
+					- «type.toFirstLower»_unsetTimer
+				are defined.
+			«ENDIF»
+			
+			«IF operations.size > 0»
+				This state machine makes use of operations declared in the state machines interface or internal scopes. Thus the function prototypes:
+					«FOR o : operations»
+					- «o.asFunction»
+					«ENDFOR»
+				are defined.
+			«ENDIF»
+					
+			These functions will be called during a 'run to completion step' (runCycle) of the statechart. 
+			There are some constraints that have to be considered for the implementation of these functions:
+				- never call the statechart API functions from within these functions.
+				- make sure that the execution time is as short as possible.
+			 
+			*/
+
+			«FOR s : it.scopes »
+			«s.scopeFunctionPrototypes»
+			
+			«ENDFOR»
+			
+			«IF timed»
+			//
+			// This is a timed state machine that requires timer services
+			// 
+			
+			//! This function has to set up timers for the time events that are required by the state machine.
+			/*! 
+				This function will be called for each time event that is relevant for a state when a state will be entered.
+				\param evid An unique identifier of the event.
+				\time_ms The time in milli seconds
+				\periodic Indicates the the time event must be raised periodically until the timer is unset 
+			*/
+			extern void «type.toFirstLower»_setTimer(const sc_eventid evid, const sc_integer time_ms, const sc_boolean periodic);
+
+			//! This function has to unset timers for the time events that are required by the state machine.
+			/*! 
+				This function will be called for each time event taht is relevant for a state when a state will be left.
+				\param evid An unique identifier of the event.
+			*/
+			extern void «type.toFirstLower»_unsetTimer(const sc_eventid evid);
+			«ENDIF»
+			
+			#ifdef __cplusplus
+			}
+			#endif 
+			
+			#endif /* «module.client.define»_H_ */
+	'''
+	
+	
+	def dispatch scopeFunctionPrototypes(StatechartScope it) '''
+		«FOR d : declarations »
+		«d.functionPrototypes »
+		«ENDFOR»
+	'''	
+
+	def dispatch scopeFunctionPrototypes(Object it) ''''''	
+	
+
+	def dispatch functionPrototypes(Declaration it) ''''''
+
+	def dispatch functionPrototypes(OperationDefinition it) '''
+		extern «type.cPrimitive» «asFunction»(«FOR p : parameters SEPARATOR ', '»const «p.type.cPrimitive» «p.name.asIdentifier»«ENDFOR»);
+	'''
+
+}

+ 7 - 5
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Types.xtend

@@ -24,13 +24,15 @@ class Types {
 		
 		#include <stdint.h>
 		 				
-		typedef int_fast16_t sc_short;
+		typedef int_fast16_t  sc_short;
 		typedef uint_fast16_t sc_ushort;
-		typedef int32_t sc_integer; 
-		typedef uint32_t sc_uinteger; 
+		typedef int32_t       sc_integer; 
+		typedef uint32_t      sc_uinteger; 
+		typedef double        sc_real;
+		typedef char*         sc_string;
 		typedef enum { bool_false = 0, bool_true = 1 } sc_boolean;
-		typedef double sc_real;
-		typedef char* sc_string;
+		
+		typedef uint32_t      sc_eventid;
 		
 		#ifdef __cplusplus
 		}

+ 12 - 1
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/impl/GenericJavaBasedGenerator.java

@@ -91,7 +91,7 @@ public class GenericJavaBasedGenerator extends AbstractSExecModelGenerator {
 	protected ClassLoader getClassLoader(GeneratorEntry entry) {
 		IProject project = getLookupRoot(entry);
 		final ClassLoader classLoader = new WorkspaceClassLoaderFactory()
-				.createClassLoader(project);
+				.createClassLoader(project, getClass().getClassLoader());
 		return classLoader;
 	}
 
@@ -106,6 +106,13 @@ public class GenericJavaBasedGenerator extends AbstractSExecModelGenerator {
 					.loadClass(templateClass);
 			Object delegate = getInjector(entry).getInstance(
 					delegateGeneratorClass);
+			
+			Class<?> iType_ = (Class<?>) getClass().getClassLoader()
+					.loadClass("org.yakindu.sct.generator.core.impl.IExecutionFlowGenerator"); 
+			Class<?> iType__ = IExecutionFlowGenerator.class;
+			Class<?> iType = (Class<?>) classLoader
+					.loadClass("org.yakindu.sct.generator.core.impl.IExecutionFlowGenerator"); 
+			
 			if (delegate instanceof AbstractWorkspaceGenerator) {
 				((AbstractWorkspaceGenerator) delegate).setBridge(bridge);
 			}
@@ -113,6 +120,10 @@ public class GenericJavaBasedGenerator extends AbstractSExecModelGenerator {
 				IExecutionFlowGenerator flowGenerator = (IExecutionFlowGenerator) delegate;
 				flowGenerator.generate(createExecutionFlow(flow, entry), entry, fsa);
 			}
+			if (iType.isInstance(delegate)) {
+				IExecutionFlowGenerator flowGenerator = (IExecutionFlowGenerator) delegate;
+				flowGenerator.generate(createExecutionFlow(flow, entry), entry, fsa);
+			}
 			if (delegate instanceof ISGraphGenerator) {
 				ISGraphGenerator graphGenerator = (ISGraphGenerator) delegate;
 				graphGenerator.generate(flow, entry);