Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATL does not resolve proxies into another model
ATL does not resolve proxies into another model [message #517564] Mon, 01 March 2010 11:00 Go to next message
Simon is currently offline SimonFriend
Messages: 13
Registered: October 2009
Junior Member
Hello Community,

I try to transform a model element, which has a reference into another model. When I try to access this reference, ATL tells me oclUndefined. I loaded also the other model in the ATL Transformation but it still does not work.

http://firehawkentertainment.de/packages.jpg

In the picture you see how the metamodels are defined.
There is one metamodel core, containing a Resource and a Scenario.

Another metamodel Parameter containing a Step.
Then there are metamodels MDBPECompanyCore refining Resource and two metamodels MDBPECompanyParameter and MDBPEDepartmentParameter refining Step

I have three models.
One Model contains the Company and a Scenario.
Another Model contains the Element WorkingTimeDemand from the Metamodel MDBPECompanyParameter and a reference to the Scenario in the first Model through "relatedScenario".
A third Model should be created with the transformation.

When I load the first and the second model into the ATL Transformation and try to access the Scenario form WorkingTimeDemand through "relatedScenario" the Reference cannot be resolved. The debug information of ATL tells me that "relatedScenario" is from type "<unknown>!<unnamed>:MDBPEDepartmentParameter!Scenario" which looks like, ATL try to locate the Scenario in themetamodel of MDBPEDepartmentParameter

Any ideas, why ATL cannot resolve the reference?
Thanks Simon
Re: ATL does not resolve proxies into another model [message #517576 is a reply to message #517564] Mon, 01 March 2010 11:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Simon,

The most common reason for proxies failing to resolve loading the
resource with a URI that isn't absolute, i.e., isn't one that starts
with a scheme/protocol. Relative references within a resource need to
be resolved against the URI of the containing resource and URI
resolution is only defined for resolving a relative URI against an
absolute URI. Be sure you're using something like
file:/c:/path/file.extension or
platform:/resource/project/path/file.extension.


Simon wrote:
> Hello Community,
>
> I try to transform a model element, which has a reference into another
> model. When I try to access this reference, ATL tells me oclUndefined.
> I loaded also the other model in the ATL Transformation but it still
> does not work.
>
>
>
> In the picture you see how the metamodels are defined.
> There is one metamodel core, containing a Resource and a Scenario.
>
> Another metamodel Parameter containing a Step.
> Then there are metamodels MDBPECompanyCore refining Resource and two
> metamodels MDBPECompanyParameter and MDBPEDepartmentParameter refining
> Step
>
> I have three models.
> One Model contains the Company and a Scenario.
> Another Model contains the Element WorkingTimeDemand from the
> Metamodel MDBPECompanyParameter and a reference to the Scenario in the
> first Model through "relatedScenario".
> A third Model should be created with the transformation.
>
> When I load the first and the second model into the ATL Transformation
> and try to access the Scenario form WorkingTimeDemand through
> "relatedScenario" the Reference cannot be resolved. The debug
> information of ATL tells me that "relatedScenario" is from type
> "<unknown>!<unnamed>:MDBPEDepartmentParameter!Scenario" which looks
> like, ATL try to locate the Scenario in themetamodel of
> MDBPEDepartmentParameter
>
> Any ideas, why ATL cannot resolve the reference?
> Thanks Simon


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ATL does not resolve proxies into another model [message #517584 is a reply to message #517576] Mon, 01 March 2010 12:00 Go to previous messageGo to next message
Simon is currently offline SimonFriend
Messages: 13
Registered: October 2009
Junior Member
Hello Ed,

thanks for your fast reply.
The models are loaded, because if I try to access the model containing scenario and company in the ATL transformation through
(scen in MDBPECompanyCore!Scenario->allInstancesFrom('CompanyCore')) {	
			scen.name.debug();	
		}


it shows me all correct scenarios contained in the model of scenario and company. Just resolving in the other model does not work.
The XMI serialization part for the model with the reference looks like:

<relatedScenario href="Core.mdpe#//@contents.0/@properties.0"/>


so what is my mistake?
Re: ATL does not resolve proxies into another model [message #517586 is a reply to message #517584] Mon, 01 March 2010 12:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Simon,

Comments below.

Simon wrote:
> Hello Ed,
>
> thanks for your fast reply.
> The models are loaded, because if I try to access the model containing
> scenario and company in the ATL transformation through
>
> (scen in MDBPECompanyCore!Scenario->allInstancesFrom('CompanyCore')) {
> scen.name.debug();
> }
>
>
> it shows me all correct scenarios contained in the model of scenario
> and company. Just resolving in the other model does not work.
> The XMI serialization part for the model with the reference looks like:
>
>
> <relatedScenario href="Core.mdpe#//@contents.0/@properties.0"/>
>
Yes, that's exactly the problem. The model will appear to load, because
the relative URI you started with is interpreted as a file system path
relative to the current working directly, but then none of the relative
references within that loaded resource will resolve.
>
> so what is my mistake?
Sounds even more likely to be the fact that you aren't starting with an
absolute URI to load the initial resource. Use URI.createFileURI(new
File(path).getAbsolutePath()) if you're trying to load a file from the
file system.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ATL does not resolve proxies into another model [message #517777 is a reply to message #517586] Tue, 02 March 2010 02:02 Go to previous message
Simon is currently offline SimonFriend
Messages: 13
Registered: October 2009
Junior Member
Hey Ed,

thank you for your help. You are right the problem is related with the wrong resource selection.

When I start through a launch configuration of eclipse, it uses ext: as protocol for external files and I was not able to change it to file: . Now I start the transformation programmatically and it works, because all models are load through the file protocol.

Bye Simon
Previous Topic:QVT relation
Next Topic:not
Goto Forum:
  


Current Time: Thu Mar 28 22:29:47 GMT 2024

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

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

Back to the top