Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] output model should have a reference to an element of the input model
[ATL] output model should have a reference to an element of the input model [message #517779] Tue, 02 March 2010 02:10 Go to next message
Simon is currently offline SimonFriend
Messages: 13
Registered: October 2009
Junior Member
Hey,

I tried to create through an ATL transformation an output model, which should still have a reference to an element in the input model. It looks like this does not work. Is there a way to do this?

I used the following code, without a result. The transformation should hold the reference to the CompanyCore in resourceUsage

create OUT : MDBPEDepartmentParameter from IN : MDBPECompanyParameter, CompanyCore: MDBPECompanyCore;
rule WorkingTimeDemand {
	from
	    i : MDBPECompanyParameter!WorkingTimeDemand 
	to
           o : MDBPEDepartmentParameter!WorkingTimeDemand (
			relatedScenario <- i.relatedScenario,
			resourceUsage <- MDBPECompanyCore!Company->allInstancesFrom('CompanyCore')->asSequence()
			)
}


Any suggestions are welcome
Re: [ATL] output model should have a reference to an element of the input model [message #518278 is a reply to message #517779] Wed, 03 March 2010 16:25 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060603030800020900060502
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

To make a reference between models, you have to check the "allow
inter-model references" checkbox in the Advanced tab of the launch
configuration.

Best regards,

William

Le 02/03/2010 03:11, Simon a écrit :
> Hey,
>
> I tried to create through an ATL transformation an output model, which
> should still have a reference to an element in the input model. It looks
> like this does not work. Is there a way to do this?
>
> I used the following code, without a result. The transformation should
> hold the reference to the CompanyCore in resourceUsage
>
>
> create OUT : MDBPEDepartmentParameter from IN : MDBPECompanyParameter,
> CompanyCore: MDBPECompanyCore;
> rule WorkingTimeDemand {
> from
> i : MDBPECompanyParameter!WorkingTimeDemand to
> o : MDBPEDepartmentParameter!WorkingTimeDemand (
> relatedScenario <- i.relatedScenario,
> resourceUsage <-
> MDBPECompanyCore!Company->allInstancesFrom('CompanyCore')->asSequence()
> )
> }
>
>
> Any suggestions are welcome

--
Ne manquez pas notre prochaine formation ATL inter entreprises:
ATL - Paris - du 14 au 15 avril 2010
Pour plus de dates et pour le détail de cette formation:
http://www.obeo.fr/pages/formations/fr

Don't forget our next ATL training:
ATL - Paris - 2010 April from 14th to 15th
More dates and training program on:
http://www.obeo.fr/pages/formations/fr

--------------060603030800020900060502
Content-Type: text/x-vcard; charset=utf-8;
name="william_piers.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="william_piers.vcf"

YmVnaW46dmNhcmQNCmZuOldpbGxpYW0gUGllcnMNCm46UGllcnM7V2lsbGlh bQ0Kb3JnOk9i
ZW8NCmFkcjoyIHJ1ZSBSb2JlcnQgU2NodW1hbm47O2xvdCAyNDtOQU5URVM7 OzQ0NDA4O0Zy
YW5jZQ0KZW1haWw7aW50ZXJuZXQ6d2lsbGlhbS5waWVyc0BvYmVvLmZyDQp0 aXRsZTpNREEg
Q29uc3VsdGFudA0KdGVsO3dvcms6KzMzICgwKTIgNTEgMTMgNTAgNTMNCnVy bDpodHRwOi8v
d3d3Lm9iZW8uZnINCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K
--------------060603030800020900060502--
Re: [ATL] output model should have a reference to an element of the input model [message #518382 is a reply to message #518278] Wed, 03 March 2010 22:55 Go to previous messageGo to next message
Simon is currently offline SimonFriend
Messages: 13
Registered: October 2009
Junior Member
How can I set this option in javacode? Because I start my translation programmatically.

Thanks Simon
Re: [ATL] output model should have a reference to an element of the input model [message #518830 is a reply to message #518382] Fri, 05 March 2010 08:41 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000100010702020800080903
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

You have to pass the option to the ATL Launcher :

Map options = new HashMap();
options.put("allowInterModelReferences", true);
launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor(),
options, asmURL.openStream());


Le 03/03/2010 23:55, Simon a écrit :
> How can I set this option in javacode? Because I start my translation
> programmatically.
>
> Thanks Simon

--
Ne manquez pas notre prochaine formation ATL inter entreprises:
ATL - Paris - du 14 au 15 avril 2010
Pour plus de dates et pour le détail de cette formation:
http://www.obeo.fr/pages/formations/fr

Don't forget our next ATL training:
ATL - Paris - 2010 April from 14th to 15th
More dates and training program on:
http://www.obeo.fr/pages/formations/fr

--------------000100010702020800080903
Content-Type: text/x-vcard; charset=utf-8;
name="william_piers.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="william_piers.vcf"

YmVnaW46dmNhcmQNCmZuOldpbGxpYW0gUGllcnMNCm46UGllcnM7V2lsbGlh bQ0Kb3JnOk9i
ZW8NCmFkcjoyIHJ1ZSBSb2JlcnQgU2NodW1hbm47O2xvdCAyNDtOQU5URVM7 OzQ0NDA4O0Zy
YW5jZQ0KZW1haWw7aW50ZXJuZXQ6d2lsbGlhbS5waWVyc0BvYmVvLmZyDQp0 aXRsZTpNREEg
Q29uc3VsdGFudA0KdGVsO3dvcms6KzMzICgwKTIgNTEgMTMgNTAgNTMNCnVy bDpodHRwOi8v
d3d3Lm9iZW8uZnINCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K
--------------000100010702020800080903--
Re: [ATL] output model should have a reference to an element of the input model [message #522638 is a reply to message #518830] Tue, 23 March 2010 13:14 Go to previous messageGo to next message
Simon is currently offline SimonFriend
Messages: 13
Registered: October 2009
Junior Member
Hello William,

thanks for your reply.
I tried it with the "intermodelReferences" option, but still does not work.

My Code for setting the options, running the transformation and extracting the models afterwards look like:


options.put("launcherName", "EMF-specific VM");
options.put("atlCompiler", "atl2006");
options.put("modelHandlers", modelHandlers);
options.put("allowInterModelReferences", true);
URL usedURL = new URL(scriptFile);
launcher.launch("run", currentProgressMonitor, options, usedURL.openStream());

for (ATLTransformationModel model : outputModels) {
				extractors.get(model.getConformsTo().getName()).extract(
						models.get(model.getName()), convertURI(model));
			}


So there are still no references to the input model. What is my mistake?
Simon
Re: [ATL] output model should have a reference to an element of the input model [message #522662 is a reply to message #517779] Tue, 23 March 2010 14:14 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
try options.put("allowInterModelReferences", "true");
Re: [ATL] output model should have a reference to an element of the input model [message #522800 is a reply to message #522662] Tue, 23 March 2010 22:59 Go to previous message
Simon is currently offline SimonFriend
Messages: 13
Registered: October 2009
Junior Member
Thanks a lot, works great.
Previous Topic:[ATL] multiple target & navigation in model
Next Topic:[ATL][AML] Obtaining AML plugins
Goto Forum:
  


Current Time: Thu Apr 25 15:12:52 GMT 2024

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

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

Back to the top