Package org.camunda.bpm.engine.history

Examples of org.camunda.bpm.engine.history.HistoricDetailQuery


  }

  private void createHistoricDetailMock() {
    List<HistoricDetail> details = MockProvider.createMockHistoricDetails();

    HistoricDetailQuery query = mock(HistoricDetailQuery.class);
    when(mockHistoryService.createHistoricDetailQuery()).thenReturn(query);
    when(query.list()).thenReturn(details);
  }
View Full Code Here


  @Override
  public List<HistoricDetailDto> getHistoricDetails(UriInfo uriInfo, Integer firstResult,
      Integer maxResults, boolean deserializeObjectValues) {
    HistoricDetailQueryDto queryDto = new HistoricDetailQueryDto(objectMapper, uriInfo.getQueryParameters());
    HistoricDetailQuery query = queryDto.toQuery(processEngine);
    query.disableBinaryFetching();

    if (!deserializeObjectValues) {
      query.disableCustomObjectDeserialization();
    }

    List<HistoricDetail> queryResult;
    if (firstResult != null || maxResults != null) {
      queryResult = executePaginatedQuery(query, firstResult, maxResults);
    } else {
      queryResult = query.list();
    }

    List<HistoricDetailDto> result = new ArrayList<HistoricDetailDto>();
    for (HistoricDetail historicDetail : queryResult) {
      HistoricDetailDto dto = HistoricDetailDto.fromHistoricDetail(historicDetail);
View Full Code Here

  }

  @Override
  public CountResultDto getHistoricDetailsCount(UriInfo uriInfo) {
    HistoricDetailQueryDto queryDto = new HistoricDetailQueryDto(objectMapper, uriInfo.getQueryParameters());
    HistoricDetailQuery query = queryDto.toQuery(processEngine);

    long count = query.count();
    CountResultDto result = new CountResultDto();
    result.setCount(count);

    return result;
  }
View Full Code Here

    HistoricVariableInstance testVariable = historyService.createHistoricVariableInstanceQuery()
      .variableName("testVar")
      .singleResult();

    HistoricDetailQuery query = historyService.createHistoricDetailQuery();

    query.variableInstanceId(testVariable.getId());

    assertEquals(1, query.count());
    assertEquals(1, query.list().size());
  }
View Full Code Here

    assertEquals(1, query.count());
    assertEquals(1, query.list().size());
  }

  public void testHistoricDetailQueryByInvalidVariableInstanceId() {
    HistoricDetailQuery query = historyService.createHistoricDetailQuery();

    query.variableInstanceId("invalid");
    assertEquals(0, query.count());

    try {
      query.variableInstanceId(null);
      fail("A ProcessEngineExcpetion was expected.");
    } catch (ProcessEngineException e) {}

    try {
      query.variableInstanceId((String)null);
      fail("A ProcessEngineExcpetion was expected.");
    } catch (ProcessEngineException e) {}
  }
View Full Code Here

    this.detailId = detailId;
    this.engine = engine;
  }

  public HistoricDetailDto getDetail(boolean deserializeObjectValue) {
    HistoricDetailQuery query = baseQuery().disableBinaryFetching();

    if (!deserializeObjectValue) {
      query.disableCustomObjectDeserialization();
    }

    HistoricDetail detail = query.singleResult();

    if(detail != null) {
      return HistoricDetailDto.fromHistoricDetail(detail);

    } else {
View Full Code Here

    mockedQuery = setUpMockedDetailsQuery(details);
  }

  protected HistoricDetailQuery setUpMockedDetailsQuery(List<HistoricDetail> detailMocks) {
    HistoricDetailQuery mock = mock(HistoricDetailQuery.class);
    when(mock.list()).thenReturn(detailMocks);
    when(mock.count()).thenReturn((long) detailMocks.size());

    when(processEngine.getHistoryService().createHistoricDetailQuery()).thenReturn(mock);
    return mock;
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.history.HistoricDetailQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.