本文整理汇总了Java中org.camunda.bpm.engine.filter.Filter.extend方法的典型用法代码示例。如果您正苦于以下问题:Java Filter.extend方法的具体用法?Java Filter.extend怎么用?Java Filter.extend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.filter.Filter
的用法示例。
在下文中一共展示了Filter.extend方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testExtendTaskQueryWithCandidateUserExpressionAndIncludeAssignedTasks
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testExtendTaskQueryWithCandidateUserExpressionAndIncludeAssignedTasks() {
// create an empty query and save it as a filter
TaskQuery emptyQuery = taskService.createTaskQuery();
Filter emptyFilter = filterService.newTaskFilter("empty");
emptyFilter.setQuery(emptyQuery);
// create a query with candidate user expression and include assigned tasks
// and save it as filter
TaskQuery query = taskService.createTaskQuery();
query.taskCandidateUserExpression("${'test'}").includeAssignedTasks();
Filter filter = filterService.newTaskFilter("filter");
filter.setQuery(query);
// extend empty query by query with candidate user expression and include assigned tasks
Filter extendedFilter = emptyFilter.extend(query);
TaskQueryImpl extendedQuery = extendedFilter.getQuery();
assertEquals("${'test'}", extendedQuery.getExpressions().get("taskCandidateUser"));
assertTrue(extendedQuery.isIncludeAssignedTasks());
// extend query with candidate user expression and include assigned tasks with empty query
extendedFilter = filter.extend(emptyQuery);
extendedQuery = extendedFilter.getQuery();
assertEquals("${'test'}", extendedQuery.getExpressions().get("taskCandidateUser"));
assertTrue(extendedQuery.isIncludeAssignedTasks());
}
示例2: testExtendTaskQueryWithCandidateGroupExpressionAndIncludeAssignedTasks
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testExtendTaskQueryWithCandidateGroupExpressionAndIncludeAssignedTasks() {
// create an empty query and save it as a filter
TaskQuery emptyQuery = taskService.createTaskQuery();
Filter emptyFilter = filterService.newTaskFilter("empty");
emptyFilter.setQuery(emptyQuery);
// create a query with candidate group expression and include assigned tasks
// and save it as filter
TaskQuery query = taskService.createTaskQuery();
query.taskCandidateGroupExpression("${'test'}").includeAssignedTasks();
Filter filter = filterService.newTaskFilter("filter");
filter.setQuery(query);
// extend empty query by query with candidate group expression and include assigned tasks
Filter extendedFilter = emptyFilter.extend(query);
TaskQueryImpl extendedQuery = extendedFilter.getQuery();
assertEquals("${'test'}", extendedQuery.getExpressions().get("taskCandidateGroup"));
assertTrue(extendedQuery.isIncludeAssignedTasks());
// extend query with candidate group expression and include assigned tasks with empty query
extendedFilter = filter.extend(emptyQuery);
extendedQuery = extendedFilter.getQuery();
assertEquals("${'test'}", extendedQuery.getExpressions().get("taskCandidateGroup"));
assertTrue(extendedQuery.isIncludeAssignedTasks());
}
示例3: testExtendTaskQueryWithCandidateGroupInAndCandidateGroup
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testExtendTaskQueryWithCandidateGroupInAndCandidateGroup() {
// create an query with candidate group in and save it as a filter
TaskQueryImpl candidateGroupInQuery = (TaskQueryImpl)taskService.createTaskQuery().taskCandidateGroupIn(Arrays.asList("testGroup", "testGroup2"));
assertEquals(2, candidateGroupInQuery.getCandidateGroups().size());
assertEquals("testGroup", candidateGroupInQuery.getCandidateGroups().get(0));
assertEquals("testGroup2", candidateGroupInQuery.getCandidateGroups().get(1));
Filter candidateGroupInFilter = filterService.newTaskFilter("Groups filter");
candidateGroupInFilter.setQuery(candidateGroupInQuery);
// create a query with candidate group
// and save it as filter
TaskQuery candidateGroupQuery = taskService.createTaskQuery().taskCandidateGroup("testGroup2");
// extend candidate group in filter by query with candidate group
Filter extendedFilter = candidateGroupInFilter.extend(candidateGroupQuery);
TaskQueryImpl extendedQuery = extendedFilter.getQuery();
assertEquals(1, extendedQuery.getCandidateGroups().size());
assertEquals("testGroup2", extendedQuery.getCandidateGroups().get(0));
}
示例4: testExtendTaskQueryWithCandidateGroupInExpressionAndIncludeAssignedTasks
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testExtendTaskQueryWithCandidateGroupInExpressionAndIncludeAssignedTasks() {
// create an empty query and save it as a filter
TaskQuery emptyQuery = taskService.createTaskQuery();
Filter emptyFilter = filterService.newTaskFilter("empty");
emptyFilter.setQuery(emptyQuery);
// create a query with candidate group in expression and include assigned tasks
// and save it as filter
TaskQuery query = taskService.createTaskQuery();
query.taskCandidateGroupInExpression("${'test'}").includeAssignedTasks();
Filter filter = filterService.newTaskFilter("filter");
filter.setQuery(query);
// extend empty query by query with candidate group in expression and include assigned tasks
Filter extendedFilter = emptyFilter.extend(query);
TaskQueryImpl extendedQuery = extendedFilter.getQuery();
assertEquals("${'test'}", extendedQuery.getExpressions().get("taskCandidateGroupIn"));
assertTrue(extendedQuery.isIncludeAssignedTasks());
// extend query with candidate group in expression and include assigned tasks with empty query
extendedFilter = filter.extend(emptyQuery);
extendedQuery = extendedFilter.getQuery();
assertEquals("${'test'}", extendedQuery.getExpressions().get("taskCandidateGroupIn"));
assertTrue(extendedQuery.isIncludeAssignedTasks());
}
示例5: testExtendingSorting
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testExtendingSorting() {
// create empty query
TaskQueryImpl query = (TaskQueryImpl) taskService.createTaskQuery();
saveQuery(query);
// assert default sorting
query = filter.getQuery();
assertTrue(query.getOrderingProperties().isEmpty());
// extend query by new task query with sorting
TaskQueryImpl sortQuery = (TaskQueryImpl) taskService.createTaskQuery().orderByTaskName().asc();
Filter extendedFilter = filter.extend(sortQuery);
query = extendedFilter.getQuery();
List<QueryOrderingProperty> expectedOrderingProperties =
new ArrayList<QueryOrderingProperty>(sortQuery.getOrderingProperties());
verifyOrderingProperties(expectedOrderingProperties, query.getOrderingProperties());
// extend query by new task query with additional sorting
TaskQueryImpl extendingQuery = (TaskQueryImpl) taskService.createTaskQuery().orderByTaskAssignee().desc();
extendedFilter = extendedFilter.extend(extendingQuery);
query = extendedFilter.getQuery();
expectedOrderingProperties.addAll(extendingQuery.getOrderingProperties());
verifyOrderingProperties(expectedOrderingProperties, query.getOrderingProperties());
// extend query by incomplete sorting query (should add sorting anyway)
sortQuery = (TaskQueryImpl) taskService.createTaskQuery().orderByCaseExecutionId();
extendedFilter = extendedFilter.extend(sortQuery);
query = extendedFilter.getQuery();
expectedOrderingProperties.addAll(sortQuery.getOrderingProperties());
verifyOrderingProperties(expectedOrderingProperties, query.getOrderingProperties());
}