Hello.
I have created a M2M transformation in Xtend , and a respective AOP advice to intercept this transformation:
The purpose of this is to change the port defined, in the normal workflow it is a Signal port, and in the AOP workflow I want it to be a different Port(TerminalPort).
This rule creates the "Actual" metaconcept and locates under the "actual" attribute of vhdlams::Association
create Vhdlams::Association CreateReferenceAssociationForportsFtoS2(Vhdlams::PortMap map,String formal, Hiles::Control Ctrl):
setActual(CreateActualPartForBlocksFtoS2(Ctrl))
;
Defined Transformation, this is the ruled called from the previous rule
create Vhdlams::Actual CreateActualPartForBlocksFtoS2(Hiles::Control Ctrl) :
setPort(Ctrl.to_port.createSignalPort())
;
Defined Aspect
around transformations::hiles::HelpersActual::CreateActualPartForBlocksFtoS2(Hiles::Control Ctrl) :
let resp = new Vhdlams::Actual:
if( some condition )then{
resp.setPort(Ctrl.to_port.createTerminalPort())
}else{
ctx.proceed()
}
;
Everithing seems to work, There are no compiling errors.
But when I execute the workflow, it throws the following Exception:
EvaluationException : Couldn't find operation 'setActual(List)' for Vhdlams::Association.
which is natural because I'm expecting a Vhdlams::Actual not a List[Object]
It seems that the aspect rule is creating a List and not a "Vhdlams::Actual".Even more weird is that if log the returned List there is always one element of type "Vhdlams::Actual"
Can anybody help me, I know a way to solve it would be, to change the rule the following, but it seems not quite correct( band aid, to a bigger Issue)
create Vhdlams::Association CreateReferenceAssociationForportsFtoS2(Vhdlams::PortMap map,String formal, Hiles::Control Ctrl):
setActual(CreateActualPartForBlocksFtoS2(Ctrl).get(0))
;
Instead of that I would like to know why this is happening, is there a problem in the code? or is ti a Bug?
thanks for the help...