Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] OrderedSet.indexOf operation not found
[ATL] OrderedSet.indexOf operation not found [message #482283] Wed, 26 August 2009 05:00 Go to next message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
Hi,

I am working on an ATL template that has the following helper definition:

helper context OclAny def: getElementId() :
String = 'http://openiaml.org/simple#test' +
if simple!EObject.allInstancesFrom('IN')->includes(self)
then simple!EObject.allInstancesFrom('IN')->indexOf(self)->toString()
else 'unknown'
endif;

The idea behind this template is that I can get a unique ID of an
element based on its absolute position. However, if I use this against
an EMF model, I get the following exception message:

Operation not found: OrderedSet
{...}.indexOf(org.openiaml.model.owl.simple.simple.impl.Inte rnetApplicationImpl)

If I instead convert this OrderedSet into a Sequence as follows, the ATL
template works without any errors:


simple!EObject.allInstancesFrom('IN')->asSequence()->indexOf(self)- >toString()

This wasn't expected, considering the ATL User Guide [1] says
OrderedSet.indexOf(o : oclAny) is supported.

Is this expected behaviour? Is any EObject an oclAny? Or is this a
problem with the documentation?

Thanks!

Jevon

[1]: http://wiki.eclipse.org/ATL/User_Guide#OrderedSet_data_type_ operations
Re: [ATL] OrderedSet.indexOf operation not found [message #482441 is a reply to message #482283] Wed, 26 August 2009 14:12 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

This operation seems to be unimplemented, so it is a bug. Could you
report it ?

Thanks in advance,

William

Jevon Wright a écrit :
> Hi,
>
> I am working on an ATL template that has the following helper definition:
>
> helper context OclAny def: getElementId() :
> String = 'http://openiaml.org/simple#test' +
> if simple!EObject.allInstancesFrom('IN')->includes(self)
> then simple!EObject.allInstancesFrom('IN')->indexOf(self)->toString()
> else 'unknown'
> endif;
>
> The idea behind this template is that I can get a unique ID of an
> element based on its absolute position. However, if I use this against
> an EMF model, I get the following exception message:
>
> Operation not found: OrderedSet
> {...}.indexOf(org.openiaml.model.owl.simple.simple.impl.Inte rnetApplicationImpl)
>
>
> If I instead convert this OrderedSet into a Sequence as follows, the ATL
> template works without any errors:
>
>
> simple!EObject.allInstancesFrom('IN')->asSequence()->indexOf(self)- >toString()
>
>
> This wasn't expected, considering the ATL User Guide [1] says
> OrderedSet.indexOf(o : oclAny) is supported.
>
> Is this expected behaviour? Is any EObject an oclAny? Or is this a
> problem with the documentation?
>
> Thanks!
>
> Jevon
>
> [1]: http://wiki.eclipse.org/ATL/User_Guide#OrderedSet_data_type_ operations
Re: [ATL] OrderedSet.indexOf operation not found [message #482552 is a reply to message #482441] Thu, 27 August 2009 02:42 Go to previous message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
Hi,

Thanks for the information, the bug has been submitted:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=287768

Cheers!

Jevon

William Piers wrote:
> Hello,
>
> This operation seems to be unimplemented, so it is a bug. Could you
> report it ?
>
> Thanks in advance,
>
> William
>
> Jevon Wright a écrit :
>> Hi,
>>
>> I am working on an ATL template that has the following helper definition:
>>
>> helper context OclAny def: getElementId() :
>> String = 'http://openiaml.org/simple#test' +
>> if simple!EObject.allInstancesFrom('IN')->includes(self)
>> then simple!EObject.allInstancesFrom('IN')->indexOf(self)->toString()
>> else 'unknown'
>> endif;
>>
>> The idea behind this template is that I can get a unique ID of an
>> element based on its absolute position. However, if I use this against
>> an EMF model, I get the following exception message:
>>
>> Operation not found: OrderedSet
>> {...}.indexOf(org.openiaml.model.owl.simple.simple.impl.Inte rnetApplicationImpl)
>>
>>
>> If I instead convert this OrderedSet into a Sequence as follows, the
>> ATL template works without any errors:
>>
>>
>> simple!EObject.allInstancesFrom('IN')->asSequence()->indexOf(self)- >toString()
>>
>>
>> This wasn't expected, considering the ATL User Guide [1] says
>> OrderedSet.indexOf(o : oclAny) is supported.
>>
>> Is this expected behaviour? Is any EObject an oclAny? Or is this a
>> problem with the documentation?
>>
>> Thanks!
>>
>> Jevon
>>
>> [1]:
>> http://wiki.eclipse.org/ATL/User_Guide#OrderedSet_data_type_ operations
Previous Topic:[ATL]How to add a binding in if-else statement
Next Topic:Unsupported registration: QS
Goto Forum:
  


Current Time: Thu Apr 25 10:15:18 GMT 2024

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

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

Back to the top