Is there a way to improve the performance of my ATL transformation, that to perform the injection in a Java XMI model does it in 223 seconds ?
This is the code:
rule createStatement {
from
imd : java!MethodDeclaration(
--seleziono i metodi che hanno l'annotation
imd.annotations -> exists(a | a.type.type.name='Annotation')
)
to
do{
--ciclo per ogni elemento di tipo SQLQuery che identifica una singola query
for (elemXMLSQL in xml!Element.allInstances()-> select(e | e.name = 'SQLQuery')) {
-- importante operazione di controllo del valore dell'annotation con il nome della query
if(imd.annotations.first().values.first().value.escapedValue.toString().endsWith(elemXMLSQL.getAttrVal('name').concat('"'))){
if(elemXMLSQL.getAttrVal('type').endsWith('SIMPLE_SELECT')){
imd.body.statements <- imd.body.statements -> append(thisModule.createHashMapParams(imd));
for (elemXMLParams in elemXMLSQL.getChildren(Sequence{'params'})) {
for (elemXMLParam in elemXMLParams.getChildren(Sequence{'param'})) {
imd.body.statements <- imd.body.statements -> append(thisModule.createStatementParams(imd, elemXMLParam));
}
}
--instanzio una nuova hashmap per gli into
imd.body.statements <- imd.body.statements -> append(thisModule.createHashMapIntos(imd, elemXMLSQL));
--generazione del blocco if
imd.body.statements <- imd.body.statements -> append(thisModule.createIfStatementIntos(imd, elemXMLSQL));
--mRT.performThrough(controlloSqlcode, exControlloSqlcode) ;
imd.body.statements <- imd.body.statements -> append(thisModule.createStatementPerformThrough(imd));
}
}
}
}
}
thank you so much
[Updated on: Wed, 06 June 2012 08:43]
Report message to a moderator