本文整理汇总了Java中org.camunda.bpm.engine.filter.Filter.getQuery方法的典型用法代码示例。如果您正苦于以下问题:Java Filter.getQuery方法的具体用法?Java Filter.getQuery怎么用?Java Filter.getQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.filter.Filter
的用法示例。
在下文中一共展示了Filter.getQuery方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertOrUpdateFilter
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public Filter insertOrUpdateFilter(Filter filter) {
AbstractQuery<?, ?> query = filter.getQuery();
query.validate(StoredQueryValidator.get());
if (filter.getId() == null) {
checkAuthorization(CREATE, FILTER, ANY);
getDbEntityManager().insert((FilterEntity) filter);
createDefaultAuthorizations(filter);
}
else {
checkAuthorization(UPDATE, FILTER, filter.getId());
getDbEntityManager().merge((FilterEntity) filter);
}
return filter;
}
示例2: 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());
}
示例3: 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());
}
示例4: 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));
}
示例5: 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());
}
示例6: getFilterQuery
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
protected Query<?, ?> getFilterQuery(CommandContext commandContext) {
Filter filter = getFilter(commandContext);
Query<?, ?> query = filter.getQuery();
if (query instanceof TaskQuery) {
((TaskQuery) query).initializeFormKeys();
}
return query;
}
示例7: testCreateFilterWithTenantIdCriteria
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testCreateFilterWithTenantIdCriteria() {
TaskQuery query = taskService.createTaskQuery().tenantIdIn(TENANT_IDS);
filterId = createFilter(query);
Filter savedFilter = filterService.getFilter(filterId);
TaskQueryImpl savedQuery = savedFilter.getQuery();
assertThat(savedQuery.getTenantIds(), is(TENANT_IDS));
}
示例8: testCreateFilterWithNoTenantIdCriteria
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testCreateFilterWithNoTenantIdCriteria() {
TaskQuery query = taskService.createTaskQuery().withoutTenantId();
filterId = createFilter(query);
Filter savedFilter = filterService.getFilter(filterId);
TaskQueryImpl savedQuery = savedFilter.getQuery();
assertThat(savedQuery.isTenantIdSet(), is(true));
assertThat(savedQuery.getTenantIds(), is(nullValue()));
}
示例9: testExtendFilter
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testExtendFilter() {
TaskQuery extendingQuery = taskService.createTaskQuery()
.taskName("newName")
.taskOwner("newOwner");
Filter newFilter = filter.extend(extendingQuery);
assertNull(newFilter.getId());
TaskQueryImpl filterQuery = newFilter.getQuery();
assertEquals("newName", filterQuery.getName());
assertEquals("newOwner", filterQuery.getOwner());
}
示例10: 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());
}
示例11: testExtendingVariableQuery
import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testExtendingVariableQuery() {
TaskQuery taskQuery = taskService.createTaskQuery().processVariableValueEquals("hello", "world");
saveQuery(taskQuery);
// variables won't overridden variables with same name in different scopes
TaskQuery extendingQuery = taskService.createTaskQuery()
.taskVariableValueEquals("hello", "world")
.caseInstanceVariableValueEquals("hello", "world");
Filter extendedFilter = filter.extend(extendingQuery);
TaskQueryImpl extendedQuery = extendedFilter.getQuery();
List<TaskQueryVariableValue> variables = extendedQuery.getVariables();
assertEquals(3, variables.size());
// assert variables (ordering: extending variables are inserted first)
assertEquals("hello", variables.get(0).getName());
assertEquals("world", variables.get(0).getValue());
assertEquals(QueryOperator.EQUALS, variables.get(0).getOperator());
assertFalse(variables.get(0).isProcessInstanceVariable());
assertTrue(variables.get(0).isLocal());
assertEquals("hello", variables.get(1).getName());
assertEquals("world", variables.get(1).getValue());
assertEquals(QueryOperator.EQUALS, variables.get(1).getOperator());
assertFalse(variables.get(1).isProcessInstanceVariable());
assertFalse(variables.get(1).isLocal());
assertEquals("hello", variables.get(2).getName());
assertEquals("world", variables.get(2).getValue());
assertEquals(QueryOperator.EQUALS, variables.get(2).getOperator());
assertTrue(variables.get(2).isProcessInstanceVariable());
assertFalse(variables.get(2).isLocal());
// variables will override variables with same name in same scope
extendingQuery = taskService.createTaskQuery()
.processVariableValueLessThan("hello", 42)
.taskVariableValueLessThan("hello", 42)
.caseInstanceVariableValueLessThan("hello", 42);
extendedFilter = filter.extend(extendingQuery);
extendedQuery = extendedFilter.getQuery();
variables = extendedQuery.getVariables();
assertEquals(3, variables.size());
// assert variables (ordering: extending variables are inserted first)
assertEquals("hello", variables.get(0).getName());
assertEquals(42, variables.get(0).getValue());
assertEquals(QueryOperator.LESS_THAN, variables.get(0).getOperator());
assertTrue(variables.get(0).isProcessInstanceVariable());
assertFalse(variables.get(0).isLocal());
assertEquals("hello", variables.get(1).getName());
assertEquals(42, variables.get(1).getValue());
assertEquals(QueryOperator.LESS_THAN, variables.get(1).getOperator());
assertFalse(variables.get(1).isProcessInstanceVariable());
assertTrue(variables.get(1).isLocal());
assertEquals("hello", variables.get(2).getName());
assertEquals(42, variables.get(2).getValue());
assertEquals(QueryOperator.LESS_THAN, variables.get(2).getOperator());
assertFalse(variables.get(2).isProcessInstanceVariable());
assertFalse(variables.get(2).isLocal());
}