项目作者: Xennis

项目描述 :
Example usage of Eclipse EMF, Graphiti, Spray and MOFScript
高级语言:
项目地址: git://github.com/Xennis/graphical_model_editor.git
创建时间: 2014-04-15T15:31:52Z
项目社区:https://github.com/Xennis/graphical_model_editor

开源协议:

下载


Graphical model editor

Used software

Getting started

  • Start Eclipse Modeling Tools IDE
  • Import org.example.demo.activitydiagram and org.example.demo.activitydiagram.ad_editor into Eclipse

Generate code

  • Open the org.example.demo.activitydiagram/model/activitydiagram_model.genmodel file
  • Rightclick on Activitydiagram_model > Generate Model Code

Run the editor

  • Run org.example.demo.activitydiagram.ad_editor as Eclipse Application
  • Import DemoActivityDiagramEditor

Transform the diagram to text

  • Open the DemoActivityDiagramEditor\MOFScript\ActivityDiagramEditor.m2t file
  • Click the run button and choose as source code model the DemoActivityDiagramEditor/model folder

Illustration

With the editor you can create activity diagrams like the following:

Demo_ActivityDiagramEditor

These diagrams are base on the underlying model, which is defined in the EMF Project:

Ecore_diagram_file_-_Activity_diagram

With the included MOFScript it is possible to transform the above activity diagram to text:

  1. ******************* Start *******************
  2. STATE: StartState
  3. TRANISTION: name:'', from:StartState(''), to:ActionState('View list of travel destinations')
  4. TRANISTION: name:'', from:ActionState('View list of travel destinations'), to:DecisionState('Share travel link')
  5. TRANISTION: name:'no', from:DecisionState('Share travel link'), to:EndState('')
  6. TRANISTION: name:'yes', from:DecisionState('Share travel link'), to:ActionState('Compose email and send')
  7. TRANISTION: name:'', from:ActionState('Compose email and send'), to:EndState('')
  8. TRANISTION: name:'', from:ActionState('Book travel'), to:EndState('')
  9. ******************* End *******************