Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] How to create o Sequence / Collection of model elements
[ATL] How to create o Sequence / Collection of model elements [message #41617] Fri, 25 May 2007 12:36 Go to next message
Eclipse UserFriend
Originally posted by: erik_becker.gmx.de

Hi all,

I'm new to ATL and fighting with it's peculiarities. ;-)

I want to create a collection (Sequence) of special elements from a XML.
Therefore I wrote this helper:

helper def : getModels : Sequence(XML!Element) =
let allModels : Sequence(XML!Element) =
XML!Element.allInstances()->asSequence() in
allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
if model.name = 'Model'
then
ms.append(m)
else
''
endif
);

If I use this helper (just printing the sequence's size with output) I
get the following:
****** BEGIN Stack Trace
message: ERROR: could not find operation append on String having
supertypes: [OclAny]
A.main() : ??#22 null
local variables = {self=aml2xpdl : ASMModule}
local stack = []
A.__initgetModels() : ??#23 8:46-8:66
local variables = {model=IN!Model, models='', self=aml2xpdl :
ASMModule, allModels=Sequence {IN!LogFont, IN!FontNode,
IN!FontStyleSheet, IN!AttrDef, IN!ObjDef, IN!Brush, IN!Size,
IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrDef,
IN!Brush, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrDef,
IN!FontNode, IN!FontStyleSheet, IN!AttrValue, IN!AttrValue, IN!FontNode,
IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!FontNode, IN!ObjDef,
IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID, IN!Lane, IN!AttrOcc,
IN!Pen, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen, IN!FontNode,
IN!AttrValue, IN!AttrDef, IN!FontNode, IN!CxnOcc, IN!FontStyleSheet,
IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!ObjDef, IN!AttrDef,
IN!Position, IN!Size, IN!AttrValue, IN!FontStyleSheet, IN!AttrValue,
IN!Pen, IN!GUID, IN!AttrValue, IN!CxnOcc, IN!GUID, IN!Pen, IN!CxnOcc,
IN!Position, IN!Size, IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue,
IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrValue, IN!FontNode,
IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrValue, IN!ObjDef,
IN!Flag, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrDef,
IN!CxnDef, IN!AttrDef, IN!AML, IN!ObjOcc, IN!Size, IN!Position,
IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrValue,
IN!Position, IN!AttrDef, IN!Pen, IN!Model, IN!AttrValue, IN!CxnOcc,
IN!FontStyleSheet, IN!Position, IN!Pen, IN!AttrValue, IN!AttrDef,
IN!Position, IN!AttrDef, IN!FontStyleSheet, IN!AttrValue, IN!AttrValue,
IN!AttrValue, IN!Brush, IN!ObjOcc, IN!AttrDef, IN!CxnDef, IN!GUID,
IN!ObjOcc, IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!Position,
IN!FontNode, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef,
IN!AttrDef, IN!GUID, IN!AttrDef, IN!Pen, IN!AttrValue, IN!AttrDef,
IN!AttrValue, IN!Position, IN!FontStyleSheet, IN!FontStyleSheet,
IN!GUID, IN!FontNode, IN!AttrValue, IN!AttrValue, IN!Position,
IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!AttrValue, IN!GUID,
IN!FontStyleSheet, IN!FontNode, IN!CxnOcc, IN!AttrValue, IN!AttrDef,
IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue, IN!Brush, IN!AttrDef,
IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!Size, IN!Pen, IN!ObjOcc,
IN!AttrDef, IN!GUID, IN!FontNode, IN!Size, IN!GUID, IN!GUID,
IN!Position, IN!FontStyleSheet, IN!FontStyleSheet, IN!AttrValue,
IN!AttrDef, IN!CxnDef, IN!CxnDef, IN!Brush, IN!AttrValue, IN!Position,
IN!AttrDef, IN!AttrDef, IN!Position, IN!ObjDef, IN!Size, IN!AttrValue,
IN!AttrValue, IN!AttrValue, IN!GUID, IN!AttrDef, IN!AttrValue,
IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!FontNode, IN!AttrValue,
IN!AttrValue, IN!Pen, IN!AttrValue, IN!FontNode, IN!Brush, IN!ObjDef,
IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!AttrOcc, IN!AttrValue,
IN!AttrDef, IN!GUID, IN!GUID, IN!AttrDef, IN!GUID, IN!Position, IN!GUID,
IN!AttrDef, IN!Pen, IN!ObjDef, IN!Position, IN!AttrDef, IN!AttrDef,
IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrValue,
IN!AttrValue, IN!Language, IN!AttrValue, IN!AttrValue, IN!AttrOcc,
IN!AttrValue, IN!FontNode, IN!FontNode, IN!FontNode, IN!AttrValue,
IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush,
IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!Position, IN!AttrDef, IN!AttrDef,
IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue, IN!FontNode,
IN!FontNode, IN!FontNode, IN!Position, IN!AttrValue, IN!AttrValue,
IN!GUID, IN!ObjOcc, IN!CxnDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
IN!Position, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue,
IN!Header-Info, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
IN!AttrValue, IN!FontNode, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!Pen,
IN!Position, IN!AttrDef, IN!GUID, IN!GUID, IN!Brush, IN!FontStyleSheet,
IN!AttrDef, IN!ObjOcc, IN!FontNode, IN!Pen, IN!AttrValue, IN!AttrValue,
IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!GUID,
IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrDef,
IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!CxnOcc, IN!GUID,
IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef, IN!FontStyleSheet,
IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef,
IN!AttrDef, IN!GUID, IN!AttrDef, IN!FontNode, IN!AttrOcc, IN!Lane,
IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID,
IN!AttrValue, IN!ObjOcc, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef,
IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef,
IN!AttrDef, IN!GUID, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
IN!AttrValue, IN!GUID, IN!Pen, IN!AttrValue, IN!GUID, IN!AttrValue,
IN!AttrValue, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!AttrValue,
IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrValue,
IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrValue, IN!CxnDef,
IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!AttrDef, IN!AttrValue,
IN!AttrValue, IN!ObjDef, IN!Pen, IN!AttrDef, IN!Position, IN!Size,
IN!AttrOcc, IN!AttrDef, IN!GUID, IN!GUID, IN!AttrValue, IN!AttrDef,
IN!AttrValue, IN!AttrDef, IN!CxnOcc, IN!AttrDef, IN!FontStyleSheet,
IN!AttrValue, IN!CxnOcc, IN!Position, IN!Group, IN!AttrDef, IN!GUID,
IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef,
IN!AttrDef, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!GUID,
IN!Position, IN!FontNode, IN!AttrValue, IN!AttrDef, IN!Size, IN!GUID,
IN!AttrValue, IN!GUID, IN!GUID, IN!AttrDef, IN!AttrValue, IN!Position,
IN!AttrDef, IN!AttrDef, IN!CxnDef, IN!Pen, IN!AttrValue, IN!AttrValue,
IN!Pen, IN!FontStyleSheet, IN!AttrDef, IN!FontNode, IN!Position,
IN!FontStyleSheet, IN!AttrValue, IN!FontNode, IN!ObjOcc, IN!AttrValue,
IN!LanguageName, IN!GUID, IN!AttrOcc, IN!Database, IN!AttrDef,
IN!CxnDef, IN!AttrDef, IN!CxnOcc, IN!FontStyleSheet, IN!AttrValue,
IN!GUID, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen,
IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID,
IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush, IN!Pen,
IN!GUID, IN!AttrValue, IN!Position}}
local stack = [aml2xpdl : ASMModule]
****** END Stack Trace
Execution terminated due to error (see launch configuration to allow
continuation after errors).

Can anyone help? I can't find what's wrong.

Thanks and Greetings

Erik
Re: [ATL] How to create o Sequence / Collection of model elements [message #41669 is a reply to message #41617] Fri, 25 May 2007 12:52 Go to previous messageGo to next message
Ã?ric Vépa is currently offline Ã?ric VépaFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Erik,

What is 'model' used at line "if model.name = 'Model'" ?

Erik Becker wrote:
> Hi all,
>
> I'm new to ATL and fighting with it's peculiarities. ;-)
>
> I want to create a collection (Sequence) of special elements from a XML.
> Therefore I wrote this helper:
>
> helper def : getModels : Sequence(XML!Element) =
> let allModels : Sequence(XML!Element) =
> XML!Element.allInstances()->asSequence() in
> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
> if model.name = 'Model'
> then
> ms.append(m)
> else
> ''
> endif
> );
>
> If I use this helper (just printing the sequence's size with output) I
> get the following:
> ****** BEGIN Stack Trace
> message: ERROR: could not find operation append on String having
> supertypes: [OclAny]
> A.main() : ??#22 null
> local variables = {self=aml2xpdl : ASMModule}
> local stack = []
> A.__initgetModels() : ??#23 8:46-8:66
> local variables = {model=IN!Model, models='', self=aml2xpdl :
> ASMModule, allModels=Sequence {IN!LogFont, IN!FontNode,
> IN!FontStyleSheet, IN!AttrDef, IN!ObjDef, IN!Brush, IN!Size,
> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrDef,
> IN!Brush, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrDef,
> IN!FontNode, IN!FontStyleSheet, IN!AttrValue, IN!AttrValue, IN!FontNode,
> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!FontNode, IN!ObjDef,
> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID, IN!Lane, IN!AttrOcc,
> IN!Pen, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen, IN!FontNode,
> IN!AttrValue, IN!AttrDef, IN!FontNode, IN!CxnOcc, IN!FontStyleSheet,
> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!ObjDef, IN!AttrDef,
> IN!Position, IN!Size, IN!AttrValue, IN!FontStyleSheet, IN!AttrValue,
> IN!Pen, IN!GUID, IN!AttrValue, IN!CxnOcc, IN!GUID, IN!Pen, IN!CxnOcc,
> IN!Position, IN!Size, IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue,
> IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrValue, IN!FontNode,
> IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrValue, IN!ObjDef,
> IN!Flag, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrDef,
> IN!CxnDef, IN!AttrDef, IN!AML, IN!ObjOcc, IN!Size, IN!Position,
> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrValue,
> IN!Position, IN!AttrDef, IN!Pen, IN!Model, IN!AttrValue, IN!CxnOcc,
> IN!FontStyleSheet, IN!Position, IN!Pen, IN!AttrValue, IN!AttrDef,
> IN!Position, IN!AttrDef, IN!FontStyleSheet, IN!AttrValue, IN!AttrValue,
> IN!AttrValue, IN!Brush, IN!ObjOcc, IN!AttrDef, IN!CxnDef, IN!GUID,
> IN!ObjOcc, IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!Position,
> IN!FontNode, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef,
> IN!AttrDef, IN!GUID, IN!AttrDef, IN!Pen, IN!AttrValue, IN!AttrDef,
> IN!AttrValue, IN!Position, IN!FontStyleSheet, IN!FontStyleSheet,
> IN!GUID, IN!FontNode, IN!AttrValue, IN!AttrValue, IN!Position,
> IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!AttrValue, IN!GUID,
> IN!FontStyleSheet, IN!FontNode, IN!CxnOcc, IN!AttrValue, IN!AttrDef,
> IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue, IN!Brush, IN!AttrDef,
> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!Size, IN!Pen, IN!ObjOcc,
> IN!AttrDef, IN!GUID, IN!FontNode, IN!Size, IN!GUID, IN!GUID,
> IN!Position, IN!FontStyleSheet, IN!FontStyleSheet, IN!AttrValue,
> IN!AttrDef, IN!CxnDef, IN!CxnDef, IN!Brush, IN!AttrValue, IN!Position,
> IN!AttrDef, IN!AttrDef, IN!Position, IN!ObjDef, IN!Size, IN!AttrValue,
> IN!AttrValue, IN!AttrValue, IN!GUID, IN!AttrDef, IN!AttrValue,
> IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!FontNode, IN!AttrValue,
> IN!AttrValue, IN!Pen, IN!AttrValue, IN!FontNode, IN!Brush, IN!ObjDef,
> IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!AttrOcc, IN!AttrValue,
> IN!AttrDef, IN!GUID, IN!GUID, IN!AttrDef, IN!GUID, IN!Position, IN!GUID,
> IN!AttrDef, IN!Pen, IN!ObjDef, IN!Position, IN!AttrDef, IN!AttrDef,
> IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrValue,
> IN!AttrValue, IN!Language, IN!AttrValue, IN!AttrValue, IN!AttrOcc,
> IN!AttrValue, IN!FontNode, IN!FontNode, IN!FontNode, IN!AttrValue,
> IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush,
> IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!Position, IN!AttrDef, IN!AttrDef,
> IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue, IN!FontNode,
> IN!FontNode, IN!FontNode, IN!Position, IN!AttrValue, IN!AttrValue,
> IN!GUID, IN!ObjOcc, IN!CxnDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
> IN!Position, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
> IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue,
> IN!Header-Info, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
> IN!AttrValue, IN!FontNode, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!Pen,
> IN!Position, IN!AttrDef, IN!GUID, IN!GUID, IN!Brush, IN!FontStyleSheet,
> IN!AttrDef, IN!ObjOcc, IN!FontNode, IN!Pen, IN!AttrValue, IN!AttrValue,
> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!GUID,
> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrDef,
> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!CxnOcc, IN!GUID,
> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef, IN!FontStyleSheet,
> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef,
> IN!AttrDef, IN!GUID, IN!AttrDef, IN!FontNode, IN!AttrOcc, IN!Lane,
> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID,
> IN!AttrValue, IN!ObjOcc, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef,
> IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef,
> IN!AttrDef, IN!GUID, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
> IN!AttrValue, IN!GUID, IN!Pen, IN!AttrValue, IN!GUID, IN!AttrValue,
> IN!AttrValue, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!AttrValue,
> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrValue,
> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrValue, IN!CxnDef,
> IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!AttrDef, IN!AttrValue,
> IN!AttrValue, IN!ObjDef, IN!Pen, IN!AttrDef, IN!Position, IN!Size,
> IN!AttrOcc, IN!AttrDef, IN!GUID, IN!GUID, IN!AttrValue, IN!AttrDef,
> IN!AttrValue, IN!AttrDef, IN!CxnOcc, IN!AttrDef, IN!FontStyleSheet,
> IN!AttrValue, IN!CxnOcc, IN!Position, IN!Group, IN!AttrDef, IN!GUID,
> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef,
> IN!AttrDef, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!GUID,
> IN!Position, IN!FontNode, IN!AttrValue, IN!AttrDef, IN!Size, IN!GUID,
> IN!AttrValue, IN!GUID, IN!GUID, IN!AttrDef, IN!AttrValue, IN!Position,
> IN!AttrDef, IN!AttrDef, IN!CxnDef, IN!Pen, IN!AttrValue, IN!AttrValue,
> IN!Pen, IN!FontStyleSheet, IN!AttrDef, IN!FontNode, IN!Position,
> IN!FontStyleSheet, IN!AttrValue, IN!FontNode, IN!ObjOcc, IN!AttrValue,
> IN!LanguageName, IN!GUID, IN!AttrOcc, IN!Database, IN!AttrDef,
> IN!CxnDef, IN!AttrDef, IN!CxnOcc, IN!FontStyleSheet, IN!AttrValue,
> IN!GUID, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen,
> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID,
> IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush, IN!Pen,
> IN!GUID, IN!AttrValue, IN!Position}}
> local stack = [aml2xpdl : ASMModule]
> ****** END Stack Trace
> Execution terminated due to error (see launch configuration to allow
> continuation after errors).
>
> Can anyone help? I can't find what's wrong.
>
> Thanks and Greetings
>
> Erik


--
Éric Vépa

SODIUS
6, rue de Cornouaille - BP 91941
44319 Nantes, France
Email: evepa@sodius.com

www.mdworkbench.com
Draw more value from your models
Re: [ATL] How to create o Sequence / Collection of model elements [message #41700 is a reply to message #41669] Fri, 25 May 2007 13:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: erik_becker.gmx.de

Hello,

model is 'm' and should be the 'iterator'.
This was a mistake in my posting, that happened while replacing 'model'
by 'm'. Sorry! In my transformation file it's correct and looks as followed:

helper def : getModels : Sequence(XML!Element) =
let allModels : Sequence(XML!Element) =
XML!Element.allInstances()->asSequence() in
allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
if m.name = 'Model'
then
ms.append(m)
else
''
endif
);

Now any idea why it doesn't work?

Greetings

Erik

Éric Vépa schrieb:
> Hi Erik,
>
> What is 'model' used at line "if model.name = 'Model'" ?
>
> Erik Becker wrote:
>> Hi all,
>>
>> I'm new to ATL and fighting with it's peculiarities. ;-)
>>
>> I want to create a collection (Sequence) of special elements from a
>> XML. Therefore I wrote this helper:
>>
>> helper def : getModels : Sequence(XML!Element) =
>> let allModels : Sequence(XML!Element) =
>> XML!Element.allInstances()->asSequence() in
>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>> if model.name = 'Model'
>> then
>> ms.append(m)
>> else
>> ''
>> endif
>> );
>>
>> If I use this helper (just printing the sequence's size with output) I
>> get the following:
>> ****** BEGIN Stack Trace
>> message: ERROR: could not find operation append on String having
>> supertypes: [OclAny]
>> A.main() : ??#22 null
>> local variables = {self=aml2xpdl : ASMModule}
>> local stack = []
>> A.__initgetModels() : ??#23 8:46-8:66
>> local variables = {model=IN!Model, models='', self=aml2xpdl :
>> ASMModule, allModels=Sequence {IN!LogFont, IN!FontNode,
>> IN!FontStyleSheet, IN!AttrDef, IN!ObjDef, IN!Brush, IN!Size,
>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>> IN!AttrDef, IN!Brush, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrValue,
>> IN!AttrDef, IN!FontNode, IN!FontStyleSheet, IN!AttrValue,
>> IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrDef, IN!AttrValue,
>> IN!FontNode, IN!ObjDef, IN!AttrValue, IN!AttrValue, IN!AttrDef,
>> IN!GUID, IN!Lane, IN!AttrOcc, IN!Pen, IN!FontStyleSheet, IN!AttrDef,
>> IN!AttrDef, IN!Pen, IN!FontNode, IN!AttrValue, IN!AttrDef,
>> IN!FontNode, IN!CxnOcc, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef,
>> IN!AttrValue, IN!AttrDef, IN!ObjDef, IN!AttrDef, IN!Position, IN!Size,
>> IN!AttrValue, IN!FontStyleSheet, IN!AttrValue, IN!Pen, IN!GUID,
>> IN!AttrValue, IN!CxnOcc, IN!GUID, IN!Pen, IN!CxnOcc, IN!Position,
>> IN!Size, IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue, IN!AttrDef,
>> IN!Position, IN!AttrValue, IN!AttrValue, IN!FontNode, IN!AttrValue,
>> IN!GUID, IN!FontStyleSheet, IN!AttrValue, IN!ObjDef, IN!Flag, IN!GUID,
>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!CxnDef,
>> IN!AttrDef, IN!AML, IN!ObjOcc, IN!Size, IN!Position, IN!AttrDef,
>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!Position,
>> IN!AttrDef, IN!Pen, IN!Model, IN!AttrValue, IN!CxnOcc,
>> IN!FontStyleSheet, IN!Position, IN!Pen, IN!AttrValue, IN!AttrDef,
>> IN!Position, IN!AttrDef, IN!FontStyleSheet, IN!AttrValue,
>> IN!AttrValue, IN!AttrValue, IN!Brush, IN!ObjOcc, IN!AttrDef,
>> IN!CxnDef, IN!GUID, IN!ObjOcc, IN!AttrValue, IN!AttrDef, IN!CxnDef,
>> IN!Position, IN!FontNode, IN!AttrDef, IN!AttrDef, IN!AttrValue,
>> IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef, IN!Pen, IN!AttrValue,
>> IN!AttrDef, IN!AttrValue, IN!Position, IN!FontStyleSheet,
>> IN!FontStyleSheet, IN!GUID, IN!FontNode, IN!AttrValue, IN!AttrValue,
>> IN!Position, IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!AttrValue,
>> IN!GUID, IN!FontStyleSheet, IN!FontNode, IN!CxnOcc, IN!AttrValue,
>> IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue, IN!Brush,
>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!Size, IN!Pen,
>> IN!ObjOcc, IN!AttrDef, IN!GUID, IN!FontNode, IN!Size, IN!GUID,
>> IN!GUID, IN!Position, IN!FontStyleSheet, IN!FontStyleSheet,
>> IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!CxnDef, IN!Brush,
>> IN!AttrValue, IN!Position, IN!AttrDef, IN!AttrDef, IN!Position,
>> IN!ObjDef, IN!Size, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!GUID,
>> IN!AttrDef, IN!AttrValue, IN!AttrOcc, IN!AttrDef, IN!AttrValue,
>> IN!FontNode, IN!AttrValue, IN!AttrValue, IN!Pen, IN!AttrValue,
>> IN!FontNode, IN!Brush, IN!ObjDef, IN!AttrDef, IN!FontStyleSheet,
>> IN!AttrDef, IN!AttrOcc, IN!AttrValue, IN!AttrDef, IN!GUID, IN!GUID,
>> IN!AttrDef, IN!GUID, IN!Position, IN!GUID, IN!AttrDef, IN!Pen,
>> IN!ObjDef, IN!Position, IN!AttrDef, IN!AttrDef, IN!Pen, IN!AttrValue,
>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Language,
>> IN!AttrValue, IN!AttrValue, IN!AttrOcc, IN!AttrValue, IN!FontNode,
>> IN!FontNode, IN!FontNode, IN!AttrValue, IN!AttrDef, IN!GUID,
>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush, IN!AttrDef,
>> IN!AttrDef, IN!AttrDef, IN!Position, IN!AttrDef, IN!AttrDef,
>> IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue, IN!FontNode,
>> IN!FontNode, IN!FontNode, IN!Position, IN!AttrValue, IN!AttrValue,
>> IN!GUID, IN!ObjOcc, IN!CxnDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>> IN!Position, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
>> IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue,
>> IN!Header-Info, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
>> IN!AttrValue, IN!FontNode, IN!AttrDef, IN!AttrValue, IN!AttrDef,
>> IN!Pen, IN!Position, IN!AttrDef, IN!GUID, IN!GUID, IN!Brush,
>> IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!FontNode, IN!Pen,
>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>> IN!AttrValue, IN!GUID, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>> IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!CxnOcc,
>> IN!GUID, IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef,
>> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
>> IN!FontNode, IN!AttrOcc, IN!Lane, IN!AttrDef, IN!AttrDef,
>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue,
>> IN!ObjOcc, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!Pen,
>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>> IN!GUID, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
>> IN!AttrValue, IN!GUID, IN!Pen, IN!AttrValue, IN!GUID, IN!AttrValue,
>> IN!AttrValue, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!AttrValue,
>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrValue,
>> IN!CxnDef, IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!AttrDef,
>> IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!Pen, IN!AttrDef,
>> IN!Position, IN!Size, IN!AttrOcc, IN!AttrDef, IN!GUID, IN!GUID,
>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!CxnOcc,
>> IN!AttrDef, IN!FontStyleSheet, IN!AttrValue, IN!CxnOcc, IN!Position,
>> IN!Group, IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>> IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!FontStyleSheet,
>> IN!AttrDef, IN!GUID, IN!Position, IN!FontNode, IN!AttrValue,
>> IN!AttrDef, IN!Size, IN!GUID, IN!AttrValue, IN!GUID, IN!GUID,
>> IN!AttrDef, IN!AttrValue, IN!Position, IN!AttrDef, IN!AttrDef,
>> IN!CxnDef, IN!Pen, IN!AttrValue, IN!AttrValue, IN!Pen,
>> IN!FontStyleSheet, IN!AttrDef, IN!FontNode, IN!Position,
>> IN!FontStyleSheet, IN!AttrValue, IN!FontNode, IN!ObjOcc, IN!AttrValue,
>> IN!LanguageName, IN!GUID, IN!AttrOcc, IN!Database, IN!AttrDef,
>> IN!CxnDef, IN!AttrDef, IN!CxnOcc, IN!FontStyleSheet, IN!AttrValue,
>> IN!GUID, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen,
>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID,
>> IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush, IN!Pen,
>> IN!GUID, IN!AttrValue, IN!Position}}
>> local stack = [aml2xpdl : ASMModule]
>> ****** END Stack Trace
>> Execution terminated due to error (see launch configuration to allow
>> continuation after errors).
>>
>> Can anyone help? I can't find what's wrong.
>>
>> Thanks and Greetings
>>
>> Erik
>
>
Re: [ATL] How to create o Sequence / Collection of model elements [message #41732 is a reply to message #41700] Fri, 25 May 2007 14:53 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello Erik,

You probably want to replace '' by ms :-).


Best regards,

Frédéric Jouault

Erik Becker wrote:
> Hello,
>
> model is 'm' and should be the 'iterator'.
> This was a mistake in my posting, that happened while replacing 'model'
> by 'm'. Sorry! In my transformation file it's correct and looks as
> followed:
>
> helper def : getModels : Sequence(XML!Element) =
> let allModels : Sequence(XML!Element) =
> XML!Element.allInstances()->asSequence() in
> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
> if m.name = 'Model'
> then
> ms.append(m)
> else
> ''
> endif
> );
>
> Now any idea why it doesn't work?
>
> Greetings
>
> Erik
>
> Éric Vépa schrieb:
>> Hi Erik,
>>
>> What is 'model' used at line "if model.name = 'Model'" ?
>>
>> Erik Becker wrote:
>>> Hi all,
>>>
>>> I'm new to ATL and fighting with it's peculiarities. ;-)
>>>
>>> I want to create a collection (Sequence) of special elements from a
>>> XML. Therefore I wrote this helper:
>>>
>>> helper def : getModels : Sequence(XML!Element) =
>>> let allModels : Sequence(XML!Element) =
>>> XML!Element.allInstances()->asSequence() in
>>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>>> if model.name = 'Model'
>>> then
>>> ms.append(m)
>>> else
>>> ''
>>> endif
>>> );
>>>
>>> If I use this helper (just printing the sequence's size with output)
>>> I get the following:
>>> ****** BEGIN Stack Trace
>>> message: ERROR: could not find operation append on String having
>>> supertypes: [OclAny]
>>> A.main() : ??#22 null
>>> local variables = {self=aml2xpdl : ASMModule}
>>> local stack = []
>>> A.__initgetModels() : ??#23 8:46-8:66
>>> local variables = {model=IN!Model, models='', self=aml2xpdl :
>>> ASMModule, allModels=Sequence {IN!LogFont, IN!FontNode,
>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjDef, IN!Brush, IN!Size,
>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>> IN!AttrDef, IN!Brush, IN!GUID, IN!AttrValue, IN!AttrDef,
>>> IN!AttrValue, IN!AttrDef, IN!FontNode, IN!FontStyleSheet,
>>> IN!AttrValue, IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrDef,
>>> IN!AttrValue, IN!FontNode, IN!ObjDef, IN!AttrValue, IN!AttrValue,
>>> IN!AttrDef, IN!GUID, IN!Lane, IN!AttrOcc, IN!Pen, IN!FontStyleSheet,
>>> IN!AttrDef, IN!AttrDef, IN!Pen, IN!FontNode, IN!AttrValue,
>>> IN!AttrDef, IN!FontNode, IN!CxnOcc, IN!FontStyleSheet, IN!AttrDef,
>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!ObjDef, IN!AttrDef,
>>> IN!Position, IN!Size, IN!AttrValue, IN!FontStyleSheet, IN!AttrValue,
>>> IN!Pen, IN!GUID, IN!AttrValue, IN!CxnOcc, IN!GUID, IN!Pen, IN!CxnOcc,
>>> IN!Position, IN!Size, IN!AttrValue, IN!AttrDef, IN!Brush,
>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrValue,
>>> IN!FontNode, IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrValue,
>>> IN!ObjDef, IN!Flag, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>> IN!AttrDef, IN!CxnDef, IN!AttrDef, IN!AML, IN!ObjOcc, IN!Size,
>>> IN!Position, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>> IN!AttrValue, IN!Position, IN!AttrDef, IN!Pen, IN!Model,
>>> IN!AttrValue, IN!CxnOcc, IN!FontStyleSheet, IN!Position, IN!Pen,
>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef, IN!FontStyleSheet,
>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!Brush, IN!ObjOcc,
>>> IN!AttrDef, IN!CxnDef, IN!GUID, IN!ObjOcc, IN!AttrValue, IN!AttrDef,
>>> IN!CxnDef, IN!Position, IN!FontNode, IN!AttrDef, IN!AttrDef,
>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef, IN!Pen,
>>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!Position,
>>> IN!FontStyleSheet, IN!FontStyleSheet, IN!GUID, IN!FontNode,
>>> IN!AttrValue, IN!AttrValue, IN!Position, IN!FontStyleSheet,
>>> IN!AttrDef, IN!ObjOcc, IN!AttrValue, IN!GUID, IN!FontStyleSheet,
>>> IN!FontNode, IN!CxnOcc, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>> IN!GUID, IN!AttrValue, IN!AttrValue, IN!Brush, IN!AttrDef,
>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!Size, IN!Pen, IN!ObjOcc,
>>> IN!AttrDef, IN!GUID, IN!FontNode, IN!Size, IN!GUID, IN!GUID,
>>> IN!Position, IN!FontStyleSheet, IN!FontStyleSheet, IN!AttrValue,
>>> IN!AttrDef, IN!CxnDef, IN!CxnDef, IN!Brush, IN!AttrValue,
>>> IN!Position, IN!AttrDef, IN!AttrDef, IN!Position, IN!ObjDef, IN!Size,
>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!GUID, IN!AttrDef,
>>> IN!AttrValue, IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!FontNode,
>>> IN!AttrValue, IN!AttrValue, IN!Pen, IN!AttrValue, IN!FontNode,
>>> IN!Brush, IN!ObjDef, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>> IN!AttrOcc, IN!AttrValue, IN!AttrDef, IN!GUID, IN!GUID, IN!AttrDef,
>>> IN!GUID, IN!Position, IN!GUID, IN!AttrDef, IN!Pen, IN!ObjDef,
>>> IN!Position, IN!AttrDef, IN!AttrDef, IN!Pen, IN!AttrValue,
>>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Language,
>>> IN!AttrValue, IN!AttrValue, IN!AttrOcc, IN!AttrValue, IN!FontNode,
>>> IN!FontNode, IN!FontNode, IN!AttrValue, IN!AttrDef, IN!GUID,
>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush, IN!AttrDef,
>>> IN!AttrDef, IN!AttrDef, IN!Position, IN!AttrDef, IN!AttrDef,
>>> IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue, IN!FontNode,
>>> IN!FontNode, IN!FontNode, IN!Position, IN!AttrValue, IN!AttrValue,
>>> IN!GUID, IN!ObjOcc, IN!CxnDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>> IN!Position, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
>>> IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue,
>>> IN!Header-Info, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
>>> IN!AttrValue, IN!FontNode, IN!AttrDef, IN!AttrValue, IN!AttrDef,
>>> IN!Pen, IN!Position, IN!AttrDef, IN!GUID, IN!GUID, IN!Brush,
>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!FontNode, IN!Pen,
>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>> IN!AttrValue, IN!GUID, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>> IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!CxnOcc,
>>> IN!GUID, IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef,
>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
>>> IN!FontNode, IN!AttrOcc, IN!Lane, IN!AttrDef, IN!AttrDef,
>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue,
>>> IN!ObjOcc, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!Pen,
>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>> IN!GUID, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
>>> IN!AttrValue, IN!GUID, IN!Pen, IN!AttrValue, IN!GUID, IN!AttrValue,
>>> IN!AttrValue, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue,
>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>> IN!AttrValue, IN!CxnDef, IN!AttrValue, IN!AttrValue, IN!ObjDef,
>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!Pen,
>>> IN!AttrDef, IN!Position, IN!Size, IN!AttrOcc, IN!AttrDef, IN!GUID,
>>> IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrDef,
>>> IN!CxnOcc, IN!AttrDef, IN!FontStyleSheet, IN!AttrValue, IN!CxnOcc,
>>> IN!Position, IN!Group, IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue,
>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef,
>>> IN!FontStyleSheet, IN!AttrDef, IN!GUID, IN!Position, IN!FontNode,
>>> IN!AttrValue, IN!AttrDef, IN!Size, IN!GUID, IN!AttrValue, IN!GUID,
>>> IN!GUID, IN!AttrDef, IN!AttrValue, IN!Position, IN!AttrDef,
>>> IN!AttrDef, IN!CxnDef, IN!Pen, IN!AttrValue, IN!AttrValue, IN!Pen,
>>> IN!FontStyleSheet, IN!AttrDef, IN!FontNode, IN!Position,
>>> IN!FontStyleSheet, IN!AttrValue, IN!FontNode, IN!ObjOcc,
>>> IN!AttrValue, IN!LanguageName, IN!GUID, IN!AttrOcc, IN!Database,
>>> IN!AttrDef, IN!CxnDef, IN!AttrDef, IN!CxnOcc, IN!FontStyleSheet,
>>> IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef,
>>> IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef,
>>> IN!GUID, IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>> IN!Brush, IN!Pen, IN!GUID, IN!AttrValue, IN!Position}}
>>> local stack = [aml2xpdl : ASMModule]
>>> ****** END Stack Trace
>>> Execution terminated due to error (see launch configuration to allow
>>> continuation after errors).
>>>
>>> Can anyone help? I can't find what's wrong.
>>>
>>> Thanks and Greetings
>>>
>>> Erik
>>
>>
Re: [ATL] How to create o Sequence / Collection of model elements [message #41825 is a reply to message #41732] Fri, 25 May 2007 15:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: erik_becker.gmx.de

Hi,

I replaced '' by in my helper.

Unfortunately it still doesn't work. Here's the most recent complete
version of my transformation:

module aml2xpdl; -- Module Template

create OUT : XPDL from IN : XML;

helper def : getModels : Sequence(XML!Element) =
let allModels : Sequence(XML!Element) =
XML!Element.allInstances()->asSequence()
in allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
if m.name = 'Model'
then
ms.append(ml)
else
ms
endif
);

entrypoint rule createPackage() {
to
package : XPDL!Package (
id <- '123',
name <- 'MyPackage',
workflowProcesses <- Set{process01, process02}
),
process01 : XPDL!Process (
id <- '456',
name <- 'MyProcess01'
),
process02 : XPDL!Process (
id <- '789',
name <- 'MyProcess02'
)
do {
-- Print number of models
thisModule.output(thisModule.getModels->size());
}
}

This is the error I get on the console:
****** BEGIN Stack Trace
exception:
java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.atl.engine.vm.ClassNativeOperation.exec(ClassNativeOpera tion.java:59)
at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
at org.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:276)
at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:1 36)
at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:9 4)
at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 8)
at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 4)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:230)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:168)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:145)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:121)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .launch(AtlLaunchConfigurationDelegate.java:97)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:639)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:565)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:754)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:944)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
A.main() : ??#24 null
local variables = {self=aml2xpdl : ASMModule}
local stack = []
A.createPackage() : ??#63 26:17-26:64
local variables = {process02=OUT!MyProcess02,
process01=OUT!MyProcess01, self=aml2xpdl : ASMModule, package=OUT!MyPackage}
local stack = []
NativeOperation public static void
org.atl.engine.vm.nativelib.ASMOclAny.output(org.atl.engine. vm.StackFrame,org.atl.engine.vm.nativelib.ASMOclAny)
args = [aml2xpdl : ASMModule, 1]
****** END Stack Trace
Execution terminated due to error (see launch configuration to allow
continuation after errors).

