прерывание по образцу двм, однотипное.

This commit is contained in:
2023-10-17 01:13:13 +03:00
parent 19f7230eb5
commit 66e1102e39
6 changed files with 69 additions and 68 deletions

View File

@@ -3,8 +3,12 @@ import Common.Current;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import TestingSystem.TasksPackageToKill.TasksPackageToKill;
import Visual_DVM_2021.Passes.TestingSystemPass;
import java.util.Vector;
public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage> {
Vector<TasksPackageToKill> packagesToKill;
@Override
public String getIconPath() {
return "/icons/Ban.PNG";
@@ -15,14 +19,25 @@ public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.SapforTasksPackage)){
if (Current.Check(Log, Current.SapforTasksPackage)) {
packagesToKill = new Vector<>();
target = Current.getSapforTasksPackage();
return true;
};
switch (target.state) {
case Done:
case Aborted:
break;
default:
TasksPackageToKill tasksPackageToKill = new TasksPackageToKill();
tasksPackageToKill.packageName = target.id;
packagesToKill.add(tasksPackageToKill);
return true;
}
}
;
return false;
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.AbortSapforTasksPackage, Current.getAccount().email, target.id));
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountObjects, Current.getAccount().email, packagesToKill));
}
}