import org.json.JSONObject;
public class LongRunningProcessApiExt extends LongrunningprocessApi {
public ClientApiLongRunningProcess waitById(String longRunningProcessId) throws ApiException {
while (true) {
ClientApiLongRunningProcess longRunningProcess = findById(longRunningProcessId);
if (longRunningProcess.getEndTime() != null || longRunningProcess.getError() != null || longRunningProcess.isCanceled()) {
return longRunningProcess;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {