code: public void deleteApplicationTasks(ApplicationDefinition appDef) {
          String prefixName = appDef.getAppName() + "/";
          String claimPrefixName = "_claim/" + prefixName;
          Tenant tenant = Tenant.getTenant(appDef);
          DBTransaction dbTran = DBService.instance(tenant).startTransaction();
          for(DRow row: DBService.instance(tenant).getAllRows(TaskManagerService.TASKS_STORE_NAME)) {
              if (row.getKey().startsWith(prefixName) ||
                  row.getKey().startsWith(claimPrefixName)) {
                  dbTran.deleteRow(TASKS_STORE_NAME, row.getKey());
              }
          }
          if (dbTran.getMutationsCount() > 0) {
              m_logger.info("Deleting {} task status rows for application {}",
                            dbTran.getMutationsCount(), appDef.getAppName());
              DBService.instance(tenant).commit(dbTran);
          }
      }
docs: Delet all task status rows, if any, related to the given application from the Tasks
  table. NOTE: This method can be called even if the TaskManagerService has not been
  initialized so that we can always cleanup deleted applications.
  
  @param appDef    {@link ApplicationDefinition} of application being deleted.