eclipse-emf-ecore

ATL transformation rules not matching nested BPMN2 elements

淺唱寂寞╮ 提交于 2019-12-30 14:43:52
问题 I am writing an ATL translation from BPMN2 to another model. The problem is that the code does not detect any nested element. I have posted the atl code and my input here at: https://github.com/behnaaz/BPMN2ATL.git You can see from the output that the only executed rule is def2mod which has created a Reo module element in the output. If I remove the first level element in the input bpmn file then the rule mapProcess is kicked in. Also in the logs the command BPMN20!Process.allInstances()

EMF Eclipse: enumeration with custom fields (properties)

流过昼夜 提交于 2019-12-23 12:07:27
问题 Ok, so in Java this is possible: import org.eclipse.emf.common.util.Enumerator; public enum MyEnum implements Enumerator { LITERAL1(0, "Name", "Literal", "custom1", "custom2", "custom3"), LITERAL2(0, "Name", "Literal", "custom1", "custom2", "custom3"), LITERAL3(0, "Name", "Literal", "custom1", "custom2", "custom3"), LITERAL4(0, "Name", "Literal", "custom1", "custom2", "custom3"); public static final int LITERAL1_VALUE = 0; public static final int LITERAL2_VALUE = 1; public static final int

Can derived attributes be persisted and derivation disabled in Ecore and OCL?

不问归期 提交于 2019-12-22 08:55:36
问题 I want to port a legacy data format, which consists of concepts similar to Eclipse Modeling Framework (EMF) Ecore: Elements with Parameters which have different datatypes and default values. A custom-made tool lets you edit such model instances by a fancy table-based GUI. Also, a common feature for the Parameters is that a Derivation Rule can be added which specifies that the Parameter value gets computed automatically from other parameters. That also seems similar to Ecore derived Attributes

How to convert XSD to Ecore (EMF)

五迷三道 提交于 2019-12-18 16:31:32
问题 What is the best way to convert .xsd -files into .ecore -files? Is there an Eclipse plugin for that? 回答1: That's what worked for me: New -> Project... Eclipse Modeling Framework -> EMF Project Model Importers: XML Schema Model URIs : [Select xsd-File] To revalidate the .ecore-File when xsd has changed: Right-Click on .genmodel -File Reload... 回答2: If you do not want to create a new MDT project every time you want to import a schema as ECore model then there is also another way to do this: New

Where can I find a valid SVG XML Schema (for ecore generation)?

浪子不回头ぞ 提交于 2019-12-18 05:57:06
问题 I tried importing the SVG XML Schema into EMF, to obtain the SVG metamodel in ecore. However, the import failed due to the schema not being valid: indeed, svg.xsd references XMLSchema.dtd, which itself references datatypes.dtd, which does not exist! Consequently, I tried downloading the necessary files from the svg website (svg.xsd, XMLSchema.dtd, xlink.xsd, xml.xsd), and the missing datatypes.dtd, from another location. However, I keep getting many errors when validating the schema, e.g.

Why use a factory instead of 'new'?

谁说我不能喝 提交于 2019-12-14 01:42:31
问题 I am reading the book EMF: Eclipse Modeling Framework where its stated: The EMF programming model strongly encourages, but doesn’t require, the use of factories for creating objects. Instead of simply using the new operator to create [an object]... Why is the use of factories encouraged over new ? Your answer does not have to be EMF specific, as long as it has to do with Java. 回答1: You can read Effective Java Item 1: Consider static factory methods instead of constructors. It describes

GMF display diagram example

二次信任 提交于 2019-12-11 11:35:49
问题 How can I display a GMF diagram, with the file format "*.ecorediag" in Eclipse in a View? The diagram should not be editable. Is there a simple sample view that loads a diagram from say "/home/diagrams/test.ecorediag" 回答1: The GMF diagrams (including ecorediag) are rendered on the editor with the help of "org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer". So the bare minimum code to make this work DiagramGraphicalViewer viewer = new DiagramGraphicalViewer(); viewer

Converting a UML class diagram created using Papyrus into an .ecore file

断了今生、忘了曾经 提交于 2019-12-07 17:40:52
问题 Here is what I do using eclipse : Create a new Papyrus project Create a class diagram in Papyrus Create a new EMF empty project Use the EMF Generator Model to convert my .uml file (created with Papyrus) into an .ecore file Now i would like to do that in Java. I found a post here where someone is doing it from XSD. I would like to do the same thing but from UML. User565300 is using something called Xsd2Ecore but I couldn't find a Uml2Ecore. Do you guys know what eclipse is using to convert UML

How to merge EMF models programmatically in Java?

雨燕双飞 提交于 2019-12-07 03:52:13
问题 Is there a way to combine multiple Ecore models (2 or more) in a single Ecore model programmatically in Java? With all models conform to the same metamodel. In: Model1 conforming to metamodelX Model2 conforming to metamodelX model3 conforming to metamodelX model4 conforming to metamodelX model5 conforming to metamodelX Out: modelOut conforming to metamodelX and merge of Model1, Model2, model3, model4, model5 ... 回答1: There is Eclipse project for handling EMF comparing and Merging, called EMF

Create and modify ecore files and their instances from code

混江龙づ霸主 提交于 2019-12-06 15:25:01
问题 My question has two parts: 1) How can I create and/or modify and then store EMF ecore files (ecore metamodels with .ecore suffixes) from my scala/java code? 2) How can I create and/or modify an instance of an ecore file (i.e. a model conforming to an ecore metamodel) from my scala/java code? I am looking to see if there are some possible ways of doing these, other that manipulating directly their corresponding XML files using XML API's. Providing a code spinet or a reference to it is very