Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [ATL] Containment references cannot span across models(Meta-model in split in two ecore files.)
[ATL] Containment references cannot span across models [message #989468] Thu, 06 December 2012 10:46 Go to next message
Leonid Ripeynih is currently offline Leonid Ripeynih
Messages: 105
Registered: February 2012
Senior 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 13:30 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
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 #989514 is a reply to message #989491] Thu, 06 December 2012 14:57 Go to previous messageGo to next message
Leonid Ripeynih is currently offline Leonid Ripeynih
Messages: 105
Registered: February 2012
Senior Member
Yes, I've set it.
Re: [ATL] Containment references cannot span across models [message #989546 is a reply to message #989514] Thu, 06 December 2012 16:53 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
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 #989556 is a reply to message #989546] Thu, 06 December 2012 17:38 Go to previous messageGo to next message
Leonid Ripeynih is currently offline Leonid Ripeynih
Messages: 105
Registered: February 2012
Senior Member
Let me clarify a bit. It's meta models are split, not the models, In fact, in normal (de)serrializaion they're put together:
<content>
 <table id="some_id">
 ...
</content>


I have solved this issue by removing references to FieldSet and just writing
Desc!TableElem


What's interesting, ATL IDE itself detects (in popup) the table type as Desc!TableElem (as Desc meta-model referencing FieldSet meta-model). But, here is still little problem: i have no context assis for that Desc![FieldSetFeatures].

Can you help me understand, what's going on?
Re: [ATL] Containment references cannot span across models [message #989667 is a reply to message #989556] Fri, 07 December 2012 09:06 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
Registered: July 2009
Senior Member
What do you mean by Desc![FieldSetFeatures]? Is it another type of element from your metamodel?

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 #989837 is a reply to message #989667] Sat, 08 December 2012 07:18 Go to previous messageGo to next message
Leonid Ripeynih is currently offline Leonid Ripeynih
Messages: 105
Registered: February 2012
Senior Member
No.

Desc meta-model is referensing FieldSet meta-model. So, I just meant Desc! and then feature names from FieldSet meta model. Like, Desc!NestedFieldSet, having NestedFieldSet actually defined in FieldSet meta-model.
Re: [ATL] Containment references cannot span across models [message #989963 is a reply to message #989837] Mon, 10 December 2012 09:42 Go to previous message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
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
------------------------------------------
Previous Topic:Stack size limitation in EMF-specific VM
Next Topic:missing metdamodel
Goto Forum:
  


Current Time: Thu Oct 23 04:43:10 GMT 2014

Powered by FUDForum. Page generated in 0.07129 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software