Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Adding elements to collections
[ATL] Adding elements to collections [message #82004] Thu, 22 May 2008 02:37 Go to next message
Eclipse UserFriend
Hi,

I'm almost sure this is a well documented issue somewhere, but I just
can't find it :(

I'm trying to write this matched rule:

rule Activity2Step{
from
activity : BPMN!Activity
using{
container : BPMN!Graph = activity.refImmediateComposite();
}
to
step : IM!Step
do{
if (container.oclIsTypeOf(BPMN!SubProcess)){
container.graph.vertices <-
container.graph.vertices->including(activity);
}
}
}

Long story short, there's this already existent collection called
'vertices' which I access with container.graph.vertices, and I want to add
an element to it. I know using including per se won't help, since these
collection operations don't really modify the collection. So I tried what
you're seeing, assigning the result of the including operation to the same
collection, but I get:

SEVERE: cannot set feature bpmn!Pool.vertices to value
org.eclipse.emf.ecore.impl.DynamicEObjectImpl@cc05a6 (eClass:
org.eclipse.emf.ecore.impl.EClassImpl@14a3622 (name: Activity)
(instanceClassName: null) (abstract: false, interface: false))

If you could point me in the right direction, I'd be extremely thankful.

Cheers,

-Juan
Re: [ATL] Adding elements to collections [message #82212 is a reply to message #82004] Mon, 26 May 2008 13:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

As I've been doing some research on the topic, I found the following
thread:

http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg01764.html

Apparently for this user, it did work adding elements to the collection,
however his issue was concerning the order of the elements. At the end of
the discussion they mentioned that they would change this after the user
filed a bug. Can you comment on this? I haven't found anything else :(
Re: [ATL] Adding elements to collections [message #82283 is a reply to message #82212] Mon, 26 May 2008 19:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: freddy.allilaire.univ-nantes.fr

This is a multi-part message in MIME format.
--------------010403080104010609050108
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Juan,

I'm not sure to clearly understand what you want to do.
But I think the third code snippet in the following document may help
you:
http://www.eclipse.org/m2m/atl/basicExamples_Patterns/articl e.php?file=SideEffect/index.html

There is an example with the "nameToAssignHistory" collection populated
in imperative section.

HTH.

Freddy.
OBEO

Juan Cadavid a
Re: [ATL] Adding elements to collections [message #83088 is a reply to message #82283] Fri, 30 May 2008 23:12 Go to previous message
Eclipse UserFriend
Thanks a lot Freddy! They sure are helpful. I don't know how could I have
missed them before ;_)
Previous Topic:[ATL]: Value from Stereotype's Property
Next Topic:[ATL] how to get the parent's name in UML
Goto Forum:
  


Current Time: Mon Jul 07 10:16:42 EDT 2025

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

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

Back to the top