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.InternetApplicationImpl)
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