Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Flock Ecore Migration leaving dangling reference(How to remove eSuperType pointers)
Flock Ecore Migration leaving dangling reference [message #1857421] Tue, 07 February 2023 01:41 Go to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

I would like to remove a marker interface from a metamodel in a declarative fashion, so I wanted to use flock. The code below does not work, as it leaves behind dangling references shown as question marks. See Emfatic sample snippet at the bottom.

At the core of the issue seems to be that the eSuperTypes feature is not available in the normal way. I have tried to use the underlying Java method, and have been able to call it, but have not found a way to do a replacement.

Any advice on this? I know this can be done with EOL, but to me using Flock seemed a nicer approach.

Thanks!

@cascade
delete EClass when: original.name = "IdentifiedObject"


@namespace(uri="metamodel", prefix="metamodel")
package metamodel;

class Feature extends ? {
	attr String[1] name;
	attr String[1] value;
}

abstract class ArchimateModelObject extends ?, Features, Identifier, Nameable {
}


Issue as it shows when accessing the property, even if quoted:
copyMetamodelToEcore:
[epsilon.flock - fixCbcore.mig] EXCEPTION: Property 'eSuperTypes' not found in object 
[epsilon.flock - fixCbcore.mig] 	at (/home/jg/git/TOGAFBot/implementation/modelMaintenance/fixCbcore.mig@12:4-12:52)
[epsilon.flock - fixCbcore.mig] 	at (unknown@0:0-0:0)
[epsilon.flock - fixCbcore.mig] 	at (/home/jg/git/TOGAFBot/implementation/modelMaintenance/fixCbcore.mig@1:0-13:1)
[epsilon.flock - fixCbcore.mig] 

[Updated on: Tue, 07 February 2023 01:48]

Report message to a moderator

Re: Flock Ecore Migration leaving dangling reference [message #1857422 is a reply to message #1857421] Tue, 07 February 2023 02:01 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

No Message Body

[Updated on: Tue, 07 February 2023 03:41]

Report message to a moderator

Re: Flock Ecore Migration leaving dangling reference [message #1857423 is a reply to message #1857422] Tue, 07 February 2023 03:32 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Same result, this points to the list content having the wrong type.
migrate EClass {
var emfTool : new Native("org.eclipse.epsilon.emc.emf.tools.EmfTool");
emfTool.getECoreUtil().setEList(migrated.eSuperTypes, original.eSuperTypes.collect(t | t.name != "IdentifiedObject"));
}
Re: Flock Ecore Migration leaving dangling reference [message #1857424 is a reply to message #1857423] Tue, 07 February 2023 03:59 Go to previous message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Disregard, please! The code below works fine. The issue is removing the referenced type before the transform, which is the correct execution order of flock as documented.

migrate EClass {
migrated.eSuperTypes = original.eSuperTypes.select(t | t.name != "IdentifiedObject"); 
}


and then, in the pipeline:

var identifiedObjects = EClass.all().select(c | c.name = "IdentifiedObject");
for (identifiedObject: EClass in identifiedObjects){delete identifiedObject;}
Previous Topic:Customizing a GMF editor generated by Eugenia
Next Topic:EGL applied to compartments
Goto Forum:
  


Current Time: Thu Apr 25 09:24:13 GMT 2024

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

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

Back to the top