reference.textile 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. <link href="../../css/bootstrap.css" rel="stylesheet" />
  2. h1. SCT Reference
  3. h2. Statechart elements
  4. In the following the state chart elements of the YAKINDU SCT 2 editor are described. The meta model of the YAKINDU SCT 2 is the model of finite state machines. It is based on the view of a system that is defined by a finite number of states. The behavior of that system is based on the active states. These states are determined by the history of the state machine. Very important are the theoretical models for state machines by Mealy and Moore. Mealy state machines associate actions with transitions. Moore machines associate actions with states (entry, exit). In the YAKINDU SCT 2 both is possible.
  5. The YAKINDU SCT 2 meta model is designed similar to the UML state chart meta model with the following differences
  6. * they are self contained with interfaces defined by events and variables
  7. * core execution semantics are cycle driven, not event driven
  8. ** this allows to process concurrent events
  9. ** event driven behavior can be defined on top
  10. * time is an abstract concept for state charts
  11. * time control is delegated to the environment
  12. The model interpreter and different flavors of generated code follow these same core semantics.
  13. Please refer to the description of the "UML Statecharts":http://en.wikipedia.org/wiki/UML_state_machine for more details.
  14. h3. Regions
  15. As already mentioned the YAKINDU state charts are self contained. They are organized in regions. Due to this it is possible to organize multiple state machines in different regions and to run them concurrently.
  16. !images/parallelRegions.jpg!
  17. h3. States
  18. States are the central elements of a state machine. A state has to be placed inside a region and needs a unique name inside this region. During simulation each state can be active or passive. An active state has actions that are accomplished. Either an action is carried out on entering a state, during active state or on exit.
  19. h3. Transitions
  20. A transition is the transfer of one state to another. Transitions are diagrammed as arrows and can carry events and actions but must not.
  21. The syntax of events and actions is defined by a textual description language (#Statechartdescriptionlanguage). Please refer to the documentation section "Events":#Events for more details. For more details on Actions refer to the chapter "Actions":#ReactionTriggers.
  22. If a state has more than one outgoing transition without event that transition is carried out first that was modeled first.
  23. h3. Initial state and final state
  24. Initial and final states are pseudo states, because the state chart does not rest on them. Pseudo states express characteristics that are impossible to express by simple states.
  25. The initial state is always the first state that is active during interpretation or simulation of the state machine. An initial state can only have one outgoing transition and no incoming. This transition has no events or actions.
  26. Inside a region only one initial state is allowed, but every region can have an initial state.
  27. h3. Choice
  28. Choice is also a pseudo state. It can be used to model a conditional path. Choice nodes divide a transition into multiple parts.
  29. Usually the first transition points towards the choice node. One of the choice outgoing transitions can carry a condition.
  30. h3. Junction
  31. A junction is a pseudo state do combine transitions. This is very comfortable if a state machine has many similar transitions. Junctions add clear arrangement to the state machine.
  32. h3. Composite State
  33. A composite state is a state that is composed of other state machines. These are also organized in regions. Besides the simple composite state YAKINDU knows two kinds of composite states: orthogonal state and submachine states.
  34. Composite states contain other state machine branches.
  35. h4. Orthogonal states
  36. In the context of state machines orthogonal states are states that are independent from each other. The most famous example is the keyboard example:
  37. !images/orthogonalState_example.jpg!
  38. h4. Submachine states
  39. Submachine states may contain complete state machines. Here the user can chose another state machine to be included or create a new sub statemachine. During simulation only the top level statemachine is interpreted. It is not possible to jump to the sub level state machines and back.
  40. !images/substatemachine_example.jpg!
  41. h3. Shallow History
  42. The shallow history state is a pseudo state that is placed inside regions of composite states. It is used to 'remember' the last active state inside a composite state. So it is possible to jump to this state instead of starting at the inner entry state again. The following example of a questionaire answering will explain this:
  43. !images/shallowHistory01.jpg!
  44. The interesting parts in this state chart are the events _checkProgress_ and _goon_. CheckProgress jumps back to the init state while assigning the current progress count to the variable _temp_. _goon_ jumps to the shallow history state that was placed inside the composite state.
  45. !images/shallowHistory02.jpg!
  46. !images/shallowHistory03.jpg!
  47. On triggering the _goon_ event the last active state is activated again.
  48. h3. Deep History
  49. Deep history is similar to shallow history but more complex. With a deep history the latest state of multiple nested states is remembered.
  50. h2. Statechart description language
  51. The textual description language is used to declare and describe behaviors in the state machine. It is case sensitive.
  52. h3. Typesystem
  53. The language has an integrated small typesystem with the following simple types:
  54. * integer
  55. * real
  56. * boolean
  57. * string
  58. * void
  59. So events and variables can be declared with types:
  60. bc..
  61. var intVar : integer
  62. var realVar : real
  63. var boolVar : boolean
  64. var stringVar : string
  65. var voidVar : void
  66. event addInt : integer
  67. event checkValidity : boolean
  68. h3. Expressions
  69. Expressions can be defined similar to other programming languages. The language offers operators to define logical expressions, bitwise arithmetic, and arithmetic expressions and bit shifting.
  70. Logical expressions are similar to other programming languages. The return type is *boolean*. In the following there are some examples of these:
  71. h4. Logical AND
  72. bc..
  73. var1 && var2
  74. h4. Logical OR
  75. bc..
  76. var1 || var2
  77. h4. Logical NOT
  78. bc..
  79. !var1
  80. h4. Conditional expression
  81. bc..
  82. var1 ? var2 : 23
  83. h4. Bitwise XOR
  84. bc..
  85. var1 ^ var2
  86. h4. Bitwise OR
  87. bc..
  88. var1 | var2
  89. h4. Bitwise AND
  90. bc..
  91. var1 & var2
  92. h4. Logical Relations and Shift Operators
  93. |less than | < |
  94. |equal or less than | <= |
  95. |greater than | > |
  96. |equal or greater than | >= |
  97. |equal | == |
  98. |not equal | != |
  99. |shift left | << |
  100. |shift right | >> |
  101. h4. Binary arithmetic operators
  102. |plus | + |
  103. |minus | - |
  104. |multiply | * |
  105. |divide | / |
  106. |modulo | % |
  107. h4. Unary arithmetic operators
  108. |positive | + |
  109. |negative | - |
  110. |complement | ~ |
  111. h3. Statements
  112. A statements can be either an assignment, raising an event or call an operation. The language has the following assignment operators:
  113. * simple assignment: =
  114. * multiply and assign: *=
  115. * divide and assign: /=
  116. * calculate modulo and assign: %=
  117. * add and assign: +=
  118. * subtract and assign: -=
  119. * bitshift left and assign: <<=
  120. * bitshift right and assign: >>=
  121. * bitwise AND and assign: &=
  122. * bitwise XOR and assign: ^=
  123. * bitwise OR and assign: @|=@
  124. An event is raised by the keyword _raise_ followed by the event name and if it is an interface event the name of the interface.
  125. An operation is called similar to other programming languages with the operation name and passing concrete parameters. The parameters can be expressions.
  126. h3. Scopes
  127. ==<!-- Start stext_keyword_namespace -->==
  128. h4. Namespace
  129. The language allows to define unique namespaces, which can be used to qualify references to the statechart.
  130. bc..
  131. namespace trafficlights
  132. p. ==<!-- End stext_keyword_namespace -->==
  133. ==<!-- Start stext_keyword_interface -->==
  134. h4. interface scope
  135. Declarations in the interface scope are externally visible. They can be shared within the environment.
  136. bc..
  137. interface NamedInterface:
  138. in event event1
  139. out event event3
  140. var variable1 : real
  141. entrypoint entry1
  142. exitpoint exit1
  143. p. ==<!-- End stext_keyword_interface -->==
  144. ==<!-- Start stext_keyword_internal -->==
  145. h4. internal scope
  146. Declarations made in an internal scope are only visible for contained states.
  147. bc..
  148. internal:
  149. var localVariable1: integer
  150. event localEvent: integer
  151. local event localEvent2: NamedInterface.event1 || localEvent
  152. local event localEvent3: localEvent || localEvent2 : 25
  153. operation localOperation (integer, integer): integer
  154. localEvent3 / raise NamedInterface.event3 :
  155. localOperation(valueOf(localEvent),NamedInterface.variable1);
  156. p. ==<!-- End stext_keyword_internal -->==
  157. h3. Declarations
  158. Within scopes there can be declarations of Events, Variables, Operations, LocalReactions, EntryPoints and ExitPoints.
  159. ==<!-- Start stext_keyword_event -->==
  160. h3. Events
  161. Within interface scope events have an direction. They can either be ingoing or outgoing:
  162. bc..
  163. interface NamedInterface:
  164. in event event1
  165. out event event2
  166. p. Within local scope events can carry variables:
  167. bc..
  168. internal:
  169. event localEvent1 : integer
  170. p. Local events can be derived from interface events or other local events and can have a value assignment:
  171. bc..
  172. internal:
  173. event localEvent1: integer
  174. local event localEvent2 = NamedInterface.event1 || localEvent1
  175. local event localEvent3 = localEvent2 || 25
  176. p. ==<!-- End stext_keyword_event -->==
  177. ==<!-- Start stext_keyword_var -->==
  178. h3. Variables
  179. Variables can have different visibilities. They can be visible for the environment:
  180. bc..
  181. var variable1: real
  182. p. Variables can be *readonly* (constants):
  183. bc..
  184. var readonly pi: real = 3.1415
  185. p. Variables can be referenced by the environment.
  186. bc..
  187. var external variable3: integer = 34
  188. p. ==<!-- End stext_keyword_var -->==
  189. h3. Reaction Triggers
  190. Actions are key constructs in state machines to model behavior. The YAKINDU SCT 2 knows the following kinds of actions.
  191. ==<!-- Start stext_keyword_after -->==
  192. h4. after
  193. The _after_ trigger specifies one-shot time events.
  194. After the specified time the reaction is triggered. An _after_ trigger can be used in transitions of states as well in local reactions of states and statecharts. The specified time starts when the state or statechart is entered.
  195. bc. after 20 s
  196. Structure:
  197. @after@ _@time@_ (_@unit@_)?
  198. The time unit can be:
  199. * ==<!-- Start stext_keyword_s -->== s - seconds ==<!-- End stext_keyword_s -->==
  200. * ==<!-- Start stext_keyword_ms -->== ms - milliseconds ==<!-- End stext_keyword_ms -->==
  201. * ==<!-- Start stext_keyword_us -->== us - microseconds ==<!-- End stext_keyword_us -->==
  202. * ==<!-- Start stext_keyword_ns -->== ns - nanoseconds ==<!-- End stext_keyword_ns -->==
  203. * empty - implies seconds
  204. p. ==<!-- End stext_keyword_after -->==
  205. ==<!-- Start stext_keyword_every -->==
  206. h4. every
  207. The _every_ trigger specifies periodic time events.
  208. The reaction is triggered periodically after the specified time. An _every_ trigger can be used in transitions of states as well in local reactions of states and statecharts. The specified time starts when the state or statechart is entered and repeats periodically.
  209. bc. every 200 ms
  210. Structure:
  211. @every@ _@time@_ (_@unit@_)?
  212. The time unit can be:
  213. * s - seconds
  214. * ms - milliseconds
  215. * us - microseconds
  216. * ns - nanoseconds
  217. * empty - implies seconds
  218. ==<!-- End stext_keyword_every -->==
  219. ==<!-- Start stext_keyword_always -->==
  220. h4. always
  221. This trigger is always true and enables a reaction to be executed in every run to completion step (RTS). It is equivalent to _oncycle_.
  222. ==<!-- End stext_keyword_always -->==
  223. ==<!-- Start stext_keyword_default -->==
  224. ==<!-- Start stext_keyword_else -->==
  225. h4. default, else
  226. The _default_ trigger is equivalent to the _else_ trigger. It is intended for use for the outgoing transitions of _choice_ pseudo states, to make sure that always an outgoing transition can be taken. It can only be be used in transitions and implies the lowest evaluation priority for that transition.
  227. ==<!-- End stext_keyword_else -->==
  228. ==<!-- End stext_keyword_default -->==
  229. ==<!-- Start stext_keyword_entry -->==
  230. h4. entry
  231. An _entry_ trigger marks actions that are carried out on entering a state or state machine.
  232. ==<!-- End stext_keyword_entry -->==
  233. ==<!-- Start stext_keyword_exit -->==
  234. h4. exit
  235. An _exit_ trigger marks actions that are carried out on exiting a state or state machine.
  236. ==<!-- End stext_keyword_exit -->==
  237. ==<!-- Start stext_keyword_oncycle -->==
  238. h4. oncycle
  239. The _oncycle_ trigger is always true and enables a reaction to be executed in every run to completion step (RTS). It is equivalent to _always_.
  240. ==<!-- End stext_keyword_oncycle -->==
  241. ==<!-- Start stext_keyword_operation -->==
  242. h3. Operations
  243. Operations can have none, one or multiple parameters. The parameters are only declarated by their type. An operation can have one return type similar to Java.
  244. bc..
  245. operation localOperation (integer, integer):integer
  246. localEvent3/ raise NamedInterface3.event1
  247. p.
  248. ==<!-- End stext_keyword_operation -->==
  249. h3. Build-In Functions
  250. ==<!-- Start stext_keyword_valueof -->==
  251. h4. valueof(event)
  252. Returns the value of an valued event that it passed to the function as parameter.
  253. bc..
  254. myVar = valueof(myEvent)
  255. p.
  256. ==<!-- End stext_keyword_valueof -->==
  257. ==<!-- Start stext_keyword_active -->==
  258. h4. active(state)
  259. Returns "true" if a state is active or "false" otherwise.
  260. bc..
  261. myBool = active(StateA)
  262. p.
  263. ==<!-- End stext_keyword_active -->==
  264. h3. LocalReactions
  265. Local reactions describe the internal behavior of a state. So they have internal scope. A local reaction is declared as follows:
  266. bc..
  267. LocalReaction: ReactionTrigger '/' ReactionEffect ('#' ReactionProperties)?
  268. ReactionTrigger: (Event ("," Event )* (=> '[' Expression ']')?) | '[' Expression ']'
  269. ReactionEffect: Statement (';' Statement )* (';')?
  270. Statement: Assignment | EventRaising | OperationCall
  271. ReactionProperties: (EntryPoint | ExitPoint)*
  272. p. Within a local reaction an interface event can be raised:
  273. bc..
  274. internal:
  275. localEvent1 / raise NamedInterface.event3 : localOperation (valueOf(localEvent), NamedInterface.variable1);
  276. p. Local reactions can have priority values. These are defined by a following # and the integer number of priority:
  277. bc..
  278. localEvent2 / NamedInterface.variable2 += 3; #1
  279. localEvent3 / NamedInterface.variable4 += 2.0; #2
  280. p. ==<!-- Start stext_keyword_entrypoint -->==
  281. h3. EntryPoints
  282. Every state chart has an entry point. An entry point can be declared like the following:
  283. bc..
  284. entrypoint entry1
  285. p. ==<!-- End stext_keyword_entrypoint -->==
  286. ==<!-- Start stext_keyword_exitpoint -->==
  287. h3. ExitPoints
  288. Every state chart has an exit point. This exit point can be declared like the following.
  289. bc..
  290. exitpoint exit1
  291. p. ==<!-- End stext_keyword_exitpoint -->==
  292. h2. SGen Generator Features
  293. All generators can be customized with a generator model. This is a textual model file where generator features, like i.e. the outlet path, can be specified. The following screenshot shows an example configuration for the java code generator.
  294. To get started with the generator model, we included a new Eclipse wizard that creates a basic configuration file with default values.
  295. !images/sGenEditor.png!
  296. The generator model is associated with the builder. If *Project* > *Build Automatically* is checked the files are generated. In the following the specific customizing features of the generator models are explained.
  297. The following section describes the *Core Features* which are available for all code generators:
  298. ==<!-- Start sgen_feature_outlet -->==
  299. h4. Outlet
  300. The *Outlet* feature specifies the target project and folder for the generated artifacts. It is a *required* feature and consists of the following parameters:
  301. # __targetProject__ (String, required): The project to store the generated artifacts
  302. # __targetFolder__ (String, required): The folder to store the generated artifacts
  303. Example configuration:
  304. bc..
  305. feature Outlet {
  306. targetProject = "ExampleProject"
  307. targetFolder = "src-gen"
  308. }
  309. p. ==<!-- End sgen_feature_outlet -->==
  310. ==<!-- Start sgen_feature_licenseheader -->==
  311. h4. LicenseHeader
  312. The *LicenseHeader* feature specifies the license text that should be added as a header to the generated artifacts. It is an *optional* feature and consists of the following parameters:
  313. # __licenseText__ (String, required): The license text to add as a header
  314. Example configuration:
  315. bc..
  316. feature LicenseHeader {
  317. licenseText = "Copyright (c) 2012 committers of YAKINDU and others."
  318. }
  319. p. ==<!-- End sgen_feature_licenseheader -->==
  320. ==<!-- Start sgen_feature_functioninlining -->==
  321. h4. FunctionInlining
  322. The *FunctionInlining* feature allows the inlining of expressions instead of generating separate functions or methods. This might reduce the readability of the generated code, but increases performance because less operation calls are necessary.
  323. It is an *optinal* feature and consists of the following parameters:
  324. # __inlineReactions__ (Boolean, optional): Inlines the expression for reactions
  325. # __inlineEntryActions__ (Boolean, optional): Inlines the expression for entry actions
  326. # __inlineExitActions__ (Boolean, optional): Inlines the expression for exit actions
  327. # __inlineEnterSequences__ (Boolean, optional): Inlines the expression for enter sequences
  328. # __inlineExitSequences__ (Boolean, optional): Inlines the expression for exit sequences
  329. # __inlineChoices__ (Boolean, optional): Inlines the expression for choices
  330. # __inlineEnterRegion__ (Boolean, optional): Inlines the expression for enter regions
  331. # __inlineExitRegion__ (Boolean, optional): Inlines the expression for exit regions
  332. # __inlineEntries__ (Boolean, optional): Inlines the expression for entries
  333. Example configuration:
  334. bc..
  335. feature FunctionInlining {
  336. inlineChoices = false
  337. inlineEnterRegion = true
  338. inlineEntries = true
  339. }
  340. p. ==<!-- End sgen_feature_functioninlining -->==
  341. ==<!-- Start sgen_feature_debug -->==
  342. h4. Debug
  343. The *Debug* feature dumps the Execution Model to the target folder as xmi model. It is an *optional* feature and consists of the following parameters:
  344. # __dumpSexec__ (Boolean, required): The license text to add as a header
  345. Example configuration:
  346. bc..
  347. feature Debug {
  348. dumpSexec = true
  349. }
  350. p. ==<!-- End sgen_feature_debug -->==
  351. h2. Java Generator Features
  352. ==<!-- Start sgen_feature_naming -->==
  353. h4. Naming
  354. The *Naming* feature allows the configuration of package names as well as class name prefix / suffix.
  355. It is an *optional* feature and consists of the following parameters:
  356. # __basePackage__ (Boolean, required): The package to create for the generated java classes
  357. # __implementationSuffix__ (Boolean, optional): The suffix for the implementing classes
  358. Example configuration:
  359. bc..
  360. feature Naming {
  361. basePackage = "org.yakindu.sct"
  362. implementationSuffix = "Impl"
  363. }
  364. p. ==<!-- End sgen_feature_naming -->==
  365. ==<!-- Start sgen_feature_generalfeatures -->==
  366. h4. GeneralFeatures
  367. The *GeneralFeatures* feature allows to configure additional services to generate with the statemachine. Per default, all parameters are configured to __false__ It is an *optional* feature and consists of the following parameters:
  368. ==<!-- # __EventBasedStatemachine__ (Boolean, optional): Enables/disables the generation of a cycle based statemachine implementation -->==
  369. # __InterfaceObserverSupport__ (Boolean, optional): Enables/disables the generation of listener interfaces for the statemachine
  370. # __RuntimeService__ (Boolean, optional): Enables/disables the generation of a runtime service that triggers the runcycle of a cycle based statemachine
  371. # __TimerService__ (Boolean, optional): Enables/disables the generation of a timer service implementation using __java.util.Timer__
  372. ==<!-- # __GenericInterfaceSupport__ (Boolean, optional): Enables/disables the generation of generic interfaces -->==
  373. ==<!-- # __StatemachineFactorySupport__ (Boolean, optional): Enables/disables the generation of a factory class -->==
  374. Example configuration:
  375. bc..
  376. feature GeneralFeatures {
  377. InterfaceObserverSupport = true
  378. RuntimeService = true
  379. TimerService = true
  380. }
  381. p. ==<!-- End sgen_feature_generalfeatures -->==
  382. h2. C Generator Features
  383. ==<!-- Start sgen_feature_ccodefeature -->==
  384. h4. CCodeFeature
  385. The *CCodeFeature* feature allows to configure c code specific generator properties. It is an *optional* feature and consists of the following parameters:
  386. # __InterfaceEventListener__ (Boolean, mandatory): generates listener interface for notification of outgoing events.
  387. # __Singleton__ (Boolean, mandatory): generates a statically allocated singleton variant of the state machine that does not allow multiple instances.
  388. # __DebugType__ (String, optional): don't use this property - it will be removed
  389. Example configuration:
  390. bc..
  391. feature CCodeFeature {
  392. InterfaceEventListerner = true
  393. Singleton = true
  394. }
  395. p. ==<!-- End sgen_feature_ccodefeature -->==
  396. h2. Create Custom Code Generators
  397. YAKINDU Statechart Tools provides a rich feature set to supports custom code generators out of the box. These code generators can be either written in Java, "Xtend":http://www.eclipse.org/xtend/ or in "Xpand":http://www.eclipse.org/modeling/m2t/?project=xpand
  398. h3. Writing a custom code generator with Xtend2/Java
  399. First, you have to create a new Xtend2 generator project. Click *File* > *New* > *Other...* > *YAKINDU* > *YAKINDU Xtend2/Java Generator Project* to create a new Xtend2 Generator Project.
  400. !images/xtendGenerator.png!
  401. The wizards asks for a *Project name* and the name of the *Generator class*, where you have to specify a full qualified class name. If you check the *Use Xtend* checkbox, the Generator class will be initially created as an "Xtend":http://www.eclipse.org/xtend/ class. Otherwise, Java will be used for the generator.
  402. The check box *Configure for Plugin Export* adds all required extension point registrations to the new project for exporting as a plugin The Generator Model can refer to the new Generator Plugin via its unique *Generator ID*. If you want to contribute custom generator features for your code generator, check the *Create Feature Library* check box.
  403. After click on *Finish* a new project is created in your workspace. All required plugin dependencies and extension points are registered and you can start to write your code generator based on the ExecutionFlow meta model [Link].
  404. h3. Executing a custom Xtend2/Java code generator
  405. YAKINDU Statechart Tools provide a convenient way to execute your generator while you are developing it.
  406. Therefore, you have to create a new *Generator Model* with the generator id *yakindu::generic*, either by using the *New Statechart Generator Model* wizard or by simple creating a new text file with the file extension *.sgen*. the following feature allows to configure your code generator.
  407. ==<!-- Start sgen_feature_generator -->==
  408. h4. Generator
  409. The *Generator* feature allows the configuration of a custom code generator located in the workspace and written in Java or another JVM language. It is a *required* feature and consists of the following parameters:
  410. # __generatorProject__ (String, required): The name of the generator project
  411. # __generatorClass__ (String, required): The full qualified class name of the code generator class.
  412. # __configurationModule__ (String, optional): The full qualified class name for a guice module to configure the code generator
  413. Example configuration:
  414. bc..
  415. feature Generator {
  416. generatorProject = "org.yakindu.sct.mygenerator"
  417. generatorClass = "org.yakindu.sct.MyGenerator"
  418. }
  419. p. ==<!-- End sgen_feature_generator -->==
  420. h3. Executing a custom Xpand code generator
  421. to execute an xpand based custom code generator, you have to create a new *Generator Model* with the generator id *yakindu::xpand*, either by using the *New Statechart Generator Model* wizard or by simple creating a new text file with the file extension *.sgen*. the following feature allows to configure your code generator.
  422. ==<!-- Start sgen_feature_template -->==
  423. h4. Template
  424. The *Generator* feature allows the configuration of a custom code generator located in the workspace and written in Java or another JVM language. It is a *required* feature and consists of the following parameters:
  425. # __templateProject__ (String, required): The name of the generator project
  426. # __templatePath__ (String, required): The full qualified template path to the main template.
  427. Example configuration:
  428. bc..
  429. feature Template {
  430. templateProject = "ExampleProject"
  431. templatePath = "org::yakindu::sct::generator::xpand::Main::main"
  432. }
  433. p. ==<!-- End sgen_feature_template -->==