[ATL] Applying Profile and Stereotypes in the Output Model [message #642583] |
Wed, 01 December 2010 20:36 |
Pejman Messages: 18 Registered: June 2010 |
Junior Member |
|
|
Hi everyone,
I have two profiles (PA) and (PB). Each one has a single stereotype let say A and B. I want to simply transform an instance of PA to an instance of PB meanwhile transforming all instances of stereotype A to the instances of Stereotype B.
So I came up with the code below:
module T;
create OUT : MM1 from IN : MM;
rule init {
from s: MM! Package
to t: MM1! Package(
name <- 'root')
do {
t.applyProfile(OUT!Profile.allInstances()->select(p | p.name ='PB').first());
}
}
rule main{
from s: MM! Class(s.getAppliedStereotypes()->collect(st | st.name) ->at(1) ='A')
to t: MM1! Class(
name<- 'Target'
)
do {
t.applyStereotype('PB::B');
}
}
It gives me the following exception
"org.eclipse.m2m.atl.core.emf.EMFModel cannot be cast to org.eclipse.m2m.atl.core.IReferenceModel"
Could anyone help.
Thanks in advance
[Updated on: Wed, 01 December 2010 20:36] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03431 seconds