Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Sequence problem
[ATL] Sequence problem [message #771976] Wed, 28 December 2011 12:31 Go to next message
Eclipse UserFriend
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 14:21] by Moderator

Re: [ATL] Sequence problem [message #773667 is a reply to message #771976] Mon, 02 January 2012 03:27 Go to previous message
Eclipse UserFriend
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 Apr 29 18:40:24 EDT 2025

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

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

Back to the top