本文整理汇总了Java中org.camunda.bpm.engine.batch.history.HistoricBatchQuery类的典型用法代码示例。如果您正苦于以下问题:Java HistoricBatchQuery类的具体用法?Java HistoricBatchQuery怎么用?Java HistoricBatchQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HistoricBatchQuery类属于org.camunda.bpm.engine.batch.history包,在下文中一共展示了HistoricBatchQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyFilters
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
protected void applyFilters(HistoricBatchQuery query) {
if (batchId != null) {
query.batchId(batchId);
}
if (type != null) {
query.type(type);
}
if (completed != null) {
query.completed(completed);
}
if (Boolean.TRUE.equals(withoutTenantId)) {
query.withoutTenantId();
}
if (tenantIds != null && !tenantIds.isEmpty()) {
query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
}
}
示例2: getHistoricBatches
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List<HistoricBatchDto> getHistoricBatches(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
HistoricBatchQueryDto queryDto = new HistoricBatchQueryDto(objectMapper, uriInfo.getQueryParameters());
HistoricBatchQuery query = queryDto.toQuery(processEngine);
List<HistoricBatch> matchingBatches;
if (firstResult != null || maxResults != null) {
matchingBatches = (List<HistoricBatch>) executePaginatedQuery(query, firstResult, maxResults);
}
else {
matchingBatches = query.list();
}
List<HistoricBatchDto> batchResults = new ArrayList<HistoricBatchDto>();
for (HistoricBatch matchingBatch : matchingBatches) {
batchResults.add(HistoricBatchDto.fromBatch(matchingBatch));
}
return batchResults;
}
示例3: testGetNonExistingHistoricBatch
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
@Test
public void testGetNonExistingHistoricBatch() {
String nonExistingId = MockProvider.NON_EXISTING_ID;
HistoricBatchQuery historicBatchQuery = mock(HistoricBatchQuery.class);
when(historicBatchQuery.batchId(nonExistingId)).thenReturn(historicBatchQuery);
when(historicBatchQuery.singleResult()).thenReturn(null);
when(historyServiceMock.createHistoricBatchQuery()).thenReturn(historicBatchQuery);
given()
.pathParam("id", nonExistingId)
.then().expect()
.statusCode(Status.NOT_FOUND.getStatusCode())
.body("type", equalTo(InvalidRequestException.class.getSimpleName()))
.body("message", equalTo("Historic batch with id '" + nonExistingId + "' does not exist"))
.when()
.get(HISTORIC_SINGLE_BATCH_RESOURCE_URL);
}
示例4: applySortBy
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
protected void applySortBy(HistoricBatchQuery query, String sortBy, Map<String, Object> parameters, ProcessEngine engine) {
if (sortBy.equals(SORT_BY_BATCH_ID_VALUE)) {
query.orderById();
}
if (sortBy.equals(SORT_BY_BATCH_START_TIME_VALUE)) {
query.orderByStartTime();
}
if (sortBy.equals(SORT_BY_BATCH_END_TIME_VALUE)) {
query.orderByEndTime();
}
if (sortBy.equals(SORT_BY_TENANT_ID_VALUE)) {
query.orderByTenantId();
}
}
示例5: getHistoricBatchesCount
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
@Override
public CountResultDto getHistoricBatchesCount(UriInfo uriInfo) {
HistoricBatchQueryDto queryDto = new HistoricBatchQueryDto(objectMapper, uriInfo.getQueryParameters());
HistoricBatchQuery query = queryDto.toQuery(processEngine);
long count = query.count();
return new CountResultDto(count);
}
示例6: setUpHistoricBatchQueryMock
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
@Before
public void setUpHistoricBatchQueryMock() {
List<HistoricBatch> mockHistoricBatches = MockProvider.createMockHistoricBatches();
queryMock = mock(HistoricBatchQuery.class);
when(queryMock.list()).thenReturn(mockHistoricBatches);
when(queryMock.count()).thenReturn((long) mockHistoricBatches.size());
when(processEngine.getHistoryService().createHistoricBatchQuery()).thenReturn(queryMock);
}
示例7: setUpHistoricBatchQueryMock
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
@Before
public void setUpHistoricBatchQueryMock() {
HistoricBatch historicBatchMock = MockProvider.createMockHistoricBatch();
queryMock = mock(HistoricBatchQuery.class);
when(queryMock.batchId(eq(MockProvider.EXAMPLE_BATCH_ID))).thenReturn(queryMock);
when(queryMock.singleResult()).thenReturn(historicBatchMock);
historyServiceMock = mock(HistoryService.class);
when(historyServiceMock.createHistoricBatchQuery()).thenReturn(queryMock);
when(processEngine.getHistoryService()).thenReturn(historyServiceMock);
}
示例8: HistoricBatchQueryMock
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
public HistoricBatchQueryMock() {
super(HistoricBatchQuery.class, HistoryService.class);
}
示例9: createHistoricBatchQuery
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
public HistoricBatchQuery createHistoricBatchQuery() {
return new HistoricBatchQueryImpl(commandExecutor);
}
示例10: tenantIdIn
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
public HistoricBatchQuery tenantIdIn(String... tenantIds) {
ensureNotNull("tenantIds", (Object[]) tenantIds);
this.tenantIds = tenantIds;
isTenantIdSet = true;
return this;
}
示例11: withoutTenantId
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
public HistoricBatchQuery withoutTenantId() {
this.tenantIds = null;
isTenantIdSet = true;
return this;
}
示例12: orderById
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
public HistoricBatchQuery orderById() {
return orderBy(HistoricBatchQueryProperty.ID);
}
示例13: orderByStartTime
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
public HistoricBatchQuery orderByStartTime() {
return orderBy(HistoricBatchQueryProperty.START_TIME);
}
示例14: orderByEndTime
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
public HistoricBatchQuery orderByEndTime() {
return orderBy(HistoricBatchQueryProperty.END_TIME);
}
示例15: orderByTenantId
import org.camunda.bpm.engine.batch.history.HistoricBatchQuery; //导入依赖的package包/类
@Override
public HistoricBatchQuery orderByTenantId() {
return orderBy(HistoricBatchQueryProperty.TENANT_ID);
}