[ATL] external parameters [message #660038] |
Wed, 16 March 2011 11:51 |
Eclipse User |
|
|
|
Hi all,
I'm trying to use external parameters in ATL transformation through XML file, but I got this error
org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: OclUndefined.getStringAttrValue(java.lang.String)
at getParameter#36(transPara1.atl[19:1-22:39])
module transPara1;
create OUT : UML from IN : UML, parameters : XML;
helper def : sourceValue : String = thisModule.getParameter('ss:Width');
helper def : getParameter(attributeName : String) : String =
XML!Element.allInstancesFrom('parameters')->select
(m|m.name = 'children')->select(a|a.getStringAttrValue('name')= attributeName)->first().getStringAttrValue('value');
helper context XML!Element def: getStringAttrValue(attrName : String) : String =
let eltC : Sequence(XML!Attribute) =
self.children->select(a | a.oclIsTypeOf(XML!Attribute) and a.name = attrName)->asSequence() in
if eltC->notEmpty()
then eltC->first().value
Else ''
endif;
Part of the parameters file:
<children xsi:type="Element" startLine="6" startColumn="33" endLine="6" endColumn="33" name="Column">
<children xsi:type="Attribute" name="ss:Width" value="150.0"/>
</children>
Does anyone know why this Element is undefined?
Any hint will be appreciated,
Sally
|
|
|
Powered by
FUDForum. Page generated in 0.02713 seconds