Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET] writing into files(ws:file-command)
[JET] writing into files [message #489320] Fri, 02 October 2009 12:28 Go to next message
Siegfried Nolte is currently offline Siegfried NolteFriend
Messages: 48
Registered: August 2009
Member
I want to write into one file from different templates. The file will be created with the main-template. While executing I get the ResourceException: "A resource exists with a different case:..."

For example let's consider a model
<app name = "Hello">
<person name = "A">
<property name="a"></property>
</person>
<person name = "B">
<property name="b"></property>
</person>
<person name = "C">
<property name="c"></property>
</person>
</app>

Creating a file in the main-template for every "person" with the personname works. But when I try to write properties into a Person's file with a property-template I get that error.

Template-Structure:
main
person
property

Any ideas?

Thanks for them,
Siegfried
Re: [JET] writing into files [message #489350 is a reply to message #489320] Fri, 02 October 2009 14:48 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Siegfried:

Two suggestions:

1) The 'ResourceException' message is indicating that you are trying to write a file whose name is identical to an existing file, except for case. E.g. you are writing Foo.txt, but foo.txt already exists.

Check the names you are specifying in the 'path' attribute of ws:file

2) I am guessing your approach is something like:

<ws:file path=".../Foo.txt" template="templateA.jet"/>
<ws:file path=".../Foo.txt" template="templateB.jet"/>

An you are hoping the Foo.txt will contain the concatenation of templates A and B. It will not. Instead, it will contain only the results of templateB - JET does no support appending to a file.

Instead, I suggest writing the file only once:

<ws:file path=".../Foo.txt template="combined.jet"/>

with combined.jet doing:

<c:include template="templateA.jet"/>
<c:include template="templateB.jet"/>

Paul
Re: [JET] writing into files [message #513849 is a reply to message #489350] Thu, 11 February 2010 14:03 Go to previous message
Siegfried Nolte is currently offline Siegfried NolteFriend
Messages: 48
Registered: August 2009
Member
Hello Paul,

I know, I'm a bit late with it, but thank you for your help. Indeed I tried to write into one foo.txt from two different templates. I won't do it again.

Kind regards,
Siegfried
Previous Topic:[Announce] Eclipse/OMG Symposium 2010
Next Topic:[Xpand] Error in reading diagram files from GMF editor
Goto Forum:
  


Current Time: Sun Oct 13 18:50:33 GMT 2024

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

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

Back to the top