Git Product home page Git Product logo

Comments (2)

mthiede avatar mthiede commented on August 24, 2024

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.

nicoh avatar nicoh commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.