Git Product home page Git Product logo

Comments (2)

aranega avatar aranega commented on August 29, 2024

Hi @ewoudwerkman

The issue here comes from PyEcore, I forgot to register an Ecore datatype as classifier in the core (the ELong type...). I'm really sorry about that...

There is a way of patching the code and launching the generation by code. I made the test and everything works fine. Here is the code I used:

from pyecore.resources import ResourceSet
import pyecore.ecore as ecore
from pyecoregen.ecore import EcoreGenerator


def register_missing_type():
    ecore.Core.register_classifier(ecore.ELong)  # here is the missing type registration


def generate_code(folder='.', ecore_path=None):
    rset = ResourceSet()
    uml_root = rset.get_resource(ecore_path).contents[0]
    generator = EcoreGenerator()
    generator.generate(uml_root, folder)


if __name__ == '__main__':
    register_missing_type()
    generate_code(ecore_path='esdl.ecore', folder='gen')  # change the path to your .ecore metamodel here

I will patch this on PyEcore asap. Again, sorry about that... Tell me if this snippet works for you!

from pyecoregen.

ewoudwerkman avatar ewoudwerkman commented on August 29, 2024

Hi @aranega,

That is a fast reply! And it works, it generates the classes.
Thanks for your help!

Kind regards,
Ewoud

from pyecoregen.

Related Issues (14)

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.