Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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 15:39 Go to next message
yeliu is currently offline yeliuFriend
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 14:00 Go to previous message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
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: Fri Apr 19 18:31:48 GMT 2024

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

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

Back to the top