eMoflon / emoflon-core

Core components of eMoflon
Other
5 stars 1 forks source link

Fix default GenModel #50

Closed anthonyanjorin closed 6 years ago

anthonyanjorin commented 6 years ago

Now that we have switched to creating .ecores with platform:/resource as default URI, we also have to fix our default generated genmodels to reflect this. At the moment this is not the case and the EoreEditor correctly flags this as an error (even though code generation still somehow works).

This is for example an excerpt from a genmodel (note the platform:/plugin fragments):

 <genPackages prefix="Businessrules" disposableProviderFactory="true" ecorePackage="platform:/plugin/de.upb.mbse.taxcalculationexample.businessrules/model/Businessrules.ecore#/">
    <genClasses ecoreClass="platform:/plugin/de.upb.mbse.taxcalculationexample.businessrules/model/Businessrules.ecore#//Foo"/>
  </genPackages>
RolandKluge commented 6 years ago

@anthonyanjorin The changes in https://github.com/eMoflon/emoflon-core/commit/592609459dd77658e02e12ada8e74dca777caf1a appear to incompatible with emoflon-tool. There are unresolvable proxies to Codeadapter.ecore. We need to investigate this behavior. In the meantime, I commited the old state and left you a comment ("@aanjorin").

The relevant commit is: https://github.com/eMoflon/emoflon-core/pull/55/commits/3ce6d825a068a16770548406fab4b3a5c55e464c

anthonyanjorin commented 6 years ago

Perhaps we should just have a flag in the properties file. So we can switch from platform:/resource to platform:/plugin. For emoflon-tool the value should be plugin, per default (new projects) resource.

Would that make sense?

RolandKluge commented 6 years ago

Yes, this makes sense. The default value should be "resource" until we have adapted the emoflon-tool code base.

anthonyanjorin commented 6 years ago

Hmm... how about just choosing not to replace the GenModel for the problematic Codeadapter project? This project won't be updated in the near future anyway so we could commit the GenModel and use the property flag "do not replace genmodel" to prevent regeneration. Would that solve the problem too?

RolandKluge commented 6 years ago

Unfortunately, this does not appear to be enough (at least, it is not enough to fix the Codeadapter.genmodel). In the stable repo of eMoflon Core, I have reverted your change. In the snapshot repo, it is still active. We will have to investigate this further as soon as we both have time.

Sample output in eMoflon Tool Dev. Workspace

15:55:44 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - protocol doesn't support output
15:55:45 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - Ecore file does not exist. Expected location: 'L/org.moflon.ide.visualization.dot.tgg.schema/model/Schema.ecore'
15:55:49 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - protocol doesn't support output
15:55:50 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - Ecore file does not exist. Expected location: 'L/org.moflon.ide.visualization.dot.tgg.runtimepatterns/model/Runtimepatterns.ecore'
15:55:53 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - protocol doesn't support output
15:55:54 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - Ecore file does not exist. Expected location: 'L/org.moflon.ide.visualization.dot.tgg.runtime/model/Runtime.ecore'
15:56:00 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - protocol doesn't support output
15:56:01 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - Ecore file does not exist. Expected location: 'L/org.moflon.ide.visualization.dot.tgg.delta/model/Delta.ecore'
15:56:05 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - protocol doesn't support output
15:56:06 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - Ecore file does not exist. Expected location: 'L/org.moflon.ide.visualization.dot.tgg/model/Tgg.ecore'
15:56:13 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - protocol doesn't support output
15:56:14 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - Ecore file does not exist. Expected location: 'L/org.moflon.ide.visualization.dot.sdmpatterns/model/Sdmpatterns.ecore'
15:56:17 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - protocol doesn't support output
15:56:18 ERROR [errorhandling.MultiStatusAwareErrorReporter::49] - Ecore file does not exist. Expected location: 'L/org.moflon.ide.visualization.dot.sdm/model/Sdm.ecore'
anthonyanjorin commented 6 years ago

Ahh.. I think the problem is that tgg projects generate .ecores every time they are built.

I propose we do introduce a new property (in our moflon property file) and set per default to platform:/resource.

Then we could set it to platform:/plugin to get eMoflon-tool up and running.

Come to think of it — It’s actually a pretty neat configuration option. Who knows what users of core might want to set as a URI convention.