update
This commit is contained in:
@@ -439,28 +439,6 @@ public class LoopbackCommunicationAdapter
|
||||
getProcessModel().setState(Vehicle.State.EXECUTING);
|
||||
Step step = command.getStep();
|
||||
|
||||
Vehicle newVehicle = vehicleService.fetchObject(Vehicle.class, getProcessModel().getName());
|
||||
List<Set<TCSResourceReference<?>>> allocatedResources = newVehicle.getAllocatedResources();
|
||||
|
||||
//使用副本更新车辆模型,防止异常情况
|
||||
List<Set<TCSResourceReference<?>>> copiedResources = new ArrayList<>(allocatedResources);
|
||||
copiedResources.clear();
|
||||
|
||||
if (step.getSourcePoint() != null) {
|
||||
//下发起点不为空
|
||||
Point point = objectService.fetchObject(Point.class, step.getSourcePoint().getName());
|
||||
Set<TCSResourceReference<?>> resource = new HashSet<>();
|
||||
resource.add(point.getReference());
|
||||
copiedResources.add(resource);
|
||||
}
|
||||
if (step.getPath() != null) {
|
||||
Path path = objectService.fetchObject(Path.class, step.getPath().getName());
|
||||
Set<TCSResourceReference<?>> resource = new HashSet<>();
|
||||
resource.add(path.getReference());
|
||||
copiedResources.add(resource);
|
||||
}
|
||||
newVehicle.withAllocatedResources(copiedResources);
|
||||
|
||||
if (step.getPath() == null) {
|
||||
actionExec(command);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user