Skip to main content



      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 15:11 Go to next message
Eclipse UserFriend
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' ;

[Updated on: Fri, 11 March 2016 15:53] by Moderator

Re: Add new transformed record to the end of the file [message #1726541 is a reply to message #1726365] Mon, 14 March 2016 10:23 Go to previous messageGo to next message
Eclipse UserFriend
Dear All,

I have tried many ways, but I can not solve this problem. I'm eager for your help. Thanks.
Re: Add new transformed record to the end of the file [message #1726627 is a reply to message #1726541] Tue, 15 March 2016 04:50 Go to previous messageGo to next message
Eclipse UserFriend
You're overwriting the same file for each Functions!Clause.
Re: Add new transformed record to the end of the file [message #1726851 is a reply to message #1726627] Wed, 16 March 2016 21:47 Go to previous message
Eclipse UserFriend
Thanks Dennis, I am trying other ways.
Previous Topic:HowTo use meta model class as type or parameter
Next Topic:Make a function with parameter output
Goto Forum:
  


Current Time: Thu Jul 24 00:44:33 EDT 2025

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

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

Back to the top