public virtual IList <HistoricTaskInstanceDto> queryHistoricTaskInstances(HistoricTaskInstanceQueryDto queryDto, int?firstResult, int?maxResults) { queryDto.ObjectMapper = objectMapper; HistoricTaskInstanceQuery query = queryDto.toQuery(processEngine); IList <HistoricTaskInstance> match; if (firstResult != null || maxResults != null) { match = executePaginatedQuery(query, firstResult, maxResults); } else { match = query.list(); } IList <HistoricTaskInstanceDto> result = new List <HistoricTaskInstanceDto>(); foreach (HistoricTaskInstance taskInstance in match) { HistoricTaskInstanceDto taskInstanceDto = HistoricTaskInstanceDto.fromHistoricTaskInstance(taskInstance); result.Add(taskInstanceDto); } return(result); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @GET @Path("/task-instance/running") public java.util.List<org.camunda.bpm.engine.rest.dto.history.HistoricTaskInstanceDto> getRunningHistoricTaskInstances(@QueryParam("startedAfter") String startedAfterAsString, @QueryParam("startedAt") String startedAtAsString, @QueryParam("maxResults") int maxResults) public virtual IList <HistoricTaskInstanceDto> getRunningHistoricTaskInstances(string startedAfterAsString, string startedAtAsString, int maxResults) { DateTime startedAfter = dateConverter.convertQueryParameterToType(startedAfterAsString); DateTime startedAt = dateConverter.convertQueryParameterToType(startedAtAsString); maxResults = ensureValidMaxResults(maxResults); ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl)ProcessEngine.ProcessEngineConfiguration; IList <HistoricTaskInstance> historicTaskInstances = config.OptimizeService.getRunningHistoricTaskInstances(startedAfter, startedAt, maxResults); IList <HistoricTaskInstanceDto> result = new List <HistoricTaskInstanceDto>(); foreach (HistoricTaskInstance instance in historicTaskInstances) { HistoricTaskInstanceDto dto = HistoricTaskInstanceDto.fromHistoricTaskInstance(instance); result.Add(dto); } return(result); }