code: private boolean validateProcessInstance(ProcessInstance processInst) {
          Integer status = processInst.getStatusCode();
          if (WorkStatus.STATUS_CANCELLED.equals(status)) {
              logger.info("ProcessInstance has been cancelled. ProcessInstanceId = " + processInst.getId());
              return false;
          } else if (WorkStatus.STATUS_COMPLETED.equals(status)) {
              logger.info("ProcessInstance has been completed. ProcessInstanceId = " + processInst.getId());
              return false;
          } else return true;
      }
docs: ///////////// activity resume