Hello,
I had class which inherited from another.
I would like to get mother class' qualifiedName if it exists or 'tis.dos.allocated' if not. I retrieve all mother class' nameSpace and store them in a collecdtion. I iterated that collection to get qualiffiedName but the problem is that it is not allow having properties into a collection.
What Can I do?
Thank you in advance for your help.
Note: bellow the source code and the console output.
********* Source code *********
helper context UML!Class def : getTarget() : Sequence(UML!NamedElement) =
self.generalization->collect(t | t.target);
helper context UML!Class def : getBase() : String =
if self.generalization.notEmpty() then
self.getTarget()->iterate(qualName; n : String = '' |qualName.qualifiedName)
else
'tis.dos.Allocated'
endif;
rule ClassType {
from
c : UML!Class (
c.package.needToGeneratePackage and not
(c.isDataType or c.isExclusiState or c.isCombinedState)
)
to
ct : AllSom!ClassType(
comment <- c.getComment(),
base <- c.getBase().debug(), -- traitement à modifier
name <- c.name
)
}
********* Output console *********
org.eclipse.m2m.atl.engine.emfvm.VMException: Collections do not have properties, use ->collect()
at getBase#13(uml2allsom.atl[122:56-122:78])
local variables: self=IN!PicNavData, n='', qualName=Sequence {IN!PicData}
...
...
...
...
[Updated on: Thu, 04 July 2013 14:05]
Report message to a moderator