| [ATL] Containment references cannot span across models [message #989468] |
Thu, 06 December 2012 05:46  |
Leonid Ripeynih Messages: 42 Registered: February 2012 |
Member |
|
|
Hi!
I've run into a problem using ATL:
I have a source meta-model (UML), and my target meta-model. Meta model is basically split into two: a common part, used by other models, and one of the concrete models.
Here is failing rule.
lazy rule createConetnt {
from
clazz: UML!Class
to
ds: Desc!ContentElem (
table1 <- thisModule.contentTable(clazz.name),
nestedFieldset <- thisModule.createNestedFieldSet(clazz),
table <- UML!Association.allInstances() -> select(
acc | acc.endType.first().name.endsWith(clazz.name)
)
)
}
rule createTableFromAssociation {
from
ass: UML!Association
to
table: FieldSet!TableElem (
id <- ass.endType.first().name,
desc <- ass.endType.first().name,
type <- ass.endType.first().name
)
}
It's falinig setting table with:
Cannot set feature table to value [org.eclipse.emf.ecore.impl.DynamicEObjectImpl@4a31a39e (eClass: org.eclipse.emf.ecore.impl.EClassImpl@7cf1f9d3 (name: TableElem) (instanceClassName: null) (abstract: false, interface: false))], containment references cannot span across models.
Both nestedFieldset and table feature type belongs to the 'common' metamodel. Is there any way to solve it? I hope it's a common problem, becouse keeping everything in one (very) doesn't looks like very good idea. Thanks in advance.
|
|
|
| Re: [ATL] Containment references cannot span across models [message #989491 is a reply to message #989468] |
Thu, 06 December 2012 08:30   |
Hugo Bruneliere Messages: 460 Registered: July 2009 |
Senior Member |
|
|
Hello,
When you run your ATL transformation (via a launch configuration or programmatically), do you set the "Allow inter-model references" parameter to true?
If no, this could be a potential source for your issue.
Best regards,
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
| Re: [ATL] Containment references cannot span across models [message #989546 is a reply to message #989514] |
Thu, 06 December 2012 11:53   |
Hugo Bruneliere Messages: 460 Registered: July 2009 |
Senior Member |
|
|
In ATL, you can set references between elements from different models as long as these references are not containment references.
In your case, the Desc!ContentElem element actually contains FieldSet!TableElem elements via the table reference. So these two types of elements cannot be in different models.
If the table reference was not a containment reference, this should work.
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
|
|
| Re: [ATL] Containment references cannot span across models [message #989963 is a reply to message #989837] |
Mon, 10 December 2012 04:42  |
Hugo Bruneliere Messages: 460 Registered: July 2009 |
Senior Member |
|
|
Hello,
Thus it seems that the current content assist version does not support auto-completion for elements coming from indirectly referred metamodels.
You could raise an ATL bug to keep track of this.
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
Powered by
FUDForum. Page generated in 0.02167 seconds