Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Copy files unsing the MWE2 workflow(can't manage to copy files using the MWE2 workflow)
Copy files unsing the MWE2 workflow [message #674296] Thu, 26 May 2011 12:54 Go to next message
Matthias B. is currently offline Matthias B.Friend
Messages: 9
Registered: April 2011
Junior Member
hey,

I created a generator project using xpand which works fine.

Now i need to copy some existing files to the ones i generate. So i was looking for a way to just copy files into my src-gen folder.

I'm doing this like that:

component = org.eclipse.emf.mwe.utils.FileCopy {
		sourceFile = "src/models/test.c"
		targetFile = "src-gen/Software/test.c"
	}


as long as the sourceFile is located in the eclipse project path everything works fine, but the files i need to copy are located outside the eclipse project. if i try to access them i get a error because eclipse can't access the path. Think it has to be some mistake i am doing with the source path but i can't find it...

I try it like this

....
 sourceFile = "d:/modules/test.c"
....


I also tryed to google it but i didn't found anything else about how to copy files with a MWE2 workflow, hope you can help me!
Re: Copy files unsing the MWE2 workflow [message #674411 is a reply to message #674296] Thu, 26 May 2011 20:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

i cannot reproduce this.

this works for me

module Test

Workflow {
	
	component = org.eclipse.emf.mwe.utils.FileCopy {
		sourceFile = "c:/work/test.c"
		targetFile = "src-gen/Software/test.c"
	}
	
}


can you please post the complete error message from the workflow?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Copy files unsing the MWE2 workflow [message #674494 is a reply to message #674411] Fri, 27 May 2011 06:49 Go to previous messageGo to next message
Matthias B. is currently offline Matthias B.Friend
Messages: 9
Registered: April 2011
Junior Member
i put the code part you wrote in front of mine and this is working.
and i think i found the problem, if i try to put the targetFile to a folderwhich doesn't exist yet i get a error that the system can't find the path.

Quote:


1172 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow workflow.ExperimentGenerator:
[ERROR]: Cannot perform I/O.(Element: java.io.IOException: Das System kann den angegebenen Pfad nicht finden; Reported by: FileCopy)
java.io.IOException: Das System kann den angegebenen Pfad nicht finden
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at org.eclipse.emf.mwe.utils.FileCopy.invokeInternal(FileCopy.java:51)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:31)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:80)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)


so i think i have to create the folders first before i can start putting files in them?



Re: Copy files unsing the MWE2 workflow [message #674501 is a reply to message #674494] Fri, 27 May 2011 07:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

yes this is about the target file and not about the source file as you stated in your first post.
the folder you want to copy the files to must exist before you call the FileCopy Component.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Copy files unsing the MWE2 workflow [message #674507 is a reply to message #674501] Fri, 27 May 2011 07:36 Go to previous messageGo to next message
Matthias B. is currently offline Matthias B.Friend
Messages: 9
Registered: April 2011
Junior Member
hey,

ah ok, i first thought the command generates the missing folders.

is there a command to generate folders using MWE2 workflows?

thanks for your effort!
matthias

Re: Copy files unsing the MWE2 workflow [message #674513 is a reply to message #674507] Fri, 27 May 2011 08:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

afaik the is not component for that but it should be a 10-liner to create such a component - or you come up with a custom version of the FileCopy component. here is the source.

http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.emf/org.eclipse.emf.mwe/plugins/org.eclipse.emf.mwe.utils/src/org/eclipse/emf/mwe/utils/FileCopy.java?root=Modeling_Project&view=co

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Copy files unsing the MWE2 workflow [message #674522 is a reply to message #674513] Fri, 27 May 2011 08:39 Go to previous message
Matthias B. is currently offline Matthias B.Friend
Messages: 9
Registered: April 2011
Junior Member
perfekt, i will write my one component, thank you a lot!
Previous Topic:Xpand in Latex listings
Next Topic:getValue and 1..*
Goto Forum:
  


Current Time: Thu Mar 28 12:58:04 GMT 2024

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

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

Back to the top