Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MOFScript » MOFScript:generate output with the same filename as the source file
MOFScript:generate output with the same filename as the source file [message #580252] Mon, 01 March 2010 10:39 Go to next message
yeliu is currently offline yeliu
Messages: 145
Registered: July 2009
Senior Member
Hello,
How to write the MOFScript transformation if I want the generate output has the same name as the source file. Since the 'self.name' only extract the name of the current context which may not be the file name.


Thanks a lot!



Ye
Re: MOFScript:generate output with the same filename as the source file [message #580276 is a reply to message #580252] Tue, 02 March 2010 09:00 Go to previous message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
Hello Ye,

currently there are no buildt in support for getting the file name of a
given source model.
However it is always possible to do using the "black-box" java
functionality, e.g. writing a java class with an operation that retreives
the file name from for example an EObject.

If you are calling the transformation using the Java API it should also be
quite simple to get the name and using for example
setenv: Sets an environment variable. Equivalent to Java
System.setProperty().

then you could use the

getenv: Gets an environment variable. Equivalent to Java
System.getProperty()..

in your transformation.

Cheers,
G
Previous Topic:Find the Target for a message
Next Topic:MOFScript:generate output with the same filename as the source file
Goto Forum:
  


Current Time: Thu Jul 24 13:43:48 EDT 2014

Powered by FUDForum. Page generated in 0.02028 seconds