0 Replies Latest reply on May 18, 2016 10:46 AM by Rodrigo Sepulveda

    A method of query tasks you perform paging and make filters for process variables

    Rodrigo Sepulveda Newbie

      I have this code that performs pagination without problems, but does not perform filter process variable values:

       

      public TareasUsuarioResponse getTaskAssignedAsPotentialOwnerPaged(
      TareasPaginadasRequest tareasPaginadasRequest) throws Exception {

       

       

      TareasUsuarioResponse response = new TareasUsuarioResponse();

       

       

      try {

       

       

      ConexionBpms conexionBpms = SingletonBpmsConection.getInstance()
      .getCliente(tareasPaginadasRequest.getUsuario(),
      tareasPaginadasRequest.getPassword());

       

       

      GetTaskAssignedAsPotentialOwnerCommand command = new GetTaskAssignedAsPotentialOwnerCommand();

       

       

      QueryFilter queryFilter = new QueryFilter();

       

       

      queryFilter.setOffset(tareasPaginadasRequest.getPage());

       

       

      queryFilter.setCount(tareasPaginadasRequest.getPageSize());

       

       

      StringKeyObjectValueMap params = new StringKeyObjectValueMap();

       

       

      params.put("taskOwner", tareasPaginadasRequest.getUsuario());

       

       

      params.putAll(tareasPaginadasRequest.getFiltros());

       

       

      LOGGER.info("Sea agrego el filtro.......................................................... <<<<<");

       

       

      queryFilter.setParams(params);

       

       

      queryFilter.setFilterParams("variable1");

       

       

      queryFilter.setAscending(true);

       

       

      command.setFilter(queryFilter);

       

       

      command.setUserId(tareasPaginadasRequest.getUsuario());

       

       

      List<TaskSummary> listaTaskSumary = (List<TaskSummary>) conexionBpms
      .getKsession().execute(command);

       

       

      response.setTaskList(this.convertirListaTaskVO(listaTaskSumary));

       

       

      } catch (BPMSConfigurationPropertyNotFound | MalformedURLException error) {

       

       

      response.setError("Error. " + error.getMessage());

       

       

      LOGGER.error(response.getError());

       

       

      }

       

       

      return response;

       

       

      }