code: public String getRequestById(long requestId, boolean withErrors, boolean withData, String marshallingType) {
  
          String result = null;
  
          RequestInfo request = executorService.getRequestById(requestId);
  
          if (request == null) {
              throw new IllegalArgumentException("Request with id: " + requestId + " doesn't exist");
          } else {
              RequestInfoInstance requestInstance = convertToRequestInfo(request, withErrors, withData);
  
              String deploymentId = ((org.jbpm.executor.entities.RequestInfo) request).getDeploymentId();
              if (deploymentId != null && context.getContainer(deploymentId) != null) {
                  result = marshallerHelper.marshal(deploymentId, marshallingType, requestInstance);
              } else {
                  result = marshallerHelper.marshal(marshallingType, requestInstance);
              }
          }
  
          return result;
      }
docs: instance details