org.jbpm.services.api.query.model.QueryParam类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中org.jbpm.services.api.query.model.QueryParam类的一些代码示例,展示了QueryParam类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryParam类的具体详情如下:
包路径:org.jbpm.services.api.query.model.QueryParam
类名称:QueryParam

QueryParam介绍

[英]Basic data carrier to provide filtering capabilities on top of query definition.
[中]基本数据载体在查询定义的基础上提供过滤功能。

代码示例

代码示例来源:origin: kiegroup/jbpm

public static QueryParam in(String column, List<?> values) {
  return new QueryParam(column, "IN", values);
}

代码示例来源:origin: org.jbpm/jbpm-services-ejb-impl

QueryParam.equalsTo(COLUMN_TASK_VAR_NAME, "Comment"), 
                          QueryParam.equalsTo(COLUMN_TASK_VAR_VALUE, "Write a Document"));
assertNotNull(taskInstanceLogs);
assertEquals(1, taskInstanceLogs.size());
    QueryParam.equalsTo(COLUMN_TASK_VAR_NAME, "Comment"), 
    QueryParam.equalsTo(COLUMN_TASK_VAR_VALUE, "Wrong Comment"));
assertNotNull(taskInstanceLogs);
assertEquals(0, taskInstanceLogs.size());

代码示例来源:origin: org.jbpm/jbpm-services-ejb-impl

@Test
public void testGetProcessInstancesByProcessId() {
  query = new SqlQueryDefinition("getAllProcessInstances", "java:jboss/datasources/ExampleDS");
  query.setExpression("select * from processinstancelog");
  
  queryService.registerQuery(query);
  
  Collection<ProcessInstanceDesc> instances = queryService.query(query.getName(), ProcessInstanceQueryMapper.get(), new QueryContext());
  assertNotNull(instances);
  assertEquals(0, instances.size());
  processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
  assertNotNull(processInstanceId);
  instances = queryService.query(query.getName(), ProcessInstanceQueryMapper.get(), new QueryContext(), QueryParam.likeTo(COLUMN_PROCESSID, true, "org.jbpm%"));
  assertNotNull(instances);
  assertEquals(1, instances.size());
  
  processService.abortProcessInstance(processInstanceId);
  processInstanceId = null;
}

代码示例来源:origin: org.jbpm/jbpm-services-ejb-impl

assertEquals(3, instance.getVariables().size());
processInstanceLogs = queryService.query(query.getName(), ProcessInstanceWithVarsQueryMapper.get(), new QueryContext(), QueryParam.equalsTo(COLUMN_VAR_NAME, "approval_document"));
assertNotNull(processInstanceLogs);
assertEquals(1, processInstanceLogs.size());
assertEquals(1, instance.getVariables().size());
processInstanceLogs = queryService.query(query.getName(), ProcessInstanceWithVarsQueryMapper.get(), new QueryContext(), QueryParam.equalsTo(COLUMN_VAR_NAME, "not existing"));
assertNotNull(processInstanceLogs);
assertEquals(0, processInstanceLogs.size());

代码示例来源:origin: kiegroup/jbpm

public static QueryParam notIn(String column, List<?> values) {
  return new QueryParam(column, "NOT_IN", values);
}

代码示例来源:origin: org.jbpm/jbpm-services-ejb-impl