Any idea what to do? I'm not sure but it seems to me as the helper works.

Greetings

Erik

Frédéric Jouault schrieb:
> Hello Erik,
>
> You probably want to replace '' by ms :-).
>
>
> Best regards,
>
> Frédéric Jouault
>
> Erik Becker wrote:
>> Hello,
>>
>> model is 'm' and should be the 'iterator'.
>> This was a mistake in my posting, that happened while replacing
>> 'model' by 'm'. Sorry! In my transformation file it's correct and
>> looks as followed:
>>
>> helper def : getModels : Sequence(XML!Element) =
>> let allModels : Sequence(XML!Element) =
>> XML!Element.allInstances()->asSequence() in
>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>> if m.name = 'Model'
>> then
>> ms.append(m)
>> else
>> ''
>> endif
>> );
>>
>> Now any idea why it doesn't work?
>>
>> Greetings
>>
>> Erik
>>
>> Éric Vépa schrieb:
>>> Hi Erik,
>>>
>>> What is 'model' used at line "if model.name = 'Model'" ?
>>>
>>> Erik Becker wrote:
>>>> Hi all,
>>>>
>>>> I'm new to ATL and fighting with it's peculiarities. ;-)
>>>>
>>>> I want to create a collection (Sequence) of special elements from a
>>>> XML. Therefore I wrote this helper:
>>>>
>>>> helper def : getModels : Sequence(XML!Element) =
>>>> let allModels : Sequence(XML!Element) =
>>>> XML!Element.allInstances()->asSequence() in
>>>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>>>> if model.name = 'Model'
>>>> then
>>>> ms.append(m)
>>>> else
>>>> ''
>>>> endif
>>>> );
>>>>
>>>> If I use this helper (just printing the sequence's size with output)
>>>> I get the following:
>>>> ****** BEGIN Stack Trace
>>>> message: ERROR: could not find operation append on String having
>>>> supertypes: [OclAny]
>>>> A.main() : ??#22 null
>>>> local variables = {self=aml2xpdl : ASMModule}
>>>> local stack = []
>>>> A.__initgetModels() : ??#23 8:46-8:66
>>>> local variables = {model=IN!Model, models='', self=aml2xpdl :
>>>> ASMModule, allModels=Sequence {IN!LogFont, IN!FontNode,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjDef, IN!Brush, IN!Size,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>>> IN!AttrDef, IN!Brush, IN!GUID, IN!AttrValue, IN!AttrDef,
>>>> IN!AttrValue, IN!AttrDef, IN!FontNode, IN!FontStyleSheet,
>>>> IN!AttrValue, IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrDef,
>>>> IN!AttrValue, IN!FontNode, IN!ObjDef, IN!AttrValue, IN!AttrValue,
>>>> IN!AttrDef, IN!GUID, IN!Lane, IN!AttrOcc, IN!Pen, IN!FontStyleSheet,
>>>> IN!AttrDef, IN!AttrDef, IN!Pen, IN!FontNode, IN!AttrValue,
>>>> IN!AttrDef, IN!FontNode, IN!CxnOcc, IN!FontStyleSheet, IN!AttrDef,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!ObjDef, IN!AttrDef,
>>>> IN!Position, IN!Size, IN!AttrValue, IN!FontStyleSheet, IN!AttrValue,
>>>> IN!Pen, IN!GUID, IN!AttrValue, IN!CxnOcc, IN!GUID, IN!Pen,
>>>> IN!CxnOcc, IN!Position, IN!Size, IN!AttrValue, IN!AttrDef, IN!Brush,
>>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrValue,
>>>> IN!FontNode, IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrValue,
>>>> IN!ObjDef, IN!Flag, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>> IN!AttrDef, IN!CxnDef, IN!AttrDef, IN!AML, IN!ObjOcc, IN!Size,
>>>> IN!Position, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>> IN!AttrValue, IN!Position, IN!AttrDef, IN!Pen, IN!Model,
>>>> IN!AttrValue, IN!CxnOcc, IN!FontStyleSheet, IN!Position, IN!Pen,
>>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef,
>>>> IN!FontStyleSheet, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>> IN!Brush, IN!ObjOcc, IN!AttrDef, IN!CxnDef, IN!GUID, IN!ObjOcc,
>>>> IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!Position, IN!FontNode,
>>>> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>> IN!GUID, IN!AttrDef, IN!Pen, IN!AttrValue, IN!AttrDef, IN!AttrValue,
>>>> IN!Position, IN!FontStyleSheet, IN!FontStyleSheet, IN!GUID,
>>>> IN!FontNode, IN!AttrValue, IN!AttrValue, IN!Position,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!AttrValue, IN!GUID,
>>>> IN!FontStyleSheet, IN!FontNode, IN!CxnOcc, IN!AttrValue, IN!AttrDef,
>>>> IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue, IN!Brush,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!Size, IN!Pen,
>>>> IN!ObjOcc, IN!AttrDef, IN!GUID, IN!FontNode, IN!Size, IN!GUID,
>>>> IN!GUID, IN!Position, IN!FontStyleSheet, IN!FontStyleSheet,
>>>> IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!CxnDef, IN!Brush,
>>>> IN!AttrValue, IN!Position, IN!AttrDef, IN!AttrDef, IN!Position,
>>>> IN!ObjDef, IN!Size, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>> IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrOcc, IN!AttrDef,
>>>> IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrValue, IN!Pen,
>>>> IN!AttrValue, IN!FontNode, IN!Brush, IN!ObjDef, IN!AttrDef,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrOcc, IN!AttrValue, IN!AttrDef,
>>>> IN!GUID, IN!GUID, IN!AttrDef, IN!GUID, IN!Position, IN!GUID,
>>>> IN!AttrDef, IN!Pen, IN!ObjDef, IN!Position, IN!AttrDef, IN!AttrDef,
>>>> IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrValue,
>>>> IN!AttrValue, IN!Language, IN!AttrValue, IN!AttrValue, IN!AttrOcc,
>>>> IN!AttrValue, IN!FontNode, IN!FontNode, IN!FontNode, IN!AttrValue,
>>>> IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>>> IN!Brush, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!Position,
>>>> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!Brush,
>>>> IN!AttrValue, IN!FontNode, IN!FontNode, IN!FontNode, IN!Position,
>>>> IN!AttrValue, IN!AttrValue, IN!GUID, IN!ObjOcc, IN!CxnDef,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!Position, IN!AttrDef,
>>>> IN!Position, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrDef,
>>>> IN!GUID, IN!AttrValue, IN!AttrValue, IN!Header-Info, IN!AttrDef,
>>>> IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue, IN!FontNode,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!Pen, IN!Position,
>>>> IN!AttrDef, IN!GUID, IN!GUID, IN!Brush, IN!FontStyleSheet,
>>>> IN!AttrDef, IN!ObjOcc, IN!FontNode, IN!Pen, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>> IN!GUID, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrDef,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!CxnOcc, IN!GUID,
>>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
>>>> IN!FontNode, IN!AttrOcc, IN!Lane, IN!AttrDef, IN!AttrDef,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue,
>>>> IN!ObjOcc, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!Pen,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>> IN!GUID, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
>>>> IN!AttrValue, IN!GUID, IN!Pen, IN!AttrValue, IN!GUID, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>>> IN!AttrValue, IN!CxnDef, IN!AttrValue, IN!AttrValue, IN!ObjDef,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!Pen,
>>>> IN!AttrDef, IN!Position, IN!Size, IN!AttrOcc, IN!AttrDef, IN!GUID,
>>>> IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrDef,
>>>> IN!CxnOcc, IN!AttrDef, IN!FontStyleSheet, IN!AttrValue, IN!CxnOcc,
>>>> IN!Position, IN!Group, IN!AttrDef, IN!GUID, IN!AttrDef,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrDef,
>>>> IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!GUID, IN!Position,
>>>> IN!FontNode, IN!AttrValue, IN!AttrDef, IN!Size, IN!GUID,
>>>> IN!AttrValue, IN!GUID, IN!GUID, IN!AttrDef, IN!AttrValue,
>>>> IN!Position, IN!AttrDef, IN!AttrDef, IN!CxnDef, IN!Pen,
>>>> IN!AttrValue, IN!AttrValue, IN!Pen, IN!FontStyleSheet, IN!AttrDef,
>>>> IN!FontNode, IN!Position, IN!FontStyleSheet, IN!AttrValue,
>>>> IN!FontNode, IN!ObjOcc, IN!AttrValue, IN!LanguageName, IN!GUID,
>>>> IN!AttrOcc, IN!Database, IN!AttrDef, IN!CxnDef, IN!AttrDef,
>>>> IN!CxnOcc, IN!FontStyleSheet, IN!AttrValue, IN!GUID,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrOcc,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush, IN!Pen, IN!GUID,
>>>> IN!AttrValue, IN!Position}}
>>>> local stack = [aml2xpdl : ASMModule]
>>>> ****** END Stack Trace
>>>> Execution terminated due to error (see launch configuration to allow
>>>> continuation after errors).
>>>>
>>>> Can anyone help? I can't find what's wrong.
>>>>
>>>> Thanks and Greetings
>>>>
>>>> Erik
>>>
>>>
Re: [ATL] How to create o Sequence / Collection of model elements [message #41856 is a reply to message #41825] Fri, 25 May 2007 15:28 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

OclAny.output() : Void prints its source on the console. It does not
take any argument.

For instance:
'Hello World!'.output()

;-)


BTW, why are you not using declarative rules?



Best regards,

Frédéric Jouault


Erik Becker wrote:
> Hi,
>
> I replaced '' by in my helper.
>
> Unfortunately it still doesn't work. Here's the most recent complete
> version of my transformation:
>
> module aml2xpdl; -- Module Template
>
> create OUT : XPDL from IN : XML;
>
> helper def : getModels : Sequence(XML!Element) =
> let allModels : Sequence(XML!Element) =
> XML!Element.allInstances()->asSequence()
> in allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
> if m.name = 'Model'
> then
> ms.append(ml)
> else
> ms
> endif
> );
>
> entrypoint rule createPackage() {
> to
> package : XPDL!Package (
> id <- '123',
> name <- 'MyPackage',
> workflowProcesses <- Set{process01, process02}
> ),
> process01 : XPDL!Process (
> id <- '456',
> name <- 'MyProcess01'
> ),
> process02 : XPDL!Process (
> id <- '789',
> name <- 'MyProcess02'
> )
> do {
> -- Print number of models
> thisModule.output(thisModule.getModels->size());
> }
> }
>
> This is the error I get on the console:
> ****** BEGIN Stack Trace
> exception:
> java.lang.IllegalArgumentException: wrong number of arguments
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.atl.engine.vm.ClassNativeOperation.exec(ClassNativeOpera tion.java:59)
> at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
> at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
> at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
> at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
> at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
> at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
> at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
> at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
> at org.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:276)
> at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:1 36)
> at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:9 4)
> at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 8)
> at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 4)
> at
> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:230)
>
> at
> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:168)
>
> at
> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:145)
>
> at
> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:121)
>
> at
> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .launch(AtlLaunchConfigurationDelegate.java:97)
>
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:639)
>
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:565)
>
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:754)
>
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:944)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
> A.main() : ??#24 null
> local variables = {self=aml2xpdl : ASMModule}
> local stack = []
> A.createPackage() : ??#63 26:17-26:64
> local variables = {process02=OUT!MyProcess02,
> process01=OUT!MyProcess01, self=aml2xpdl : ASMModule,
> package=OUT!MyPackage}
> local stack = []
> NativeOperation public static void
> org.atl.engine.vm.nativelib.ASMOclAny.output(org.atl.engine. vm.StackFrame,org.atl.engine.vm.nativelib.ASMOclAny)
>
> args = [aml2xpdl : ASMModule, 1]
> ****** END Stack Trace
> Execution terminated due to error (see launch configuration to allow
> continuation after errors).
>
> Any idea what to do? I'm not sure but it seems to me as the helper works.
>
> Greetings
>
> Erik
>
> Frédéric Jouault schrieb:
>> Hello Erik,
>>
>> You probably want to replace '' by ms :-).
>>
>>
>> Best regards,
>>
>> Frédéric Jouault
>>
>> Erik Becker wrote:
>>> Hello,
>>>
>>> model is 'm' and should be the 'iterator'.
>>> This was a mistake in my posting, that happened while replacing
>>> 'model' by 'm'. Sorry! In my transformation file it's correct and
>>> looks as followed:
>>>
>>> helper def : getModels : Sequence(XML!Element) =
>>> let allModels : Sequence(XML!Element) =
>>> XML!Element.allInstances()->asSequence() in
>>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>>> if m.name = 'Model'
>>> then
>>> ms.append(m)
>>> else
>>> ''
>>> endif
>>> );
>>>
>>> Now any idea why it doesn't work?
>>>
>>> Greetings
>>>
>>> Erik
>>>
>>> Éric Vépa schrieb:
>>>> Hi Erik,
>>>>
>>>> What is 'model' used at line "if model.name = 'Model'" ?
>>>>
>>>> Erik Becker wrote:
>>>>> Hi all,
>>>>>
>>>>> I'm new to ATL and fighting with it's peculiarities. ;-)
>>>>>
>>>>> I want to create a collection (Sequence) of special elements from a
>>>>> XML. Therefore I wrote this helper:
>>>>>
>>>>> helper def : getModels : Sequence(XML!Element) =
>>>>> let allModels : Sequence(XML!Element) =
>>>>> XML!Element.allInstances()->asSequence() in
>>>>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>>>>> if model.name = 'Model'
>>>>> then
>>>>> ms.append(m)
>>>>> else
>>>>> ''
>>>>> endif
>>>>> );
>>>>>
>>>>> If I use this helper (just printing the sequence's size with
>>>>> output) I get the following:
>>>>> ****** BEGIN Stack Trace
>>>>> message: ERROR: could not find operation append on String
>>>>> having supertypes: [OclAny]
>>>>> A.main() : ??#22 null
>>>>> local variables = {self=aml2xpdl : ASMModule}
>>>>> local stack = []
>>>>> A.__initgetModels() : ??#23 8:46-8:66
>>>>> local variables = {model=IN!Model, models='', self=aml2xpdl :
>>>>> ASMModule, allModels=Sequence {IN!LogFont, IN!FontNode,
>>>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjDef, IN!Brush, IN!Size,
>>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>>>> IN!AttrDef, IN!Brush, IN!GUID, IN!AttrValue, IN!AttrDef,
>>>>> IN!AttrValue, IN!AttrDef, IN!FontNode, IN!FontStyleSheet,
>>>>> IN!AttrValue, IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrDef,
>>>>> IN!AttrValue, IN!FontNode, IN!ObjDef, IN!AttrValue, IN!AttrValue,
>>>>> IN!AttrDef, IN!GUID, IN!Lane, IN!AttrOcc, IN!Pen,
>>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen, IN!FontNode,
>>>>> IN!AttrValue, IN!AttrDef, IN!FontNode, IN!CxnOcc,
>>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!AttrValue,
>>>>> IN!AttrDef, IN!ObjDef, IN!AttrDef, IN!Position, IN!Size,
>>>>> IN!AttrValue, IN!FontStyleSheet, IN!AttrValue, IN!Pen, IN!GUID,
>>>>> IN!AttrValue, IN!CxnOcc, IN!GUID, IN!Pen, IN!CxnOcc, IN!Position,
>>>>> IN!Size, IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue,
>>>>> IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrValue, IN!FontNode,
>>>>> IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrValue, IN!ObjDef,
>>>>> IN!Flag, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrDef,
>>>>> IN!CxnDef, IN!AttrDef, IN!AML, IN!ObjOcc, IN!Size, IN!Position,
>>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>>> IN!Position, IN!AttrDef, IN!Pen, IN!Model, IN!AttrValue, IN!CxnOcc,
>>>>> IN!FontStyleSheet, IN!Position, IN!Pen, IN!AttrValue, IN!AttrDef,
>>>>> IN!Position, IN!AttrDef, IN!FontStyleSheet, IN!AttrValue,
>>>>> IN!AttrValue, IN!AttrValue, IN!Brush, IN!ObjOcc, IN!AttrDef,
>>>>> IN!CxnDef, IN!GUID, IN!ObjOcc, IN!AttrValue, IN!AttrDef, IN!CxnDef,
>>>>> IN!Position, IN!FontNode, IN!AttrDef, IN!AttrDef, IN!AttrValue,
>>>>> IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef, IN!Pen, IN!AttrValue,
>>>>> IN!AttrDef, IN!AttrValue, IN!Position, IN!FontStyleSheet,
>>>>> IN!FontStyleSheet, IN!GUID, IN!FontNode, IN!AttrValue,
>>>>> IN!AttrValue, IN!Position, IN!FontStyleSheet, IN!AttrDef,
>>>>> IN!ObjOcc, IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!FontNode,
>>>>> IN!CxnOcc, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!GUID,
>>>>> IN!AttrValue, IN!AttrValue, IN!Brush, IN!AttrDef, IN!AttrValue,
>>>>> IN!AttrDef, IN!AttrDef, IN!Size, IN!Pen, IN!ObjOcc, IN!AttrDef,
>>>>> IN!GUID, IN!FontNode, IN!Size, IN!GUID, IN!GUID, IN!Position,
>>>>> IN!FontStyleSheet, IN!FontStyleSheet, IN!AttrValue, IN!AttrDef,
>>>>> IN!CxnDef, IN!CxnDef, IN!Brush, IN!AttrValue, IN!Position,
>>>>> IN!AttrDef, IN!AttrDef, IN!Position, IN!ObjDef, IN!Size,
>>>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!GUID, IN!AttrDef,
>>>>> IN!AttrValue, IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!FontNode,
>>>>> IN!AttrValue, IN!AttrValue, IN!Pen, IN!AttrValue, IN!FontNode,
>>>>> IN!Brush, IN!ObjDef, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>>>> IN!AttrOcc, IN!AttrValue, IN!AttrDef, IN!GUID, IN!GUID, IN!AttrDef,
>>>>> IN!GUID, IN!Position, IN!GUID, IN!AttrDef, IN!Pen, IN!ObjDef,
>>>>> IN!Position, IN!AttrDef, IN!AttrDef, IN!Pen, IN!AttrValue,
>>>>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Language,
>>>>> IN!AttrValue, IN!AttrValue, IN!AttrOcc, IN!AttrValue, IN!FontNode,
>>>>> IN!FontNode, IN!FontNode, IN!AttrValue, IN!AttrDef, IN!GUID,
>>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush, IN!AttrDef,
>>>>> IN!AttrDef, IN!AttrDef, IN!Position, IN!AttrDef, IN!AttrDef,
>>>>> IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue, IN!FontNode,
>>>>> IN!FontNode, IN!FontNode, IN!Position, IN!AttrValue, IN!AttrValue,
>>>>> IN!GUID, IN!ObjOcc, IN!CxnDef, IN!AttrValue, IN!AttrDef,
>>>>> IN!AttrDef, IN!Position, IN!AttrDef, IN!Position, IN!AttrValue,
>>>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue,
>>>>> IN!AttrValue, IN!Header-Info, IN!AttrDef, IN!AttrDef, IN!GUID,
>>>>> IN!AttrDef, IN!AttrValue, IN!FontNode, IN!AttrDef, IN!AttrValue,
>>>>> IN!AttrDef, IN!Pen, IN!Position, IN!AttrDef, IN!GUID, IN!GUID,
>>>>> IN!Brush, IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!FontNode,
>>>>> IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrValue,
>>>>> IN!AttrValue, IN!AttrValue, IN!GUID, IN!AttrDef, IN!AttrDef,
>>>>> IN!AttrValue, IN!GUID, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>>>> IN!AttrValue, IN!CxnOcc, IN!GUID, IN!AttrValue, IN!AttrDef,
>>>>> IN!Position, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>>> IN!GUID, IN!AttrDef, IN!FontNode, IN!AttrOcc, IN!Lane, IN!AttrDef,
>>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID,
>>>>> IN!AttrValue, IN!ObjOcc, IN!AttrDef, IN!AttrDef, IN!AttrDef,
>>>>> IN!AttrDef, IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>>> IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef, IN!Position,
>>>>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!GUID, IN!Pen,
>>>>> IN!AttrValue, IN!GUID, IN!AttrValue, IN!AttrValue, IN!AttrDef,
>>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>>>> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef,
>>>>> IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrValue, IN!CxnDef,
>>>>> IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!AttrDef, IN!AttrValue,
>>>>> IN!AttrValue, IN!ObjDef, IN!Pen, IN!AttrDef, IN!Position, IN!Size,
>>>>> IN!AttrOcc, IN!AttrDef, IN!GUID, IN!GUID, IN!AttrValue, IN!AttrDef,
>>>>> IN!AttrValue, IN!AttrDef, IN!CxnOcc, IN!AttrDef, IN!FontStyleSheet,
>>>>> IN!AttrValue, IN!CxnOcc, IN!Position, IN!Group, IN!AttrDef,
>>>>> IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef,
>>>>> IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>>>> IN!GUID, IN!Position, IN!FontNode, IN!AttrValue, IN!AttrDef,
>>>>> IN!Size, IN!GUID, IN!AttrValue, IN!GUID, IN!GUID, IN!AttrDef,
>>>>> IN!AttrValue, IN!Position, IN!AttrDef, IN!AttrDef, IN!CxnDef,
>>>>> IN!Pen, IN!AttrValue, IN!AttrValue, IN!Pen, IN!FontStyleSheet,
>>>>> IN!AttrDef, IN!FontNode, IN!Position, IN!FontStyleSheet,
>>>>> IN!AttrValue, IN!FontNode, IN!ObjOcc, IN!AttrValue,
>>>>> IN!LanguageName, IN!GUID, IN!AttrOcc, IN!Database, IN!AttrDef,
>>>>> IN!CxnDef, IN!AttrDef, IN!CxnOcc, IN!FontStyleSheet, IN!AttrValue,
>>>>> IN!GUID, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen,
>>>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID,
>>>>> IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush,
>>>>> IN!Pen, IN!GUID, IN!AttrValue, IN!Position}}
>>>>> local stack = [aml2xpdl : ASMModule]
>>>>> ****** END Stack Trace
>>>>> Execution terminated due to error (see launch configuration to
>>>>> allow continuation after errors).
>>>>>
>>>>> Can anyone help? I can't find what's wrong.
>>>>>
>>>>> Thanks and Greetings
>>>>>
>>>>> Erik
>>>>
>>>>
Re: [ATL] How to create o Sequence / Collection of model elements [message #41888 is a reply to message #41732] Fri, 25 May 2007 15:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: erik_becker.gmx.de

Hi,

forget my posting from before I found another correction. I replaced ''
by in my helper AND put a 'to.String()' to the output command.

Unfortunately it still doesn't work. Here's the most recent complete
version of my transformation:

module aml2xpdl; -- Module Template

create OUT : XPDL from IN : XML;

helper def : getModels : Sequence(XML!Element) =
let allModels : Sequence(XML!Element) =
XML!Element.allInstances()->asSequence()
in allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
if m.name = 'Model'
then
ms.append(ml)
else
ms
endif
);

