Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Emphatic metamodel - Dynamic "attr" for "class"(On-demand number of class attributes)
Emphatic metamodel - Dynamic "attr" for "class" [message #1858568] Sat, 08 April 2023 04:19 Go to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 101
Registered: August 2019
Senior Member
Hi there,

In the Filesystem metamodel [1], would it be possible to code a dynamic attribute called "creator"? By dynamic, I mean, for example, a given file might have only one creator, but other files might have two or three creators. Could I code such an "attr" as reliant upon the user's choice somehow, or do I necessarily have to code a certain amount of "creator" attributes explicitly like "creator1", "creator2", etc.?

ORIGINAL CODE

@gmf.node(label = "name")
class File {
attr String name;
}

FIXED-NUMBER SOLUTION

@gmf.node(label = "name")
class File {
attr String name;
attr String creator1;
attr String creator2;
attr String creator3;
}

DESIRED SOLUTION

@gmf.node(label = "name")
class File {
attr String name;
attr (?) String creator; // It's up to the model user the number of creators
}

Thank you.


[1] https://www.eclipse.org/epsilon/doc/eugenia/
Re: Emphatic metamodel - Dynamic "attr" for "class" [message #1858571 is a reply to message #1858568] Sat, 08 April 2023 11:29 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

attr String[*] creators; should do the trick.

Thanks,
Dimitris
Emphatic metamodel - Dynamic "attr" for "class" [message #1858574 is a reply to message #1858571] Sun, 09 April 2023 01:43 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 101
Registered: August 2019
Senior Member
It works, Dimitris, many thanks!

I'd like to move a bit further, if possible.

Would it be possible to set up the field "Value" of the property "Creators" to be a sort of drop-down list?

The list options, rather than pre-defined, should automatically be the ".filesystem" files inside the "Filesystem" folder.

In the example below, such a drop-down list would contain "default.filesystem" only, but there could be other ".filesystem" files like "default2.filesystem". "default3.filesystem", etc.

index.php/fa/43095/0/

Thanks again!

Re: Emphatic metamodel - Dynamic "attr" for "class" [message #1858587 is a reply to message #1858574] Mon, 10 April 2023 13:32 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

There's no support for this in Eugenia I'm afraid. This should be possible to achieve if you are prepared to edit the generated GMF code but that's about as much advice as I can offer I'm afraid.

Thanks,
Dimitris
Emphatic metamodel - Dynamic "attr" for "class" [message #1858605 is a reply to message #1858587] Tue, 11 April 2023 09:06 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 101
Registered: August 2019
Senior Member
Thank you for your reply, Dimitris.

Could you please tell me how I could find such a generated GMF code file? Does it have a standard name or path?

Thanks again.
Re: Emphatic metamodel - Dynamic "attr" for "class" [message #1858665 is a reply to message #1858605] Fri, 14 April 2023 07:50 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

All the generated GMF code should be under the plugin project with the name ending in ".diagram" in your workspace. Unfortunately, I cannot provide any more specific pointers within that project.

Thanks,
Dimitris
Previous Topic:Flock migration sequence
Next Topic:ATL to ETL transformation
Goto Forum:
  


Current Time: Sat Apr 27 08:38:14 GMT 2024

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

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

Back to the top