Index: gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/locale/pl_PL/WorkloadEditor.properties
===================================================================
--- gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/locale/pl_PL/WorkloadEditor.properties	(revision 15)
+++ gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/locale/pl_PL/WorkloadEditor.properties	(revision 442)
@@ -85,2 +85,4 @@
 ProbabilisticParameters=Parametry probabilistyczne
 Dates=Daty
+WorkloadFileName=Nazwa
+ResourceDescription=Zasoby
Index: gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/locale/en_US/WorkloadEditor.properties
===================================================================
--- gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/locale/en_US/WorkloadEditor.properties	(revision 15)
+++ gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/locale/en_US/WorkloadEditor.properties	(revision 442)
@@ -78,2 +78,4 @@
 ProbabilisticParameters=Probabilistic parameters
 Dates=Dates
+WorkloadFileName=Name
+ResourceDescription=Resources
Index: gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/views/WorkloadEditor.mxml
===================================================================
--- gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/views/WorkloadEditor.mxml	(revision 15)
+++ gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/views/WorkloadEditor.mxml	(revision 442)
@@ -28,4 +28,9 @@
 		public static var workload : WorkloadBasic = new WorkloadBasic();
 		
+		[Bindable]
+		public static var workloadFileName : String;
+		[Bindable]
+		public static var resourcesFileName : String;
+		
 		/**
 		 * After generating workload it will be stored as file reference here
@@ -122,4 +127,12 @@
 					<mx:TabNavigator paddingLeft="5" height="100%" width="100%">
 						<mx:VBox label="{resourceManager.getString('WorkloadEditor', 'Basic')}" y="50">
+							<mx:HBox>
+								<mx:Label text="{resourceManager.getString('WorkloadEditor', 'WorkloadFileName')}" width="150"/>
+								<mx:TextInput text="{workloadFileName}" />
+							</mx:HBox>
+							<mx:HBox>
+								<mx:Label text="{resourceManager.getString('WorkloadEditor', 'ResourceDescription')}"/>
+								<mx:ComboBox text="{resourcesFileName}" id="resourceDescriptionFile" labelField="fileName" dataProvider="{parentApplication.experimentEditor.workspaceResourcesFileList}" width="250"/>
+							</mx:HBox>
 							<mx:HBox>
 								<mx:Label text="{resourceManager.getString('WorkloadEditor', 'SimulationStartTime')}" width="150"/>
Index: gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/gssim/editors/workload/MainMenu.mxml
===================================================================
--- gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/gssim/editors/workload/MainMenu.mxml	(revision 441)
+++ gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/gssim/editors/workload/MainMenu.mxml	(revision 442)
@@ -68,5 +68,6 @@
 			{
 				Alert.show(WorkloadEditor.workload.getXML(false).toXMLString());
-				parentApplication.service.generateWorkload(WorkloadEditor.workload.getXML(false).toXMLString());
+				parentApplication.service.generateWorkload(WorkloadEditor.workload.getXML(false).toXMLString(),
+					WorkloadEditor.workloadFileName, WorkloadEditor.resourcesFileName);
 			}
 			else
Index: gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GSSimStudio.java
===================================================================
--- gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GSSimStudio.java	(revision 439)
+++ gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GSSimStudio.java	(revision 442)
@@ -2069,8 +2069,55 @@
 	
 	@BlazeDsMethod()
-    public GSSimStudioModel generateWorkload(String fileContent) throws IOException {
-		String uniqueFileName = "tmp" + String.valueOf(new Date().getTime());
-		System.out.println(fileContent);
-		GSSimStudioModel model = uploadTextFile(uniqueFileName, "generator/", fileContent);
+    public GSSimStudioModel generateWorkload(String fileContent, String workloadFileName, String resourceFileName) throws IOException {
+		String uniqueFolderName = "tmp" + String.valueOf(new Date().getTime());
+		String gssimInput = null;
+		Connection connection = null;
+		try {
+			connection = factory().createDBConnection(dbAddress, dbUser,
+					dbPassword);
+			ApplicationPropertyDAO applicationPropertyDAO = factory.createApplicationProperty();
+			
+			Finder finder = Finder.getApplicationPropertyFinder(apGSSimInput);
+			List<ApplicationProperty> list = applicationPropertyDAO.find(finder);
+			if (list.isEmpty()) ;
+			else
+				gssimInput = list.get(0).getValue() + "/generator";
+			
+			ServiceContext serviceContext = VineFlexUtilClass.getServiceContext();
+            FileResourceManager fileResourceManager = getFileResourceManager(serviceContext);
+            FileLocation parentLocation = new FileLocation(gssimInput + "?filetype=directory");
+            FileManager fileManager = fileResourceManager.createFileManager(parentLocation);
+            TaskMonitor taskMonitor = fileManager.makeDirectory(uniqueFolderName, TaskOptions.block());
+            if (taskMonitor.completed()) {
+                log.debug("mkdir succeeded");
+            } else if (taskMonitor.failed()) {
+                String message = taskMonitor.getTaskStatusMessage();
+                log.debug("Task failed: " + message);
+                //model.setError(createErrorMap("makeDir", message));
+            } else {
+                log.debug("Task returned with unexpected status: " + taskMonitor.getTaskStatus().getLabel());
+                //model.setError(createErrorMap("Task returned with unexpected status: ", taskMonitor.getTaskStatusMessage()));
+            }			
+		} catch (SQLException e) {
+			setSqlError("Submit experiment", model, e);
+		} catch (InstantiationException e) {
+			setDbConnectionError(model, e);		
+		} catch (IllegalAccessException e) {
+			setDbConnectionError(model, e);	
+		} catch (ClassNotFoundException e) {
+			setDbConnectionError(model, e);	
+		} catch (Exception e) {
+			setError("Unexpected error occured", model, e);	
+		} finally {
+			closeConnection(connection, model);
+		}
+		
+		GSSimStudioModel model = uploadTextFile("generator.xml", "generator/" + uniqueFolderName, fileContent);
+		String properties = "resdesc=../../resources/" + resourceFileName + "\n";
+		properties += "createscenario.tasksdesc=generator.xml\n";
+		properties += "createscenario.outputfolder=output\n";
+		properties += "createscenario.workloadfilename=" + workloadFileName + "\n";
+		properties += "createscenario.overwrite_files=true\n";
+		model = uploadTextFile("generator.properties", "generator/" + uniqueFolderNam, properties);
 		model.setMessageCode("GenerateWorkloadSucces");
 		return model;