@Test
public void testGetProcessInstancesByState() {
  query = new SqlQueryDefinition("getAllProcessInstances", "java:jboss/datasources/ExampleDS");
  query.setExpression("select * from processinstancelog");
  
  queryService.registerQuery(query);
  
  Collection<ProcessInstanceDesc> instances = queryService.query(query.getName(), ProcessInstanceQueryMapper.get(), new QueryContext());
  assertNotNull(instances);
  assertEquals(0, instances.size());
  processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
  assertNotNull(processInstanceId);
  // search for aborted only
  instances = queryService.query(query.getName(), ProcessInstanceQueryMapper.get(), new QueryContext(), QueryParam.equalsTo(COLUMN_STATUS, 3));
  assertNotNull(instances);
  assertEquals(0, instances.size());
  // aborted and active
  instances = queryService.query(query.getName(), ProcessInstanceQueryMapper.get(), new QueryContext(), QueryParam.equalsTo(COLUMN_STATUS, 3, 1));
  assertNotNull(instances);
  assertEquals(1, instances.size());
  processService.abortProcessInstance(processInstanceId);
  processInstanceId = null;
  // aborted only
  instances = queryService.query(query.getName(), ProcessInstanceQueryMapper.get(), new QueryContext(), QueryParam.equalsTo(COLUMN_STATUS, 3));
  assertNotNull(instances);
  assertEquals(1, instances.size());
  assertEquals(3, (int)instances.iterator().next().getState());
}

代码示例来源:origin: kiegroup/jbpm

public static QueryParam isNotNull(String column) {
  return new QueryParam(column, "NOT_NULL", null);
}

代码示例来源:origin: kiegroup/jbpm

public static QueryParam isNull(String column) {
  return new QueryParam(column, "IS_NULL", null);
}

代码示例来源:origin: kiegroup/jbpm

@SuppressWarnings("unchecked")
public static QueryParam greaterThan(String column, Comparable<?> value) {
  return new QueryParam(column, "GREATER_THAN", Arrays.asList(value));
}

代码示例来源:origin: kiegroup/jbpm

@SuppressWarnings("unchecked")
public static QueryParam lowerThan(String column, Comparable<?> value) {
  return new QueryParam(column, "LOWER_THAN", Arrays.asList(value));
}

代码示例来源:origin: kiegroup/jbpm

@SuppressWarnings("unchecked")
public static QueryParam lowerOrEqualTo(String column, Comparable<?> value) {
  return new QueryParam(column, "LOWER_OR_EQUALS_TO", Arrays.asList(value));
}

代码示例来源:origin: kiegroup/jbpm

public static QueryParam distinct(String column) {
  return new QueryParam(column, "DISTINCT", Arrays.asList(column));
}

代码示例来源:origin: kiegroup/jbpm

public static QueryParam equalsTo(String column, Comparable<?>...values) {
  return new QueryParam(column, "EQUALS_TO", Arrays.asList(values));
}

代码示例来源:origin: kiegroup/jbpm

@SuppressWarnings("unchecked")
public static QueryParam greaterOrEqualTo(String column, Comparable<?> value) {
  return new QueryParam(column, "GREATER_OR_EQUALS_TO", Arrays.asList(value));
}

代码示例来源:origin: kiegroup/jbpm

@SuppressWarnings("unchecked")
public static QueryParam between(String column, Comparable<?> start, Comparable<?> end) {
  return new QueryParam(column, "BETWEEN", Arrays.asList(start, end));
}

代码示例来源:origin: kiegroup/jbpm

@SuppressWarnings("unchecked")
public static QueryParam likeTo(String column, boolean caseSensitive, Comparable<?> value) {
  return new QueryParam(column, "LIKE_TO", Arrays.asList(value, caseSensitive));
}

代码示例来源:origin: kiegroup/jbpm

public static QueryParam count(String column) {
  return new QueryParam(column, "COUNT", Arrays.asList(column));
}

代码示例来源:origin: kiegroup/jbpm

public static QueryParam average(String column) {
  return new QueryParam(column, "AVERAGE", Arrays.asList(column));
}

代码示例来源:origin: kiegroup/jbpm

public static QueryParam[] groupBy(String column) {
  return new QueryParam[] {new QueryParam(column, "group", Arrays.asList(column)), new QueryParam(column, null, Arrays.asList(column))};
}

代码示例来源:origin: kiegroup/jbpm

public static QueryParam sum(String column) {
  return new QueryParam(column, "SUM", Arrays.asList(column));
}

相关文章

QueryParam类方法