def COMMITTED(self): self.taskIns = assetUpdate(self.taskIns, "State", "COMMITTED") if self.arch2ins.taskCoordinator == self.parent.device_uuid: #add subtask asset to the device self.parent.adapter.addAsset('Task', self.task_uuid, self.taskIns)
def PREPARING(self): self.parent.adapter.begin_gather() self.interface.set_value("PREPARING") self.parent.adapter.complete_gather() self.taskIns = assetUpdate(self.taskIns, "State", "PREPARING") self.parent.adapter.addAsset('Task', self.master_task_uuid, self.taskIns)
def COMMITTING(self): self.taskIns = assetUpdate(self.taskIns, "State", "COMMITTING") if self.arch2ins.taskCoordinator == self.parent.device_uuid: self.parent.adapter.addAsset('Task', self.task_uuid, self.taskIns) self.all_commit()
def FAIL(self): self.taskIns = assetUpdate(self.taskIns, "State", "FAIL") if self.arch2ins.taskCoordinator == self.parent.device_uuid: self.parent.adapter.addAsset('Task', self.task_uuid, self.taskIns) if self.arch2ins.taskCoordinator == self.parent.device_uuid: self.parent.adapter.removeAsset(self.task_uuid) self.default()
def COMPLETE(self): #update states and remove asset once subtask is complete self.taskIns = assetUpdate(self.taskIns, "State", "COMPLETE") if self.arch2ins.taskCoordinator == self.parent.device_uuid: self.parent.adapter.addAsset('Task', self.task_uuid, self.taskIns) if self.arch2ins.taskCoordinator == self.parent.device_uuid: self.parent.adapter.removeAsset(self.task_uuid) self.default()
def COMMITTING(self): self.parent.adapter.begin_gather() self.interface.set_value("COMMITTING") self.parent.adapter.complete_gather() self.taskIns = assetUpdate(self.taskIns, "State", "COMMITTING") self.parent.adapter.addAsset('Task', self.master_task_uuid, self.taskIns) self.timer_commit()
def FAIL(self): self.taskIns = assetUpdate(self.taskIns, "State", "FAIL") self.parent.adapter.addAsset('Task', self.master_task_uuid, self.taskIns) self.parent.adapter.removeAsset(self.master_task_uuid) self.parent.adapter.begin_gather() self.interface.set_value("INACTIVE") self.parent.adapter.complete_gather() self.default()
def COMPLETE(self): #update states and remove task asset once completed self.taskIns = assetUpdate(self.taskIns, "State", "COMPLETE") self.parent.adapter.addAsset('Task', self.master_task_uuid, self.taskIns) self.parent.adapter.begin_gather() self.interface.set_value("INACTIVE") self.parent.adapter.complete_gather() self.parent.adapter.removeAsset(self.master_task_uuid) self.default()
def COMMITTED(self): self.parent.adapter.begin_gather() self.interface.set_value("COMMITTED") self.parent.adapter.complete_gather() self.parent.priority.commit_check() self.taskIns = assetUpdate(self.taskIns, "State", "COMMITTED") self.parent.adapter.addAsset('Task', self.master_task_uuid, self.taskIns) self.committed()