Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Is in-memory output possible with ATL/EMFTVM ?(Can't find any other way than creating a file for producing ATL transform output)
Is in-memory output possible with ATL/EMFTVM ? [message #1709589] Tue, 29 September 2015 12:43 Go to next message
Seref Arikan is currently offline Seref ArikanFriend
Messages: 72
Registered: August 2010
Member
Hi,
I've managed to get a standalone ATL/EMFTVM example running, based on the code written here

However, all the examples, including the wiki, work via reading and writing files.

I can deal with the read scenario, but the target model requires a call to setResource with a file resource. It appears that this resource is then used to add target content. My problem is, I don't want to write a file. I'd like to use an in memory target, such as a ByteArrayOutputStream, but can't do that, because I can't find a way to create an in-memory resource that will not throw an exception when ATL/EMFTVM code calls getContents on it.

I think I'm missing here something, because I can't be the only one who'd like to write a service that exposes ATL/EMFTVM functionality over the network.

Regards
Sarikan
Re: Is in-memory output possible with ATL/EMFTVM ? [message #1709601 is a reply to message #1709589] Tue, 29 September 2015 13:34 Go to previous message
Seref Arikan is currently offline Seref ArikanFriend
Messages: 72
Registered: August 2010
Member
To answer my own question: the resource of the output model is accessible to us, and this code gives us a nice string representation of the output:

ByteArrayOutputStream out = new ByteArrayOutputStream();
		outModel.getResource().save(out,null);
		String temp = new String(out.toByteArray());


I was (incorrectly) under the assumption that creating a file resource implies creating a file. That is of course not the case, the file would not be created until we call .save on the output model's resource.
Previous Topic:[CDO] Resource renaming
Next Topic:Type parameter as type of both attribute and reference
Goto Forum:
  


Current Time: Sat Aug 24 18:57:28 GMT 2019

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

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

Back to the top