Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Import of enumeration type cannot be resolved in service
Import of enumeration type cannot be resolved in service [message #1842846] Fri, 02 July 2021 15:20 Go to next message
Piotr Galuszka is currently offline Piotr GaluszkaFriend
Messages: 2
Registered: July 2021
Junior Member
Hello and sorry in advance if this question is better addressed elsewhere.

I'm experimenting with the capabilities of Sirius using Obeo Designer Community.

My Ecore metamodel in particular contains an enumeration MyEnumType, which results in the generation of a src-gen/MyEnumType.java source file in the model package. This enumeration is used as a type of one of the attributes of a class in the metamodel.

Now, in my "development mode" runtime with the model instance and the viewpoint specification project (plugin), I can't import the enum. Specifically, I wanted to use it in a service that will be called from some model operations, but adding
import <model-package>.MyEnumType
to the pregenerated Services.java file yields the error: "The import <model-package>.MyEnumType cannot be resolved." Importing classes that correspond to metamodel classes and not enums works fine, as does
import <model-package>.*
but the enum type is still not resolved in this case.

I'm at a loss as all the files corresponding to classes (and not enums) in the metamodel are importing fine. I know of nothing that should prevent importing files defining enums and not regular classes, but I'm a beginner at Java and Eclipse and especially Sirius, so I would very much appreciate some help in identifying the error in my ways.
Re: Import of enumeration type cannot be resolved in service [message #1842850 is a reply to message #1842846] Fri, 02 July 2021 19:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7518
Registered: July 2009
Senior Member
Hi

Without a repro you force us to guess at what seems very strange.

Best guess is that you have confused file locations.

Regards

Ed Willink
Re: Import of enumeration type cannot be resolved in service [message #1842885 is a reply to message #1842850] Mon, 05 July 2021 07:12 Go to previous message
Piotr Galuszka is currently offline Piotr GaluszkaFriend
Messages: 2
Registered: July 2021
Junior Member
Hi,

Thank you for getting back to me so promptly. It seems that all I needed to do was restart the *underlying* Obeo instance, i.e. the one with the model plugin. (I had assumed restarting the runtime after the new files with the Enum type were in the plugin would be enough, especially since I think adding model classes earlier worked just like that (obviously after regenerating the plugins in the first instance.)
Previous Topic:Placing bordered nodes at the same location when copying a model element
Next Topic:Cascaded dialog does not allow changes
Goto Forum:
  


Current Time: Mon Oct 03 22:27:46 GMT 2022

Powered by FUDForum. Page generated in 0.02116 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top