openArchitectureWare.org

oAW has moved to Eclipse.

At this site you will find information about the outdated version openArchitectureWare 4, only.
Please read our letter of intent for further information.

 
   

HowTo: Evaluating State Charts with Xpand

This article shows an example for evaluating state charts with Xpand.

For all who are looking for a sample template to use with state charts here it is:

«DEFINE Root FOR Class» 
«Name» 
«EXPAND Root FOREACH Namespace.OwnedElement» 
«ENDDEFINE» 

«DEFINE Root FOR Element» 
Element: «Name» 
«ENDDEFINE» 

«DEFINE Root FOR StateMachine NONL» 
«FILE Name» 
«QualifiedName» 
Namespace: «Namespace» 
«EXPAND test FOREACH TopState.SubVertex» 
«ENDFILE» 
«ENDDEFINE» 

«DEFINE test FOR Entry» 
EntryPoint: «Name» 
«EXPAND transition FOREACH OutTransition» 
«ENDDEFINE» 

«DEFINE transition FOR Transition» 
TransitionName: «Name» 
«NONL» 
«IF hasTrigger»«EXPAND trigger FOR Trigger»«ENDIF»«NONL» 
«IF hasAction»Action: «Action.Name»«ENDIF»«NONL» 
«EXPAND vertex FOR TargetVertex» 
«ENDDEFINE» 

«DEFINE trigger FOR SignalEvent» 
SignalEvent: «IF !(ISNULL Name)»«Name»«ENDIF» 
Signal: «IF !(ISNULL Signal)»«Signal»«ENDIF» 
«ENDDEFINE» 

«DEFINE vertex FOR StateVertex» 
Vertex: «Name» 
«EXPAND transition FOREACH OutTransition» 
«ENDDEFINE» 

«DEFINE vertex FOR State» 
State: «Name» 
«EXPAND transition FOREACH OutTransition» 
«ENDDEFINE» 

«DEFINE vertex FOR ExitPoint» 
ExitPoint: «Name» 
«ENDDEFINE» 

«DEFINE test FOR SubmachineState» 
Submachine: «Name» 
«Submachine» 
«ENDDEFINE» 

«DEFINE test FOR ModelElement» 
Rest of elements«NONL» 
«IF !(ISNULL Name) NONL» 
### ModelElement: «This.Name» 
«ELSE NONL» 
### kein Name 
«ENDIF» 
«ENDDEFINE» 
This hint was contributed by Andreas Heinecke.
HowTo: Evaluating State Charts with Xpand | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.