entrypoint rule createPackage() {
to
package : XPDL!Package (
id <- '123',
name <- 'MyPackage',
workflowProcesses <- Set{process01, process02}
),
process01 : XPDL!Process (
id <- '456',
name <- 'MyProcess01'
),
process02 : XPDL!Process (
id <- '789',
name <- 'MyProcess02'
)
do {
-- Print number of models
thisModule.output(thisModule.getModels->size().toString());
}
}

This is the error I get on the console:
****** BEGIN Stack Trace
exception:
java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.atl.engine.vm.ClassNativeOperation.exec(ClassNativeOpera tion.java:59)
at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
at org.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:276)
at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:1 36)
at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:9 4)
at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 8)
at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 4)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:230)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:168)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:145)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:121)
at
org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .launch(AtlLaunchConfigurationDelegate.java:97)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:639)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:565)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:754)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:944)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
A.main() : ??#24 null
local variables = {self=aml2xpdl : ASMModule}
local stack = []
A.createPackage() : ??#64 31:17-31:75
local variables = {process02=OUT!MyProcess02,
process01=OUT!MyProcess01, self=aml2xpdl : ASMModule, package=OUT!MyPackage}
local stack = []
NativeOperation public static void
org.atl.engine.vm.nativelib.ASMOclAny.output(org.atl.engine. vm.StackFrame,org.atl.engine.vm.nativelib.ASMOclAny)
args = [aml2xpdl : ASMModule, '1']
****** END Stack Trace
Execution terminated due to error (see launch configuration to allow
continuation after errors).

