Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Bug: Flock Ant Task discards ModelRepository(The Flock ant task creates a new model repository)
Bug: Flock Ant Task discards ModelRepository [message #1856557] Thu, 15 December 2022 06:33 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

The attached sample project shows a bug for the trivial copy operation
<epsilon.flock originalmodel="source" migratedmodel="target" />

which throws the stack below. Code inspection seems to show that the constructor of the task creates a module, which leads to creation of a null context, hence a new FlockContext. The
FlockContext is an ErlContext, which is an EolContext, and adding a new EolContext always creates a new ModelRepository. This new and empty repository does not contain the source model.
flockDiscardsFactory:
[epsilon.eol - listActions.eol] Wake up, Sleep, Get up, begin
[epsilon.flock] EXCEPTION: Model 'source' not found
[epsilon.flock] 	at org.eclipse.epsilon.eol.models.ModelGroup.<init>(ModelGroup.java:43)
[epsilon.flock] 	at org.eclipse.epsilon.eol.models.ModelRepository.getModelByName(ModelRepository.java:94)
[epsilon.flock] 	at org.eclipse.epsilon.workflow.tasks.FlockTask.initialize(FlockTask.java:31)
[epsilon.flock] 	at org.eclipse.epsilon.workflow.tasks.ExecutableModuleTask.executeImpl(ExecutableModuleTask.java:256)
[epsilon.flock] 	at org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(EpsilonTask.java:42)
... elided for brevity ...

Re: Bug: Flock Ant Task discards ModelRepository [message #1856558 is a reply to message #1856557] Thu, 15 December 2022 09:35 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Jörn,

Like the rest of the Epsilon language tasks, the Flock task needs to specify the models it accesses (see below).

<epsilon.flock originalmodel="source" migratedmodel="target">
  <model ref="source"/>
  <model ref="target"/>
</epsilon.flock>


Thanks,
Dimitris

[Updated on: Thu, 15 December 2022 09:35]

Report message to a moderator

Re: Bug: Flock Ant Task discards ModelRepository [message #1856580 is a reply to message #1856558] Thu, 15 December 2022 22:34 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

Oh, thanks! Sorry for the fuss. I did not expect that at all. It seemed to me that if you mention this information, it would be implicit that you would want to use these models. Maybe that is a trivial snippet to add to the documentation.
Re: Bug: Flock Ant Task discards ModelRepository [message #1856582 is a reply to message #1856580] Thu, 15 December 2022 23:47 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

This makes sense and I've added a note in https://github.com/eclipse/epsilon-website/commit/1fa80fe7d6eadf686f9ff33bf2fdbf7e39f87562

Thanks,
Dimitris
Re: Bug: Flock Ant Task discards ModelRepository [message #1856585 is a reply to message #1856582] Fri, 16 December 2022 03:42 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

Also note that flock is restricted to using IReflectiveModel. It fails if the model is not of that type.

flockDiscardsFactory:
[epsilon.flock] EXCEPTION: Flock can only be used with models that implement IReflectiveModel. target does not.
[epsilon.flock] 	at org.eclipse.epsilon.flock.execute.context.FlockContext.wrapModel(FlockContext.java:73)
[epsilon.flock] 	at org.eclipse.epsilon.flock.execute.context.FlockContext.addAndWrapModel(FlockContext.java:62)
[epsilon.flock] 	at org.eclipse.epsilon.flock.execute.context.FlockContext.setMigratedModel(FlockContext.java:54)
[epsilon.flock] 	at org.eclipse.epsilon.workflow.tasks.FlockTask.initialize(FlockTask.java:32)
[epsilon.flock] 	at org.eclipse.epsilon.workflow.tasks.ExecutableModuleTask.executeImpl(ExecutableModuleTask.java:256)
[epsilon.flock] 	at org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(EpsilonTask.java:42)
Re: Bug: Flock Ant Task discards ModelRepository [message #1856591 is a reply to message #1856585] Fri, 16 December 2022 11:31 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Good point. Done in https://github.com/eclipse/epsilon-website/commit/b1722af8afa618109627a881c28ae73379c0732f.

Thanks,
Dimitris

[Updated on: Fri, 16 December 2022 11:32]

Report message to a moderator

Previous Topic:Generate YAML from XMI
Next Topic:Using Epsilon with CDO
Goto Forum:
  


Current Time: Thu Apr 25 09:28:01 GMT 2024

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

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

Back to the top