Browse Source

Moved general extensions to BaseExtension.ext.
Added support for entry- and exit sequences.
Added support for StateSwitch and Case.

markus.muehlbrandt@itemis.de 13 years ago
parent
commit
e883c35781

+ 30 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/features/JavaFeatureConstants.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.java.features;
+
+/**
+ * 
+ * @author muehlbrandt
+ */
+public final class JavaFeatureConstants implements IJavaFeatureConstants {
+	
+	public static final String getNamingFeature() {
+		return NAMING_FEATURE;
+	}
+	
+	public static final String getBasePackage() {
+		return BASE_PACKAGE;
+	}
+	
+	public static final String getImplementationSuffix() {
+		return IMPLEMENTATION_SUFFIX;
+	}
+}

+ 48 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/BaseExtension.ext

@@ -0,0 +1,48 @@
+/*
+  Copyright (c) 2011 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+import stext;
+import sexec;
+import sgraph;
+
+List getDeclaredVariables(ExecutionFlow flow) : flow.scopes.declarations.typeSelect(VariableDefinition);
+
+getInterfaceScope(ExecutionFlow this) : scopes.typeSelect(InterfaceScope);
+getInterfaceScopeDeclarations(ExecutionFlow this) : getInterfaceScope().declarations;
+getInterfaceScopeVariables(ExecutionFlow this) : getInterfaceScopeDeclarations().typeSelect(VariableDefinition);
+getInterfaceScopeEvents(ExecutionFlow this) : getInterfaceScopeDeclarations().typeSelect(EventDefinition);
+getInterfaceScopeVoidEvents(ExecutionFlow this) : getInterfaceScopeEvents().select(e|e.type==Type::void);
+getInterfaceScopeValuedEvents(ExecutionFlow this) : getInterfaceScopeEvents().select(e|e.type!=Type::void);
+
+getInternalScope(ExecutionFlow this) : scopes.typeSelect(InternalScope);
+getInternalScopeDeclarations(ExecutionFlow this) : getInternalScope().declarations;
+getInternalScopeVariables(ExecutionFlow this) :	getInternalScopeDeclarations().typeSelect(VariableDefinition);
+getInternalScopeEvents(ExecutionFlow this) : getInternalScopeDeclarations().typeSelect(EventDefinition);
+getInternalScopeVoidEvents(ExecutionFlow this) :getInternalScopeEvents().select(e|e.type==Type::void);
+getInternalScopeValuedEvents(ExecutionFlow this) : getInternalScopeEvents().select(e|e.type!=Type::void);
+
+getTimeEvents(ExecutionFlow this) : scopes.typeSelect(Scope).declarations.typeSelect(TimeEvent);
+
+boolean isTimedStatemachine(ExecutionFlow this) :
+	getTimeEvents().size > 0;
+	
+boolean hasOutgoingEvents(Scope this) :
+	!declarations.typeSelect(EventDefinition).select(event|event.direction == Direction::OUT).isEmpty;
+
+boolean hasOutgoingVoidEvents(Scope this) :
+	!declarations.typeSelect(EventDefinition).select(event|event.direction == Direction::OUT).select(event|event.type == Type::void).isEmpty;
+	
+boolean hasOutgoingValuedEvents(Scope this) :
+	!declarations.typeSelect(EventDefinition).select(event|event.direction == Direction::OUT).select(event|event.type != Type::void).isEmpty;
+
+boolean hasEvents(Scope this) :
+	!declarations.typeSelect(EventDefinition).select(event|event.type == Type::void).isEmpty;
+	
+boolean hasValuedEvents(Scope this) :
+	!declarations.typeSelect(EventDefinition).select(event|event.type != Type::void).isEmpty;

+ 42 - 26
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomBaseStatemachine.xpt

@@ -16,6 +16,7 @@ Contributors:
 «IMPORT ecore»
 
 «IMPORT org::yakindu::sct::generator::java::templates»
+«EXTENSION org::yakindu::sct::generator::java::templates::BaseExtension»
 «EXTENSION org::yakindu::sct::generator::java::templates::Expression»
 «EXTENSION org::yakindu::sct::generator::java::templates::Naming»
 
@@ -27,6 +28,14 @@ Contributors:
 // EntryCode for Step «toString()» not defined
 «ENDDEFINE»
 
+«DEFINE ActionCode FOR StateSwitch-»
+	«FOREACH cases AS stateCase ITERATOR iter -»
+	«IF iter.counter1 > 1»else «ENDIF»if (activeStates.contains(State.«stateCase.state.getName()»)) {
+		«EXPAND ActionCode FOR stateCase.step»
+	}
+	«ENDFOREACH-»
+«ENDDEFINE»
+
 «DEFINE ActionCode FOR ScheduleTimeEvent-»
 getTimerHandler().setTimer(«timeEvent.getName()», «timeValue.toCode()», cycleStartTime);
 «ENDDEFINE»
@@ -108,13 +117,9 @@ else {
   «ENDFOREACH-»
 «ENDDEFINE»
 
-«DEFINE CycleCode FOR Cycle-» 
-	«EXPAND ActionCode FOREACH this.steps-»
-«ENDDEFINE»
-
 «DEFINE CycleMethodsImplement FOR ExecutionState-»
 	private void cycle«getName()»(Collection<?> events) {
-		«EXPAND CycleCode FOR cycle
+		«EXPAND ActionCode FOREACH cycle.steps-»
 	}
 «ENDDEFINE»
 
@@ -134,17 +139,20 @@ else {
 «ENDIF-»
 «ENDDEFINE»
 
-«DEFINE EntryCode FOR EnterState-»
-	public void «statemachineEntryFunctionName()» {
-		«IF isTimedStatemachine((ExecutionFlow)eContainer.eContainer)-»
-		cycleStartTime = System.currentTimeMillis();
-		«ENDIF-»
-		«EXPAND ActionCode FOR this-»
-		«IF state.entryAction != null-»
-		«state.entryAction.entryActionFunctionName()»();
-		«ENDIF»
-		
+«DEFINE EnterSequenceImplement FOR ExecutionState»
+	«IF enterSequence.steps.size > 0 -»
+	private void «enterSequenceName()»() {
+		«EXPAND ActionCode FOREACH enterSequence.steps-»
 	}
+	«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE ExitSequenceImplement FOR ExecutionState-»
+	«IF exitSequence.steps.size > 0 -»
+	private void «exitSequenceName()»() {
+		«EXPAND ActionCode FOREACH exitSequence.steps-»
+	}
+	«ENDIF-»
 «ENDDEFINE»
 
 «DEFINE file(sgen::GeneratorEntry entry) FOR ExecutionFlow-»
@@ -170,7 +178,7 @@ import 
 import «entry.getBasePackageName()».ValuedEvent;
 «ENDIF-»
 
-public abstract class «getBaseStatemachineName()» implements «getImplementationType()» {
+public abstract class «getBaseStatemachineName()» implements «getStatemachineImplementationType()» {
 	
 	«FOREACH getInternalScopeEvents() AS event-»
 	private final «event.getEventType()» «event.getName()» = new «event.getEventType()»(«event.getCreationSignature()»); 
@@ -221,25 +229,23 @@ public abstract class 
 	protected Collection<Event> getOutEvents(){
 		return outEvents;
 	}
-		
-	«EXPAND EntryCode FOREACH enterSequence.steps-»
 	
 	protected boolean eventOccured() {
 		return !getOccuredEvents().isEmpty();
 	}
 	
-	@Override
+	
 	public void init() {
 		
 	}
 	
 	«IF isTimedStatemachine()-»
-	@Override
+	
 	public void setTimerHandler(ITimerHandler timerHandler) {
 		this.timerHandler = timerHandler;
 	}
 
-	@Override
+	
 	public ITimerHandler getTimerHandler() {
 		if (timerHandler == null) {
 			throw new NullPointerException("TimerHandler of statemachine \"+«name»+\" not set!");
@@ -247,7 +253,6 @@ public abstract class 
 		return timerHandler;
 	}
 	
-	@Override
 	public void notify(Notification<?> notification) {
 		if (notification instanceof EventNotification) {
 			EventNotification eventNotification = (EventNotification) notification;
@@ -266,6 +271,7 @@ public abstract class 
 	}
 	
 	«ENDFOREACH-»
+	«REM»create getters and setters for events«ENDREM»
 	«FOREACH getInternalScopeEvents() AS event-»
 	private void raise«event.name.toFirstUpper()»() {
 		getOccuredEvents().add(«event.getName()»);
@@ -277,12 +283,13 @@ public abstract class 
 		getOccuredEvents().add(«event.getName()»);
 	}
 	
-	private «event.type.getJavaType()» get«event.getValueName().toFirstUpper()»() {
-		return «event.getName()».getValue();
+	«ENDIF-»
+	private «event.getEventType()» get«event.getName()»() {
+		return «event.getName()»;
 	}
 	
-	«ENDIF-»
 	«ENDFOREACH-»
+	«REM»Create getters and setters for variables«ENDREM»
 	«FOREACH getInternalScopeVariables() AS variable-»
 	private «variable.type.getJavaType()» get«variable.getValueName().toFirstUpper()»() {
 		return «variable.getValueName()»;
@@ -293,11 +300,20 @@ public abstract class 
 	}	
 	
 	«ENDFOREACH-»
+	«REM»Create enterSequences for statemachine«ENDREM»
+	«IF enterSequence.steps.size > 0 -»
+	public void «enterSequenceName()»() {
+		«EXPAND ActionCode FOREACH enterSequence.steps-»
+	}
+	«ENDIF-»
+	
 «EXPAND ConditionMethodsImplement FOREACH this.states-»
 «EXPAND StatementMethodsImplement FOREACH this.states-»
-«EXPAND CycleMethodsImplement FOREACH this.states-»
 «EXPAND EnterMethodImplement FOREACH this.states-»
 «EXPAND ExitMethodImplement FOREACH this.states-»
+«EXPAND EnterSequenceImplement FOREACH this.states-»
+«EXPAND ExitSequenceImplement FOREACH this.states-»
+«EXPAND CycleMethodsImplement FOREACH this.states-»
 	protected void runCycle(Collection<?> events) {
 		«IF isTimedStatemachine()-»
 		cycleStartTime = System.currentTimeMillis();

+ 0 - 2
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomEventBasedStatemachine.xpt

@@ -34,12 +34,10 @@ public class 
 		super(new LinkedList<Event>());
 	}
 	
-	@Override
 	protected Queue<Event> getOccuredEvents() {
 		return (Queue<Event>) super.getOccuredEvents();
 	}
 	
-	@Override
 	public void runCycle() {
 		if (eventOccured()) {
 			Event event = getOccuredEvents().poll();

+ 1 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomInterface.xpt

@@ -14,6 +14,7 @@ Contributors:
 «IMPORT sgraph»
 
 «EXTENSION org::yakindu::sct::generator::java::templates::Naming»
+«EXTENSION org::yakindu::sct::generator::java::templates::BaseExtension»
 
 «DEFINE file(sgen::GeneratorEntry entry) FOR InterfaceScope-»
 «FILE getImplementationPackagePath(entry)+"/"+getInterfaceName() + '.java'-»

+ 1 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomInterfaceImpl.xpt

@@ -13,6 +13,7 @@ Contributors:
 «IMPORT stext»
 «IMPORT sgraph»
 
+«EXTENSION org::yakindu::sct::generator::java::templates::BaseExtension»
 «EXTENSION org::yakindu::sct::generator::java::templates::Naming»
 «EXTENSION org::yakindu::sct::generator::java::templates::Expression»
 

+ 50 - 93
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/Naming.ext

@@ -17,41 +17,20 @@ import sgraph;
 import sgen;
 
 extension org::yakindu::sct::generator::java::templates::Expression;
+extension org::yakindu::sct::generator::java::templates::BaseExtension;
 
-List declaredVariables(ExecutionFlow flow) : flow.scopes.declarations.typeSelect(VariableDefinition);
-
-getInterfaceScope(ExecutionFlow this) : scopes.typeSelect(InterfaceScope);
-getInterfaceScopeDeclarations(ExecutionFlow this) : getInterfaceScope().declarations;
-getInterfaceScopeVariables(ExecutionFlow this) : getInterfaceScopeDeclarations().typeSelect(VariableDefinition);
-getInterfaceScopeEvents(ExecutionFlow this) : getInterfaceScopeDeclarations().typeSelect(EventDefinition);
-getInterfaceScopeVoidEvents(ExecutionFlow this) : getInterfaceScopeEvents().select(e|e.type==Type::void);
-getInterfaceScopeValuedEvents(ExecutionFlow this) : getInterfaceScopeEvents().select(e|e.type!=Type::void);
-
-getInternalScope(ExecutionFlow this) : scopes.typeSelect(InternalScope);
-getInternalScopeDeclarations(ExecutionFlow this) : getInternalScope().declarations;
-getInternalScopeVariables(ExecutionFlow this) :	getInternalScopeDeclarations().typeSelect(VariableDefinition);
-getInternalScopeEvents(ExecutionFlow this) : getInternalScopeDeclarations().typeSelect(EventDefinition);
-getInternalScopeVoidEvents(ExecutionFlow this) :getInternalScopeEvents().select(e|e.type==Type::void);
-getInternalScopeValuedEvents(ExecutionFlow this) : getInternalScopeEvents().select(e|e.type!=Type::void);
-getTimeEvents(ExecutionFlow this) : scopes.typeSelect(Scope).declarations.typeSelect(TimeEvent);
-
-boolean isTimedStatemachine(ExecutionFlow this) :
-	getTimeEvents().size > 0;
-
-String getStatemachineName(ExecutionFlow this) : name.toFirstUpper();
+String getStatemachineName(ExecutionFlow this) : (name.toLowerCase() == "default")? name.toFirstUpper()+"SM" : name.toFirstUpper();
 String getBaseStatemachineName(ExecutionFlow this) : name.toFirstUpper() + "AbstractBaseStatemachine";
+String getBaseStatemachineName(InterfaceScope this) : ((ExecutionFlow)eContainer).getBaseStatemachineName();
 String getEventBasedStatemachineName(ExecutionFlow this) : name.toFirstUpper() + "EventBasedStatemachine";
 String getCycleBasedStatemachineName(ExecutionFlow this) : name.toFirstUpper() + "CyleBasedStatemachine";
 
-String getImplementationType(ExecutionFlow this):
+String getStatemachineImplementationType(ExecutionFlow this):
 	if isTimedStatemachine() then
 		"ITimedStatemachine"
 	else
 		"IStatemachine"; 
 
-String getCustomPackage(ExecutionFlow this) : "org/yakindu/sct/runtime/java/"+getStatemachineName().toLowerCase()+"/";
-String getCustomPackage(InterfaceScope this) : "org/yakindu/sct/runtime/java/"+getStatemachineName((ExecutionFlow)eContainer).toLowerCase()+"/";
-
 String getInterfaceName(InterfaceScope this) :  
 	if name!=null then
 		"Interface" + name.toFirstUpper()
@@ -59,12 +38,6 @@ String getInterfaceName(InterfaceScope this) :
 		"InterfaceDefault";
 		 
 String getInterfaceImplName(InterfaceScope this) :  getInterfaceName() + "Impl";
-String getBaseStatemachineName(InterfaceScope this) : ((ExecutionFlow)eContainer).getBaseStatemachineName();
-
-String getQualifiedName(EventDefinition this) : getContext() + name.toFirstUpper();
-		
-String getValueName(EventDefinition this) : "eventValue"+name.toFirstUpper();
-String getInternalName(EventDefinition this) : name.toFirstUpper();
 
 String getInitialValue(EventDefinition this) :
 	if derivation != null then
@@ -80,12 +53,19 @@ String getInitialValue(EventDefinition this) :
 		default : ""
 		};
 
-String getInitialValueAssignment(EventDefinition this) :
-	if derivation != null then
-		" = " + derivation.condition.toCode()
+String getCreationSignature(EventDefinition this) :
+	if type == Type::void then
+		"\""+name+"\""
 	else
-		null;
-		
+		"\""+name+"\", "+getInitialValue();
+
+String getEventType(EventDefinition this) :
+	if type == Type::void then
+		"Event"
+	else
+		"ValuedEvent<"+type.getJavaClassType()+">";
+
+	
 String getInitialValueAssignment(VariableDefinition this) : 
 	if initialValue != null then
 		" = " + initialValue
@@ -96,6 +76,9 @@ String getValueName(VariableDefinition this) : "var"+name.toFirstUpper();
 
 String getName(ExecutionState this) :
 	simpleName.replaceAll(" ","").toFirstUpper();
+	
+String getName(ExecutionFlow this) :
+	name.replaceAll(" ","").toFirstUpper();
 
 String getName(Event this) :
 	"Event"+name.toFirstUpper();
@@ -103,24 +86,6 @@ String getName(Event this) :
 String getName(TimeEvent this) :
 	name.replaceAll(" ","").toFirstUpper();
 
-String getterVisibility(EventDefinition this) : 
-	switch (direction) {
-	case (Direction::OUT) : "public"
-	case (Direction::IN) : "private"
-	default : "private"
-	};
-	
-String setterVisibility(EventDefinition this) : 
-	switch (direction) {
-	case (Direction::OUT) : "private"
-	case (Direction::IN) : "public"
-	default : "private"
-	};
-	
-String setterValueVisibility(VariableDefinition this) : 
-	if (readonly) then "private"
-	else "public";
-
 String getJavaType(Type type) :
 		switch (type) {
 		case (Type::real) : "double"
@@ -129,7 +94,7 @@ String getJavaType(Type type) :
 		case (Type::string) : "string"
 		default : ""
 		};
-
+		
 String getJavaClassType(Type type) :
 		switch (type) {
 		case (Type::real) : "Double"
@@ -139,25 +104,15 @@ String getJavaClassType(Type type) :
 		case (Type::void) : "Void"
 		default : ""
 		};
-		
-String getEventType(EventDefinition this) :
-	if type == Type::void then
-		"Event"
-	else
-		"ValuedEvent<"+type.getJavaClassType()+">";
-		
-String getCreationSignature(EventDefinition this) :
-	if type == Type::void then
-		"\""+name+"\""
-	else
-		"\""+name+"\", "+getInitialValue();
-
+				
 cached String functionName(Step step) : 
 	(step.isEffect()) ? step.actionFunctionName() : (
 	(step.isReactionCheck()) ? step.checkFunctionName() : (
 	(step.isEntryAction()) ? step.entryActionFunctionName() : ( 
-	(step.isExitAction()) ? step.exitActionFunctionName() : 
-	" !! unknown function type !!" )));
+	(step.isExitAction()) ? step.exitActionFunctionName() :  (
+	(step.isEnterSequence()) ? step.enterSequenceName() : (
+	(step.isExitSequence()) ? step.exitSequenceName() :
+	" // unknown function type "+step )))));
  
 String statemachineEntryFunctionName(EnterState this):
 	if (this.name != null) then
@@ -167,13 +122,21 @@ String statemachineEntryFunctionName(EnterState this):
 
 String actionFunctionName(Step this) : "actions" + getName(reaction().state()) + this.reaction().name.toFirstUpper(); 
 String checkFunctionName(Step this) : "condition" + getName(reaction().state()) + this.reaction().name.toFirstUpper(); 
-String entryActionFunctionName(Step this) : "entryActions" + getName(state()); 
-String exitActionFunctionName(Step this) : "exitActions" + getName(state()); 
+String entryActionFunctionName(Step this) : "entryAction" + getName(state()); 
+String exitActionFunctionName(Step this) : "exitAction" + getName(state());
+String enterSequenceName(Step this) : "enterSequence"+getName(state()); 
+String enterSequenceName(ExecutionState this) : "enterSequence"+getName();
+String enterSequenceName(ExecutionFlow this) : "enterSequenceStatechart"+getName();
+String exitSequenceName(Step this) : "exitSequence"+getName(state()); 
+String exitSequenceName(ExecutionState this) : "exitSequence"+getName();
+String exitSequenceName(ExecutionFlow this) : "enterSequenceStatechart"+getName();
 
 isEffect(Step step) : (! Check.isInstance(step)) && Reaction.isInstance(step.eContainer) ;
 isReactionCheck(Step step) : Reaction.isInstance(step.eContainer) && Check.isInstance(step);
 isEntryAction(Step step) : ExecutionState.isInstance(step.eContainer) && step.state().entryAction == step;
 isExitAction(Step step) : ExecutionState.isInstance(step.eContainer) && step.state().exitAction == step;
+isEnterSequence(Step step) : Sequence.isInstance(step) && step.name == "enterSequence";
+isExitSequence(Step step) : Sequence.isInstance(step) && step.name == "exitSequence";
 
 Reaction reaction(Step this) : (Reaction) this.eContainer ;
 ExecutionState state(Reaction this) : (ExecutionState) eContainer;
@@ -190,21 +153,6 @@ String getContext(Event this) :
 		getInterfaceName((InterfaceScope)eContainer).toFirstUpper()+"."
 	else 
 		"";
-		
-boolean hasOutgoingEvents(Scope this) :
-	!declarations.typeSelect(EventDefinition).select(event|event.direction == Direction::OUT).isEmpty;
-
-boolean hasOutgoingVoidEvents(Scope this) :
-	!declarations.typeSelect(EventDefinition).select(event|event.direction == Direction::OUT).select(event|event.type == Type::void).isEmpty;
-	
-boolean hasOutgoingValuedEvents(Scope this) :
-	!declarations.typeSelect(EventDefinition).select(event|event.direction == Direction::OUT).select(event|event.type != Type::void).isEmpty;
-
-boolean hasEvents(Scope this) :
-	!declarations.typeSelect(EventDefinition).select(event|event.type == Type::void).isEmpty;
-	
-boolean hasValuedEvents(Scope this) :
-	!declarations.typeSelect(EventDefinition).select(event|event.type != Type::void).isEmpty;
 	
 String getInterfaceExtension(Scope this):
 	if (hasOutgoingEvents()) then
@@ -217,11 +165,20 @@ String getInterfaceImplExtension(Scope this):
 		" extends NotificationSender"
 	else
 		null;
+
+String getNamingFeature() :
+ JAVA org.yakindu.sct.generator.java.features.JavaFeatureConstants.getNamingFeature();
+ 
+String getBasePackage() :
+ JAVA org.yakindu.sct.generator.java.features.JavaFeatureConstants.getBasePackage();
+ 
+String getImplementationSuffix() :
+ JAVA org.yakindu.sct.generator.java.features.JavaFeatureConstants.getImplementationSuffix();
 		
 String getBasePackageName(GeneratorEntry entry):
-	if entry.getFeatureConfiguration("NamingFeature")!=null 
-		&& entry.getFeatureConfiguration("NamingFeature").getParameterValue("basePackage")!=null then
-		entry.getFeatureConfiguration("NamingFeature").getParameterValue("basePackage").getStringValue()
+	if entry.getFeatureConfiguration(getNamingFeature())!=null 
+		&& entry.getFeatureConfiguration(getNamingFeature()).getParameterValue(getBasePackage())!=null then
+		entry.getFeatureConfiguration(getNamingFeature()).getParameterValue(getBasePackage()).getStringValue()
 	else
 		"org.yakindu.sct.runtime.java";
 
@@ -229,9 +186,9 @@ String getBasePackagePath(GeneratorEntry entry):
 	entry.getBasePackageName().replaceAll("\\.","/");
 	
 String getImplementationSuffix(GeneratorEntry entry, ExecutionFlow flow):
-	if entry.getFeatureConfiguration("NamingFeature")!=null
-		&& entry.getFeatureConfiguration("NamingFeature").getParameterValue("implementationSuffix") != null then
-		entry.getFeatureConfiguration("NamingFeature").getParameterValue("implementationSuffix").getStringValue()
+	if entry.getFeatureConfiguration(getNamingFeature())!=null
+		&& entry.getFeatureConfiguration(getNamingFeature()).getParameterValue(getImplementationSuffix()) != null then
+		entry.getFeatureConfiguration(getNamingFeature()).getParameterValue(getImplementationSuffix()).getStringValue()
 	else 
 		flow.getStatemachineName();
 

+ 0 - 2
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/TimerHandler.xpt

@@ -39,7 +39,6 @@ public class TimerHandler implements ITimerHandler {
 		this.statemachine = statemachine;
 	}
 
-	@Override
 	public void setTimer(final TimeEvent event, long time, long cycleStartTime) {
 		// Reset existing TimerTask for event. This step isn't necessary if
 		// timer tasks are properly reset by sexec model.
@@ -68,7 +67,6 @@ public class TimerHandler implements ITimerHandler {
 		}
 	}
 
-	@Override
 	public void resetTimer(TimeEvent event) {
 		if (timerTaskMap.containsKey(event) && timerTaskMap.get(event) != null) {
 			timerTaskMap.get(event).cancel();