1

Resolved

EcoreInterop test doesn't work

description

Hi,
I try to run the test with the NMeta.ecore but breaks on line 88 of TransformationRule:
   public virtual TOut CreateOutput(TIn input, ITransformationContext context)    
  {
        if (!OutputType.IsInterface && !OutputType.IsAbstract)
        {
            return Activator.CreateInstance(OutputType) as TOut;
        }
        else
        {
HERE:            throw new NotImplementedException();
        }
    }

Do you have other .ecore to test? thank you

comments

georghinkel wrote Mar 24, 2015 at 9:22 AM

Hi and welcome to NMF!

I haven't kept the NMeta.ecore updated for a while, to be honest. Eventually I started to insert documentation which EcoreInterop does not yet support, so I edited the NMeta.nmf directly. I will try to reproduce the issue this afternoon or evening.

In the meantime, can you provide a stacktrace?

Cheers,

Georg Hinkel

wrote Mar 26, 2015 at 3:30 PM

georghinkel wrote Mar 26, 2015 at 4:08 PM

Fixed. The problem was that the NMeta classes have been changed to interfaces in the recent past and the transformation engine could not handle it. Now the interfaces have an attribute that declare their default type and the Ecore2Code runs correctly - which means that it doesn't generate anything for NMeta.ecore because these classes are already contained in NMF.Models.dll and can therefore simply be referenced. This option was added to the code generator in order to prevent it from generating code for existing assemblies over and over again. The fact that the classes already have been created is determined based on the namespace and the registration of the NMF.Models.dll having an assembly attribute ModelMetadata set appropriately.

However, feel free to try any the code generator with any metamodel of the AtlanMod metamodel zoo http://www.emn.fr/z-info/atlanmod/index.php/Ecore.