Any idea what to do? I'm not sure but it seems as the helper works. I
want to use the Sequence to produce Elements for each member in it.
How can I inspect if the helper works?

Greetings

Erik


Frédéric Jouault schrieb:
> Hello Erik,
>
> You probably want to replace '' by ms :-).
>
>
> Best regards,
>
> Frédéric Jouault
>
> Erik Becker wrote:
>> Hello,
>>
>> model is 'm' and should be the 'iterator'.
>> This was a mistake in my posting, that happened while replacing
>> 'model' by 'm'. Sorry! In my transformation file it's correct and
>> looks as followed:
>>
>> helper def : getModels : Sequence(XML!Element) =
>> let allModels : Sequence(XML!Element) =
>> XML!Element.allInstances()->asSequence() in
>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>> if m.name = 'Model'
>> then
>> ms.append(m)
>> else
>> ''
>> endif
>> );
>>
>> Now any idea why it doesn't work?
>>
>> Greetings
>>
>> Erik
>>
>> Éric Vépa schrieb:
>>> Hi Erik,
>>>
>>> What is 'model' used at line "if model.name = 'Model'" ?
>>>
>>> Erik Becker wrote:
>>>> Hi all,
>>>>
>>>> I'm new to ATL and fighting with it's peculiarities. ;-)
>>>>
>>>> I want to create a collection (Sequence) of special elements from a
>>>> XML. Therefore I wrote this helper:
>>>>
>>>> helper def : getModels : Sequence(XML!Element) =
>>>> let allModels : Sequence(XML!Element) =
>>>> XML!Element.allInstances()->asSequence() in
>>>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>>>> if model.name = 'Model'
>>>> then
>>>> ms.append(m)
>>>> else
>>>> ''
>>>> endif
>>>> );
>>>>
>>>> If I use this helper (just printing the sequence's size with output)
>>>> I get the following:
>>>> ****** BEGIN Stack Trace
>>>> message: ERROR: could not find operation append on String having
>>>> supertypes: [OclAny]
>>>> A.main() : ??#22 null
>>>> local variables = {self=aml2xpdl : ASMModule}
>>>> local stack = []
>>>> A.__initgetModels() : ??#23 8:46-8:66
>>>> local variables = {model=IN!Model, models='', self=aml2xpdl :
>>>> ASMModule, allModels=Sequence {IN!LogFont, IN!FontNode,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjDef, IN!Brush, IN!Size,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>>> IN!AttrDef, IN!Brush, IN!GUID, IN!AttrValue, IN!AttrDef,
>>>> IN!AttrValue, IN!AttrDef, IN!FontNode, IN!FontStyleSheet,
>>>> IN!AttrValue, IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrDef,
>>>> IN!AttrValue, IN!FontNode, IN!ObjDef, IN!AttrValue, IN!AttrValue,
>>>> IN!AttrDef, IN!GUID, IN!Lane, IN!AttrOcc, IN!Pen, IN!FontStyleSheet,
>>>> IN!AttrDef, IN!AttrDef, IN!Pen, IN!FontNode, IN!AttrValue,
>>>> IN!AttrDef, IN!FontNode, IN!CxnOcc, IN!FontStyleSheet, IN!AttrDef,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!ObjDef, IN!AttrDef,
>>>> IN!Position, IN!Size, IN!AttrValue, IN!FontStyleSheet, IN!AttrValue,
>>>> IN!Pen, IN!GUID, IN!AttrValue, IN!CxnOcc, IN!GUID, IN!Pen,
>>>> IN!CxnOcc, IN!Position, IN!Size, IN!AttrValue, IN!AttrDef, IN!Brush,
>>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrValue,
>>>> IN!FontNode, IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrValue,
>>>> IN!ObjDef, IN!Flag, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>> IN!AttrDef, IN!CxnDef, IN!AttrDef, IN!AML, IN!ObjOcc, IN!Size,
>>>> IN!Position, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>> IN!AttrValue, IN!Position, IN!AttrDef, IN!Pen, IN!Model,
>>>> IN!AttrValue, IN!CxnOcc, IN!FontStyleSheet, IN!Position, IN!Pen,
>>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef,
>>>> IN!FontStyleSheet, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>> IN!Brush, IN!ObjOcc, IN!AttrDef, IN!CxnDef, IN!GUID, IN!ObjOcc,
>>>> IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!Position, IN!FontNode,
>>>> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>> IN!GUID, IN!AttrDef, IN!Pen, IN!AttrValue, IN!AttrDef, IN!AttrValue,
>>>> IN!Position, IN!FontStyleSheet, IN!FontStyleSheet, IN!GUID,
>>>> IN!FontNode, IN!AttrValue, IN!AttrValue, IN!Position,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!AttrValue, IN!GUID,
>>>> IN!FontStyleSheet, IN!FontNode, IN!CxnOcc, IN!AttrValue, IN!AttrDef,
>>>> IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue, IN!Brush,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!Size, IN!Pen,
>>>> IN!ObjOcc, IN!AttrDef, IN!GUID, IN!FontNode, IN!Size, IN!GUID,
>>>> IN!GUID, IN!Position, IN!FontStyleSheet, IN!FontStyleSheet,
>>>> IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!CxnDef, IN!Brush,
>>>> IN!AttrValue, IN!Position, IN!AttrDef, IN!AttrDef, IN!Position,
>>>> IN!ObjDef, IN!Size, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>> IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrOcc, IN!AttrDef,
>>>> IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrValue, IN!Pen,
>>>> IN!AttrValue, IN!FontNode, IN!Brush, IN!ObjDef, IN!AttrDef,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrOcc, IN!AttrValue, IN!AttrDef,
>>>> IN!GUID, IN!GUID, IN!AttrDef, IN!GUID, IN!Position, IN!GUID,
>>>> IN!AttrDef, IN!Pen, IN!ObjDef, IN!Position, IN!AttrDef, IN!AttrDef,
>>>> IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrValue,
>>>> IN!AttrValue, IN!Language, IN!AttrValue, IN!AttrValue, IN!AttrOcc,
>>>> IN!AttrValue, IN!FontNode, IN!FontNode, IN!FontNode, IN!AttrValue,
>>>> IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>>> IN!Brush, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!Position,
>>>> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!Brush,
>>>> IN!AttrValue, IN!FontNode, IN!FontNode, IN!FontNode, IN!Position,
>>>> IN!AttrValue, IN!AttrValue, IN!GUID, IN!ObjOcc, IN!CxnDef,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!Position, IN!AttrDef,
>>>> IN!Position, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrDef,
>>>> IN!GUID, IN!AttrValue, IN!AttrValue, IN!Header-Info, IN!AttrDef,
>>>> IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue, IN!FontNode,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!Pen, IN!Position,
>>>> IN!AttrDef, IN!GUID, IN!GUID, IN!Brush, IN!FontStyleSheet,
>>>> IN!AttrDef, IN!ObjOcc, IN!FontNode, IN!Pen, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>> IN!GUID, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrDef,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!CxnOcc, IN!GUID,
>>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
>>>> IN!FontNode, IN!AttrOcc, IN!Lane, IN!AttrDef, IN!AttrDef,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue,
>>>> IN!ObjOcc, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!Pen,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>> IN!GUID, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
>>>> IN!AttrValue, IN!GUID, IN!Pen, IN!AttrValue, IN!GUID, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>>> IN!AttrValue, IN!CxnDef, IN!AttrValue, IN!AttrValue, IN!ObjDef,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!Pen,
>>>> IN!AttrDef, IN!Position, IN!Size, IN!AttrOcc, IN!AttrDef, IN!GUID,
>>>> IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!AttrDef,
>>>> IN!CxnOcc, IN!AttrDef, IN!FontStyleSheet, IN!AttrValue, IN!CxnOcc,
>>>> IN!Position, IN!Group, IN!AttrDef, IN!GUID, IN!AttrDef,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrDef,
>>>> IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!GUID, IN!Position,
>>>> IN!FontNode, IN!AttrValue, IN!AttrDef, IN!Size, IN!GUID,
>>>> IN!AttrValue, IN!GUID, IN!GUID, IN!AttrDef, IN!AttrValue,
>>>> IN!Position, IN!AttrDef, IN!AttrDef, IN!CxnDef, IN!Pen,
>>>> IN!AttrValue, IN!AttrValue, IN!Pen, IN!FontStyleSheet, IN!AttrDef,
>>>> IN!FontNode, IN!Position, IN!FontStyleSheet, IN!AttrValue,
>>>> IN!FontNode, IN!ObjOcc, IN!AttrValue, IN!LanguageName, IN!GUID,
>>>> IN!AttrOcc, IN!Database, IN!AttrDef, IN!CxnDef, IN!AttrDef,
>>>> IN!CxnOcc, IN!FontStyleSheet, IN!AttrValue, IN!GUID,
>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen, IN!AttrValue,
>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrOcc,
>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Brush, IN!Pen, IN!GUID,
>>>> IN!AttrValue, IN!Position}}
>>>> local stack = [aml2xpdl : ASMModule]
>>>> ****** END Stack Trace
>>>> Execution terminated due to error (see launch configuration to allow
>>>> continuation after errors).
>>>>
>>>> Can anyone help? I can't find what's wrong.
>>>>
>>>> Thanks and Greetings
>>>>
>>>> Erik
>>>
>>>
Re: [ATL] How to create o Sequence / Collection of model elements [message #41920 is a reply to message #41856] Fri, 25 May 2007 15:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: erik_becker.gmx.de

Hello,

Frédéric Jouault schrieb:
> Hi,
>
> OclAny.output() : Void prints its source on the console. It does not
> take any argument.

Okay, a simple look in the manual could help. Sorry for that.

>
> For instance:
> 'Hello World!'.output()
>
> ;-)
>
>
> BTW, why are you not using declarative rules?

I don't know. I'm exploring a way to get what I want. It's some like
'Try and Error'. ;-)
>
>
>
> Best regards,
>
> Frédéric Jouault
>
>
> Erik Becker wrote:
>> Hi,
>>
>> I replaced '' by in my helper.
>>
>> Unfortunately it still doesn't work. Here's the most recent complete
>> version of my transformation:
>>
>> module aml2xpdl; -- Module Template
>>
>> create OUT : XPDL from IN : XML;
>>
>> helper def : getModels : Sequence(XML!Element) =
>> let allModels : Sequence(XML!Element) =
>> XML!Element.allInstances()->asSequence()
>> in allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>> if m.name = 'Model'
>> then
>> ms.append(ml)
>> else
>> ms
>> endif
>> );
>>
>> entrypoint rule createPackage() {
>> to
>> package : XPDL!Package (
>> id <- '123',
>> name <- 'MyPackage',
>> workflowProcesses <- Set{process01, process02}
>> ),
>> process01 : XPDL!Process (
>> id <- '456',
>> name <- 'MyProcess01'
>> ),
>> process02 : XPDL!Process (
>> id <- '789',
>> name <- 'MyProcess02'
>> )
>> do {
>> -- Print number of models
>> thisModule.output(thisModule.getModels->size());
>> }
>> }
>>
>> This is the error I get on the console:
>> ****** BEGIN Stack Trace
>> exception:
>> java.lang.IllegalArgumentException: wrong number of arguments
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.atl.engine.vm.ClassNativeOperation.exec(ClassNativeOpera tion.java:59)
>> at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
>> at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
>> at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
>> at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
>> at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
>> at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
>> at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
>> at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
>> at org.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:276)
>> at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:1 36)
>> at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:9 4)
>> at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 8)
>> at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 4)
>> at
>> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:230)
>>
>> at
>> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:168)
>>
>> at
>> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:145)
>>
>> at
>> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .runAtlLauncher(AtlLaunchConfigurationDelegate.java:121)
>>
>> at
>> org.atl.eclipse.adt.launching.AtlLaunchConfigurationDelegate .launch(AtlLaunchConfigurationDelegate.java:97)
>>
>> at
>> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:639)
>>
>> at
>> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:565)
>>
>> at
>> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:754)
>>
>> at
>> org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:944)
>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
>> A.main() : ??#24 null
>> local variables = {self=aml2xpdl : ASMModule}
>> local stack = []
>> A.createPackage() : ??#63 26:17-26:64
>> local variables = {process02=OUT!MyProcess02,
>> process01=OUT!MyProcess01, self=aml2xpdl : ASMModule,
>> package=OUT!MyPackage}
>> local stack = []
>> NativeOperation public static void
>> org.atl.engine.vm.nativelib.ASMOclAny.output(org.atl.engine. vm.StackFrame,org.atl.engine.vm.nativelib.ASMOclAny)
>>
>> args = [aml2xpdl : ASMModule, 1]
>> ****** END Stack Trace
>> Execution terminated due to error (see launch configuration to allow
>> continuation after errors).
>>
>> Any idea what to do? I'm not sure but it seems to me as the helper works.
>>
>> Greetings
>>
>> Erik
>>
>> Frédéric Jouault schrieb:
>>> Hello Erik,
>>>
>>> You probably want to replace '' by ms :-).
>>>
>>>
>>> Best regards,
>>>
>>> Frédéric Jouault
>>>
>>> Erik Becker wrote:
>>>> Hello,
>>>>
>>>> model is 'm' and should be the 'iterator'.
>>>> This was a mistake in my posting, that happened while replacing
>>>> 'model' by 'm'. Sorry! In my transformation file it's correct and
>>>> looks as followed:
>>>>
>>>> helper def : getModels : Sequence(XML!Element) =
>>>> let allModels : Sequence(XML!Element) =
>>>> XML!Element.allInstances()->asSequence() in
>>>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>>>> if m.name = 'Model'
>>>> then
>>>> ms.append(m)
>>>> else
>>>> ''
>>>> endif
>>>> );
>>>>
>>>> Now any idea why it doesn't work?
>>>>
>>>> Greetings
>>>>
>>>> Erik
>>>>
>>>> Éric Vépa schrieb:
>>>>> Hi Erik,
>>>>>
>>>>> What is 'model' used at line "if model.name = 'Model'" ?
>>>>>
>>>>> Erik Becker wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I'm new to ATL and fighting with it's peculiarities. ;-)
>>>>>>
>>>>>> I want to create a collection (Sequence) of special elements from
>>>>>> a XML. Therefore I wrote this helper:
>>>>>>
>>>>>> helper def : getModels : Sequence(XML!Element) =
>>>>>> let allModels : Sequence(XML!Element) =
>>>>>> XML!Element.allInstances()->asSequence() in
>>>>>> allModels->iterate(m; ms : Sequence(XML!Element) = Sequence{} |
>>>>>> if model.name = 'Model'
>>>>>> then
>>>>>> ms.append(m)
>>>>>> else
>>>>>> ''
>>>>>> endif
>>>>>> );
>>>>>>
>>>>>> If I use this helper (just printing the sequence's size with
>>>>>> output) I get the following:
>>>>>> ****** BEGIN Stack Trace
>>>>>> message: ERROR: could not find operation append on String
>>>>>> having supertypes: [OclAny]
>>>>>> A.main() : ??#22 null
>>>>>> local variables = {self=aml2xpdl : ASMModule}
>>>>>> local stack = []
>>>>>> A.__initgetModels() : ??#23 8:46-8:66
>>>>>> local variables = {model=IN!Model, models='', self=aml2xpdl :
>>>>>> ASMModule, allModels=Sequence {IN!LogFont, IN!FontNode,
>>>>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjDef, IN!Brush, IN!Size,
>>>>>> IN!AttrValue, IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!GUID,
>>>>>> IN!AttrDef, IN!Brush, IN!GUID, IN!AttrValue, IN!AttrDef,
>>>>>> IN!AttrValue, IN!AttrDef, IN!FontNode, IN!FontStyleSheet,
>>>>>> IN!AttrValue, IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrDef,
>>>>>> IN!AttrValue, IN!FontNode, IN!ObjDef, IN!AttrValue, IN!AttrValue,
>>>>>> IN!AttrDef, IN!GUID, IN!Lane, IN!AttrOcc, IN!Pen,
>>>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!Pen, IN!FontNode,
>>>>>> IN!AttrValue, IN!AttrDef, IN!FontNode, IN!CxnOcc,
>>>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrDef, IN!AttrValue,
>>>>>> IN!AttrDef, IN!ObjDef, IN!AttrDef, IN!Position, IN!Size,
>>>>>> IN!AttrValue, IN!FontStyleSheet, IN!AttrValue, IN!Pen, IN!GUID,
>>>>>> IN!AttrValue, IN!CxnOcc, IN!GUID, IN!Pen, IN!CxnOcc, IN!Position,
>>>>>> IN!Size, IN!AttrValue, IN!AttrDef, IN!Brush, IN!AttrValue,
>>>>>> IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrValue, IN!FontNode,
>>>>>> IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrValue, IN!ObjDef,
>>>>>> IN!Flag, IN!GUID, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>>>> IN!AttrDef, IN!CxnDef, IN!AttrDef, IN!AML, IN!ObjOcc, IN!Size,
>>>>>> IN!Position, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>>>> IN!AttrValue, IN!Position, IN!AttrDef, IN!Pen, IN!Model,
>>>>>> IN!AttrValue, IN!CxnOcc, IN!FontStyleSheet, IN!Position, IN!Pen,
>>>>>> IN!AttrValue, IN!AttrDef, IN!Position, IN!AttrDef,
>>>>>> IN!FontStyleSheet, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>>>> IN!Brush, IN!ObjOcc, IN!AttrDef, IN!CxnDef, IN!GUID, IN!ObjOcc,
>>>>>> IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!Position, IN!FontNode,
>>>>>> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>>>> IN!GUID, IN!AttrDef, IN!Pen, IN!AttrValue, IN!AttrDef,
>>>>>> IN!AttrValue, IN!Position, IN!FontStyleSheet, IN!FontStyleSheet,
>>>>>> IN!GUID, IN!FontNode, IN!AttrValue, IN!AttrValue, IN!Position,
>>>>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!AttrValue, IN!GUID,
>>>>>> IN!FontStyleSheet, IN!FontNode, IN!CxnOcc, IN!AttrValue,
>>>>>> IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue,
>>>>>> IN!Brush, IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>>>> IN!Size, IN!Pen, IN!ObjOcc, IN!AttrDef, IN!GUID, IN!FontNode,
>>>>>> IN!Size, IN!GUID, IN!GUID, IN!Position, IN!FontStyleSheet,
>>>>>> IN!FontStyleSheet, IN!AttrValue, IN!AttrDef, IN!CxnDef, IN!CxnDef,
>>>>>> IN!Brush, IN!AttrValue, IN!Position, IN!AttrDef, IN!AttrDef,
>>>>>> IN!Position, IN!ObjDef, IN!Size, IN!AttrValue, IN!AttrValue,
>>>>>> IN!AttrValue, IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrOcc,
>>>>>> IN!AttrDef, IN!AttrValue, IN!FontNode, IN!AttrValue, IN!AttrValue,
>>>>>> IN!Pen, IN!AttrValue, IN!FontNode, IN!Brush, IN!ObjDef,
>>>>>> IN!AttrDef, IN!FontStyleSheet, IN!AttrDef, IN!AttrOcc,
>>>>>> IN!AttrValue, IN!AttrDef, IN!GUID, IN!GUID, IN!AttrDef, IN!GUID,
>>>>>> IN!Position, IN!GUID, IN!AttrDef, IN!Pen, IN!ObjDef, IN!Position,
>>>>>> IN!AttrDef, IN!AttrDef, IN!Pen, IN!AttrValue, IN!AttrValue,
>>>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!Language, IN!AttrValue,
>>>>>> IN!AttrValue, IN!AttrOcc, IN!AttrValue, IN!FontNode, IN!FontNode,
>>>>>> IN!FontNode, IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrDef,
>>>>>> IN!AttrValue, IN!AttrValue, IN!Brush, IN!AttrDef, IN!AttrDef,
>>>>>> IN!AttrDef, IN!Position, IN!AttrDef, IN!AttrDef, IN!AttrValue,
>>>>>> IN!AttrDef, IN!Brush, IN!AttrValue, IN!FontNode, IN!FontNode,
>>>>>> IN!FontNode, IN!Position, IN!AttrValue, IN!AttrValue, IN!GUID,
>>>>>> IN!ObjOcc, IN!CxnDef, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>>>> IN!Position, IN!AttrDef, IN!Position, IN!AttrValue, IN!AttrDef,
>>>>>> IN!AttrValue, IN!AttrDef, IN!GUID, IN!AttrValue, IN!AttrValue,
>>>>>> IN!Header-Info, IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef,
>>>>>> IN!AttrValue, IN!FontNode, IN!AttrDef, IN!AttrValue, IN!AttrDef,
>>>>>> IN!Pen, IN!Position, IN!AttrDef, IN!GUID, IN!GUID, IN!Brush,
>>>>>> IN!FontStyleSheet, IN!AttrDef, IN!ObjOcc, IN!FontNode, IN!Pen,
>>>>>> IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrValue,
>>>>>> IN!AttrValue, IN!AttrValue, IN!GUID, IN!AttrDef, IN!AttrDef,
>>>>>> IN!AttrValue, IN!GUID, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>>>>> IN!AttrValue, IN!CxnOcc, IN!GUID, IN!AttrValue, IN!AttrDef,
>>>>>> IN!Position, IN!AttrDef, IN!FontStyleSheet, IN!AttrDef,
>>>>>> IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!AttrDef,
>>>>>> IN!GUID, IN!AttrDef, IN!FontNode, IN!AttrOcc, IN!Lane, IN!AttrDef,
>>>>>> IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef, IN!GUID,
>>>>>> IN!AttrValue, IN!ObjOcc, IN!AttrDef, IN!AttrDef, IN!AttrDef,
>>>>>> IN!AttrDef, IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrValue,
>>>>>> IN!AttrDef, IN!AttrDef, IN!GUID, IN!AttrDef, IN!Position,
>>>>>> IN!AttrValue, IN!AttrDef, IN!AttrValue, IN!GUID, IN!Pen,
>>>>>> IN!AttrValue, IN!GUID, IN!AttrValue, IN!AttrValue, IN!AttrDef,
>>>>>> IN!FontStyleSheet, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>>>>> IN!AttrDef, IN!AttrDef, IN!AttrValue, IN!AttrValue, IN!AttrDef,
>>>>>> IN!AttrDef, IN!AttrValue, IN!GUID, IN!AttrValue, IN!CxnDef,
>>>>>> IN!AttrValue, IN!AttrValue, IN!ObjDef, IN!AttrDef, IN!AttrValue,
>>>>>> IN!AttrValue, IN!ObjDef, IN!Pen, IN!AttrDef, IN!Position, IN!Size,
>>>>>> IN!AttrOcc, IN!AttrDef, IN!GUID, IN!GUID, IN!AttrValue,
>>>>>> IN!AttrDef, IN!AttrValue, IN!AttrDef, IN!CxnOcc, IN!AttrDef,
>>>>>> IN!FontStyleSheet, IN!AttrValue, IN!CxnOcc, IN!Position, IN!Group,
>>>>>> IN!AttrDef, IN!GUID, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>>>>> IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!AttrDef, IN!FontStyleSheet,
>>>>>> IN!AttrDef, IN!GUID, IN!Position, IN!FontNode, IN!AttrValue,
>>>>>> IN!AttrDef, IN!Size, IN!GUID, IN!AttrValue, IN!GUID, IN!GUID,
>>>>>> IN!AttrDef, IN!AttrValue, IN!Position, IN!AttrDef, IN!AttrDef,
>>>>>> IN!CxnDef, IN!Pen, IN!AttrValue, IN!AttrValue, IN!Pen,
>>>>>> IN!FontStyleSheet, IN!AttrDef, IN!FontNode, IN!Position,
>>>>>> IN!FontStyleSheet, IN!AttrValue, IN!FontNode, IN!ObjOcc,
>>>>>> IN!AttrValue, IN!LanguageName, IN!GUID, IN!AttrOcc, IN!Database,
>>>>>> IN!AttrDef, IN!CxnDef, IN!AttrDef, IN!CxnOcc, IN!FontStyleSheet,
>>>>>> IN!AttrValue, IN!GUID, IN!FontStyleSheet, IN!AttrDef, IN!AttrDef,
>>>>>> IN!Pen, IN!AttrValue, IN!AttrValue, IN!AttrValue, IN!AttrDef,
>>>>>> IN!GUID, IN!AttrOcc, IN!AttrDef, IN!AttrValue, IN!AttrValue,
>>>>>> IN!Brush, IN!Pen, IN!GUID, IN!AttrValue, IN!Position}}
>>>>>> local stack = [aml2xpdl : ASMModule]
>>>>>> ****** END Stack Trace
>>>>>> Execution terminated due to error (see launch configuration to
>>>>>> allow continuation after errors).
>>>>>>
>>>>>> Can anyone help? I can't find what's wrong.
>>>>>>
>>>>>> Thanks and Greetings
>>>>>>
>>>>>> Erik
>>>>>
>>>>>
Re: [ATL] How to create o Sequence / Collection of model elements [message #41951 is a reply to message #41920] Fri, 25 May 2007 15:53 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

>> OclAny.output() : Void prints its source on the console. It does not
>> take any argument.
>
> Okay, a simple look in the manual could help. Sorry for that.

The error message states that you are using a wrong number of arguments,
and if you go at the bottom of the stack trace, you can see that it is
when calling OclAny.output().

I guess I should include the name of the operation in the error message,
so that you do not need to skip all this Java exception trace before
having to skip all the ATL stack trace ;-). I just added this to my TODO
list.

Thanks for your feedback.


Best regards,

Frédéric Jouault
Re: [ATL] How to create o Sequence / Collection of model elements [message #41982 is a reply to message #41951] Fri, 25 May 2007 16:02 Go to previous message
Eclipse UserFriend
Originally posted by: erik_becker.gmx.de

You're welcome. And thanks too! It now works.

Nice weekend

Erik

Frédéric Jouault schrieb:
> Hello,
>
> >> OclAny.output() : Void prints its source on the console. It does not
> >> take any argument.
> >
> > Okay, a simple look in the manual could help. Sorry for that.
>
> The error message states that you are using a wrong number of arguments,
> and if you go at the bottom of the stack trace, you can see that it is
> when calling OclAny.output().
>
> I guess I should include the name of the operation in the error message,
> so that you do not need to skip all this Java exception trace before
> having to skip all the ATL stack trace ;-). I just added this to my TODO
> list.
>
> Thanks for your feedback.
>
>
> Best regards,
>
> Frédéric Jouault
Previous Topic:[ATL] How to transform a Model contain in a XML document
Next Topic:[ATL] Compile ATL outside Eclipse
Goto Forum:
  


Current Time: Mon Jan 25 14:16:45 GMT 2021

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

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

Back to the top