Comments (2)
You can pass only one package into the model builder (either the module corresponding to the package or an EPackage object).
The first thing I would try is to use only one single metamodel. A model normally is an instance of one metamodel not of two metamodels. So I would put your two partial metamodels into two subpackages of one overall metamodel.
Note that you can use Ruby's open classes/modules feature to still split the metamodels into two files if you need that: Create the toplevel package in one file and add one subpackage, then open it in the other file and add the other subpackage.
If that's not possible you could try a trick: Create a new EPackage object and add the EPackage objects of your two metamodels as child packages. Then pass the toplevel EPackage object to the metamodel builder.
from rgen.
Thanks for the help. Option a) seems to work partially. The problem which remains (I guess due to my lack of Ruby knowledge) is how to reference the "Continental" wheel in the code below.
require 'rgen/model_builder'
require_relative '../generated/test'
RGen::ModelBuilder.build(TestMetaModel) do
RGen::ModelBuilder.build(TestMetaModel::WheelPackage) do
Wheel "Continental"
end
RGen::ModelBuilder.build(TestMetaModel::CarPackage) do
Car "Audi", :wheel => ["Continental"]
end
end
I guess I need to convert the wheel block in a proc, or something else?
from rgen.
Related Issues (20)
- ECoreXMLInstantiator does not recognize standard ECore datatypes HOT 2
- Adding twice the same object in a non containment relation does not work HOT 4
- Add a require 'rubygems' to lib/rgen/instantiator/abstract_xml_instantiator
- Ecore model wrong for Enum attributes HOT 2
- Please release 0.7.0 to rubygems.org HOT 1
- XMI20Serializer drags in ecore_ext HOT 6
- XMI20Serializer does not escape literal < characters
- DefaultXMLInstantiator naming error with a tag named 'File' HOT 1
- FragmentedModel#resolve should return the model instead of something random
- Override of is_a? causes degraded performance HOT 3
- Tests fail with ruby >= 2.1.5 HOT 2
- Array#to_str blows up the same way as Array#to_hash HOT 3
- latest release missing on rubygems? HOT 1
- Test failures with Ruby 3.0 HOT 1
- Attribute 'name' have to be a String
- Model equality
- Navigation HOT 2
- $VERBOSE could conflict with other modules
- Duplicate properties with the same name HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rgen.