code: protected List<CaseFileDataItem> internalGetCaseInstanceDataItems(String caseId, List<String> names, List<String> types, Integer page, Integer pageSize) {
          CaseFileDataItemList list = null;
          if( config.isRest() ) {
              Map<String, Object> valuesMap = new HashMap<String, Object>();
              valuesMap.put(CASE_ID, caseId);
  
              String queryString = getPagingQueryString("", page, pageSize);
              if (names != null && !names.isEmpty()) {
                  queryString = getAdditionalParams(queryString, "name", names);
              } else if (types != null && !types.isEmpty()) {
                  queryString = getAdditionalParams(queryString, "type", types);
              }
  
  
              list = makeHttpGetRequestAndCreateCustomResponse(
                      build(loadBalancer.getUrl(), CASE_QUERY_URI + "/" + CASE_FILE_GET_URI, valuesMap) + queryString, CaseFileDataItemList.class);
  
          } else {
              CommandScript script = new CommandScript( Collections.singletonList(
                      (KieServerCommand) new DescriptorCommand("CaseQueryService", "getCaseInstanceDataItems", new Object[]{caseId, safeList(names), safeList(types), page, pageSize})) );
              ServiceResponse<CaseFileDataItemList> response = (ServiceResponse<CaseFileDataItemList>)
                      executeJmsCommand( script, DescriptorCommand.class.getName(), KieServerConstants.CAPABILITY_CASE ).getResponses().get(0);
  
              throwExceptionOnFailure(response);
              if (shouldReturnWithNullResponse(response)) {
                  return null;
              }
              list = response.getResult();
          }
  
          if (list != null) {
              return list.getItems();
          }
  
          return Collections.emptyList();
      }
docs: /*
  internal methods