fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package SapforTestingSystem.SapforTasksPackageSupervisor;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.GlobalProperties;
|
||||
@@ -94,35 +95,41 @@ public class SapforTasksPackageSupervisor {
|
||||
Utils.createScript(packageWorkspace, packageWorkspace, "start", "java -jar VisualSapfor.jar");
|
||||
//--
|
||||
}
|
||||
/*
|
||||
void SapforPackageStart() throws Exception {
|
||||
|
||||
void PackageStart() throws Exception {
|
||||
System.out.println("start sapfor package " + sapforTasksPackage.id);
|
||||
File workspace = new File(sapforTasksPackage.workspace);
|
||||
File script = new File(sapforTasksPackage.workspace, "start");
|
||||
ProcessBuilder procBuilder = new ProcessBuilder(script.getAbsolutePath());
|
||||
procBuilder.directory(workspace);
|
||||
procBuilder.start();
|
||||
//--->>
|
||||
File started = new File(sapforTasksPackage.workspace, Constants.STARTED);
|
||||
while (!started.exists()){
|
||||
System.out.println("waiting for package start...");
|
||||
Utils.sleep(1000);
|
||||
}
|
||||
//-->>
|
||||
sapforTasksPackage.state = TasksPackageState.RunningExecution;
|
||||
UpdateSapforPackage(sapforTasksPackage);
|
||||
planner.UpdateSapforPackage(sapforTasksPackage);
|
||||
System.out.println("done");
|
||||
}
|
||||
void CheckSapforPackageState() throws Exception {
|
||||
void CheckPackageState() throws Exception {
|
||||
System.out.println("check sapfor package " + sapforTasksPackage.id);
|
||||
File done = new File(sapforTasksPackage.workspace, Constants.DONE);
|
||||
File aborted = new File(sapforTasksPackage.workspace, Constants.ABORTED);
|
||||
if (done.exists()) {
|
||||
sapforTasksPackage.state = TasksPackageState.Done;
|
||||
UpdateSapforPackage(sapforTasksPackage);
|
||||
planner.UpdateSapforPackage(sapforTasksPackage);
|
||||
System.out.println("package done");
|
||||
} else if (aborted.exists()) {
|
||||
sapforTasksPackage.state = TasksPackageState.Aborted;
|
||||
UpdateSapforPackage(sapforTasksPackage);
|
||||
planner.UpdateSapforPackage(sapforTasksPackage);
|
||||
System.out.println("package aborted");
|
||||
} else {
|
||||
System.out.println("package running");
|
||||
}
|
||||
}
|
||||
*/
|
||||
//--
|
||||
public void Perform() throws Exception {
|
||||
switch (sapforTasksPackage.state) {
|
||||
@@ -131,14 +138,12 @@ public class SapforTasksPackageSupervisor {
|
||||
sapforTasksPackage.state = TasksPackageState.RunningPreparation;
|
||||
planner.UpdateSapforPackage(sapforTasksPackage);
|
||||
break;
|
||||
/*
|
||||
case RunningPreparation:
|
||||
SapforPackageStart();
|
||||
PackageStart();
|
||||
break;
|
||||
case RunningExecution:
|
||||
CheckSapforPackageState();
|
||||
CheckPackageState();
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user