getting_started.html 9.4 KB

1
  1. <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body><h1 id="Gettingstarted">Getting started</h1><h2 id="Installation">Installation</h2><h3 id="Prerequisites">Prerequisites</h3><p>The <strong>Yakindu Statechart Tools 2</strong> are built upon Java and Xtext. So you need to have installed a <a href="http://www.oracle.com/technetwork/java/index.html">Java Runtime Environment</a> and Xtext installed. The easier way to get this is to install the <a href="http://xtext.itemis.com">pre configured Xtext contribution</a>.</p><p>The <strong>Yakindu Statechart Tools 2</strong> need <strong>Eclipse Indigo 3.7</strong> or higher and <strong>Xtext 2.0.1</strong> exactly (no higher) to work correctly.</p><h3 id="InstallingtheYAKINDUPlugIns">Installing the YAKINDU-Plug-Ins</h3><p>You install the Yakindu Plug-Ins from the update site: http://updates.yakindu.com/indigo/milestones. </p><ul><li>Click <strong>Help</strong> &gt; <strong>Install new software...</strong> and <strong>Add..</strong> the update site <em>Yakindu SCT2 milestones</em> - http://updates.yakindu.com/indigo/milestones/</li><li>On this update site you find two main items:<ul><li>Xtext integration utilities<ul><li>Xtext GMF integration (XGI)</li><li>Xtext JFace integration (XJI)</li><li>Yakindu Base</li></ul></li><li>Yakindu SCT 2<ul><li>Generator C</li><li>Generator Java</li><li>Yakindu SCT 2</li><li>Yakindu SCT 2 SDK</li></ul></li></ul></li></ul><p><img border="0" src="images/updatesite_4.jpg"/></p><p>The Xtext integration utilities provide Xtext functionality for Yakindu. Additionally to the base integration it also provides GMF and JFace integration. For more details check the documentation <a href="#XGI">XGI</a> and <a href="#XJI">XJI</a>.</p><p>You can select what code generators you need (Yakindu SCT 2) and if you need the Yakindu SCT2 SDK (for developers). For users only the Yakindu SCT 2 is sufficient.</p><h2 id="YakinduSCModelingperspective">Yakindu SC Modeling perspective</h2><p>For state machine modeling purposes open the Yakindu <strong>SC Modeling</strong> perspective by clicking <strong>Window</strong> &gt; <strong>Open Perspective</strong> &gt; <strong>SC Modeling</strong>. This perspective is optimized for statechart modeling. It consists of </p><ul><li><a href="PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/cnav.htm">Project Explorer</a> on the left</li><li><a href="PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/coutline.htm">Outline</a> View on the right</li><li>YAKINDU Statechart Editor at the top</li><li><a href="PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems</a> and <a href="PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/cpropview.htm">Properties View</a> at the bottom</li></ul><p><img border="0" src="images/sc_modeling_perspective.jpg"/></p><h2 id="YakinduSCSimulationperspective">Yakindu SC Simulation perspective</h2><p>To simulate a state machine use the Yakindu <strong>SC Simulation</strong> perspective by clicking <strong>Window</strong> &gt; <strong>Open Perspective</strong> &gt; <strong>SC Simulation</strong>. This perspective is optimized for simulation purposes and consists of:</p><ul><li><a href="PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/cnav.htm">Project Explorer</a> on the left</li><li><a href="PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/coutline.htm">Outline</a> view on the right top</li><li>Simulation View on the right bottom</li><li>Debug view at the top</li><li><a href="PLUGIN_ROOT/org.yakindu.sct.doc.user/help/02_Getting_Started/getting_started.html?path=0_1_5#YAKINDUStatechartEditor">YAKINDU Statechart Editor</a> at the bottom</li></ul><p><img border="0" src="images/sc_simulation_perspective.jpg"/></p><h2 id="YakinduXpandGeneratorProject">Yakindu Xpand Generator Project</h2><p>In the context of model driven software development generators play an important role. The generator transforms the model to either another model or text like code. Yakindu generators support multiple transform languages. One is Xpand. By clicking <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Other...</strong> &gt; <strong>YAKINDU Xpand Generator Project</strong> you create a project optimized for writing a generator in Xpand. For more details regarding Xpand see: <a href="&quot;PLUGINS_ROOT/org.eclipse.xpand.doc/help/index.html">Xpand documentation</a>.</p><p><img border="0" src="images/new_xpand_project_simple.jpg"/></p><p>All you need to do is to give it a speaking name and click <strong>Finish</strong>. The setting <strong>Configure for Plugin Export</strong> is an option for plugin developers.</p><p>The newly created project has a package with an Xpand starting point: the <em>Main.xpt</em>. This file the includes the needed metamodels. It has the entrance Xpand statement that iterates all states in the model and prints the names in a text file.</p><h2 id="YakinduXtend2JavaGeneratorProject">Yakindu Xtend2/Java Generator Project</h2><p>The generator that transforms the state machine model into code or documentation can be written in Xtend2 and Java. Find a detailed description on Xtend2 in the <a href="PLUGIN_ROOT/org.eclipse.xtext.doc/contents/01-Xtend_Introduction.html">Xtend2 documentation</a>. Yakindu comes with a predefined project setting for such projects. To create such a project click <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Other...</strong> &gt; <strong>YAKINDU Xtend2/Java Generator Project</strong>. </p><p><img border="0" src="images/new_java_xtend_project.jpg"/></p><p>Give the project a speaking full qualified name and name also the generator java class with a full qualified name. If you also want to use Xtend select <strong>Use Xtend</strong>. The result is a new project with an initial Xtend file and java class.</p><h2 id="YAKINDUStatechartEditor">YAKINDU Statechart Editor</h2><p>With the YAKINDU Statechart editor you create or modify state models. The editor automatically opens on .sct files. To create a new YAKINDU statechart model click <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Other...</strong> &gt; <strong>YAKINDU Statechart model</strong>. Give it a speaking name and click <strong>Finish</strong>. The newly created model opens in the statechart editor. Also the SC Modeling perspective opens.</p><p><img border="0" src="images/sc_editor_01.jpg"/></p><p>The editor consists of three parts: </p><ul><li>the graphic canvas to design the state machine</li><li>the palette on the right that owns the elements to design the state machine </li><li>a textual modeling field on the left</li></ul><p>You can use the textual modeling field to define internal behavior of states and declare events or variables. The language used here is called SText. The <a href="PLUGINS_ROOT/org.yakindu.sct.doc.user/help/concepts.html#SText">SText reference</a> explains this language.</p><p>Elements that cause problems get warning and error markers attached. For more details about the problems open the <strong>Problems View</strong>.</p><h2 id="SimulationView">Simulation View</h2><p>The simulation view is an interactive view to watch and control the state machine simulation. To get it open the simulation perspective. </p><p>Start a simulation by clicking <strong>Run</strong> &gt; <strong>Run</strong>. </p><p><img border="0" src="images/simulation_view_active.jpg"/></p><p>During the simulation in the statechart editor the active state gets a red color. The previous transition is green. The simulation view shows the events that trigger the states. You can change values here to trigger events. Beneath the table there are two clocks. One for the <em>virtual time</em> and one for the <em>real time</em> and a slider to change virtual time.</p><p>You can also select an <em>event driven</em> or <em>cycle based</em> run configuration.</p><h2 id="YAKINDUSCTNature">YAKINDU SCT Nature</h2><p>YAKINDU model projects are associated with the <strong>YAKINDU SCT nature</strong>. For general information regarding natures read the <a href="PLUGIN_ROOT/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_core_resources_natures.html">project nature documentation</a>. On projects with <strong>YAKINDU SCT nature</strong> <em>.sct</em> and <em>.sgen</em> files are automatically build and checked for problems. So you get fast feedback during editing. You can toggle the SCT nature by right clicking <strong>Configure</strong> &gt; <strong>Add</strong> or <strong>Remove YAKINDU SCT Nature</strong> on the project.</p><h2 id="XGI">XGI</h2><p>XGI is an Xtext integration for GMF (=Xtext GMF integration). Technically the statechart editor builds on the Graphical Modeling Framework (GMF). Xtext is an eclipse framework for textual modeling languages. Xtext provides comfortable functionality like <em>syntax highlighting</em>, <em>code completion</em>, <em>live validation</em> and more. XGI adds these features to SCT editor fields. The result is the following:</p><p><img border="0" src="images/sc_editor_code_completion.jpg"/> </p><h2 id="XJI">XJI</h2><p>XJI is an Xtext integration for JFace e.g. fields in the Properties View. It adds Xtext editor functionality like <em>syntax highlighting</em>, <em>code completion</em>, <em>live validation</em> and others to these fields. This can be a great help especially for new users to YAKINDU SCT.</p></body></html>