Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Add new transformed record to the end of the file
Add new transformed record to the end of the file [message #1726365] Fri, 11 March 2016 20:11 Go to next message
Yi Zhu is currently offline Yi ZhuFriend
Messages: 9
Registered: March 2016
Location: Boston
Junior Member
Dear All,

I use qurery to create a new file function.dats, because the inputmodel includes 8 records, so the query execute 8 times according to the input model, but what I get in the new file is the last record . How can I get all records in the new file? in other words, How can I add new transformed record to the end of the file? Please help me. Thanks in advanced. The rule is showed below.

query XMI2ATS = Functions!Clause.allInstances()->select(e | e.oclIsTypeOf(Functions!Clause))->flatten()->forAll(x | x.toString2().writeTo('./runtime-workbench-workspace/XMI2ATS/function.dats'));

helper context Functions!Clause def: toString2() : String =
'| ' + self.clause + ' ' + self.pattern + ' ' + '=>' + self.expression + '\n' ;


YI ZHU

[Updated on: Fri, 11 March 2016 20:53]

Report message to a moderator

Re: Add new transformed record to the end of the file [message #1726541 is a reply to message #1726365] Mon, 14 March 2016 14:23 Go to previous messageGo to next message
Yi Zhu is currently offline Yi ZhuFriend
Messages: 9
Registered: March 2016
Location: Boston
Junior Member
Dear All,

I have tried many ways, but I can not solve this problem. I'm eager for your help. Thanks.


YI ZHU
Re: Add new transformed record to the end of the file [message #1726627 is a reply to message #1726541] Tue, 15 March 2016 08:50 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 351
Registered: September 2012
Location: Belgium
Senior Member

You're overwriting the same file for each Functions!Clause.

Cheers,
Dennis
Re: Add new transformed record to the end of the file [message #1726851 is a reply to message #1726627] Thu, 17 March 2016 01:47 Go to previous message
Yi Zhu is currently offline Yi ZhuFriend
Messages: 9
Registered: March 2016
Location: Boston
Junior Member
Thanks Dennis, I am trying other ways.

YI ZHU
Previous Topic:HowTo use meta model class as type or parameter
Next Topic:Make a function with parameter output
Goto Forum:
  


Current Time: Thu Nov 23 07:44:58 GMT 2017

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

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