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 Fi
Messages: 133
Registered: March 2010
Senior Member
Hi All,
I have a problem with Sequence in an imperative block.

lazy rule TinaEvent2SynchronisationComponentEvent
{
	from 
		tina_event : TinaScenarioMetaModel!Event
	to
		fiacre_event : FiacreScenarioMetaModel!SynchronisationComponentEvent
		(
			time_event <- if tina_event.time<>OclUndefined then tina_event.time else 0 endif--,
                )
	do
	{
		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
Thanks

[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 EVEILLARD
Messages: 522
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: Tue Sep 16 15:31:06 GMT 2014

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

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