Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Sequence problem
[ATL] Sequence problem [message #771976] Wed, 28 December 2011 17:31 Go to next message
Fi Fi is currently offline Fi FiFriend
Messages: 136
Registered: March 2010
Senior Member
Hi All,
I have a problem with Sequence in an imperative block.

lazy rule TinaEvent2SynchronisationComponentEvent
		tina_event : TinaScenarioMetaModel!Event
		fiacre_event : FiacreScenarioMetaModel!SynchronisationComponentEvent
			time_event <- if tina_event.time<>OclUndefined then tina_event.time else 0 endif--,
		fiacre_event.followed <- fiacre_event.followed->union(tina_event.getFiacreLieTransitionFromTinaEvent().processID->collect(c| thisModule.FiacreTransition2SynchronisationProcessEvent(c,fiacre_event,tina_event)));
		fiacre_event.followed->size().debug('intial size');
		thisModule.sequence <- fiacre_event.followed->select(a|a.oclIsTypeOf(FiacreScenarioMetaModel!SynchronisationProcessEvent));
		thisModule.sequence->size().debug('sequence size');
		fiacre_event.followed <- fiacre_event.followed->union(thisModule.sequence);
		fiacre_event.followed->size().debug('final size');

helper def : sequence : Sequence(FiacreScenario!Event) = Sequence{};

the Console shows
intial size: 4
sequence size: 2
final size: 4

I don't Understand why the final size is not 6 (4+2) after union operator

PLZ help me

[Updated on: Wed, 28 December 2011 19:21]

Report message to a moderator

Re: [ATL] Sequence problem [message #773667 is a reply to message #771976] Mon, 02 January 2012 08:27 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 532
Registered: July 2009
Senior Member
You have duplicates in your collection, but your meta-model probably don't allow duplicates.
Check the "unique" property on your eReference followed.
Previous Topic:[ATL] ATL transformation in a plugin involving profiles
Next Topic:[ATL] ATL vs XSLT
Goto Forum:

Current Time: Sat Nov 28 04:22:26 GMT 2015

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

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