org.kie.server.api.model.definition.QueryParam类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(137)

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

QueryParam介绍

暂无

代码示例

代码示例来源:origin: kiegroup/droolsjbpm-integration

protected void unwrapParameters() {
    if (parameters == null) {
      return;
    }
    for (QueryParam param : parameters) {
      if (param.getValue() != null) {
        List<Object> items = new ArrayList<>();

        param.getValue().forEach(item -> {
          Object toAdd = item;
          if (item instanceof Wrapped) {
            toAdd = ((Wrapped) item).unwrap();
          }
          items.add(toAdd);
        });

        param.setValue(items);
      }
    }
  }
}

代码示例来源:origin: kiegroup/droolsjbpm-integration

public QueryFilterSpecBuilder notIn(String column, List<?> values) {
  parameters.add(new QueryParam(column, "NOT_IN", values));
  return this;
}

代码示例来源:origin: org.jbpm/jbpm-wb-kie-server-backend

@Test
public void testGroupWithNotSetInterval() {
  
  DataSetGroup dataSetGroup = new DataSetGroup();
  dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
                        COLUMN_TEST,
                        GroupStrategy.DYNAMIC));
 
  List<QueryParam> filterParams = new ArrayList<>();
  List<DataColumn> extraColumns = new ArrayList<>();
  kieServerDataSetProvider.handleDataSetGroup(dataSetDef, 
                        dataSetGroup, 
                        filterParams, 
                        extraColumns);
  assertEquals(1,
         filterParams.size());
  assertEquals(COLUMN_TEST,
         filterParams.get(0).getColumn());
  assertEquals("group",
         filterParams.get(0).getOperator());
  
  assertEquals(1,
         filterParams.get(0).getValue().size());
  assertEquals(COLUMN_TEST,
         filterParams.get(0).getValue().get(0));
}

代码示例来源:origin: org.jbpm/jbpm-wb-kie-server-backend

parameters.length);
List<CoreFunctionFilter> expr = (List<CoreFunctionFilter>) parameters[0].getValue();
assertEquals("OR",
       parameters[0].getOperator());

代码示例来源:origin: kiegroup/droolsjbpm-integration

@Test
public void testGetEqualsTo() {
  ProcessInstanceQueryFilterSpec filterSpec = new ProcessInstanceQueryFilterSpecBuilder().equalsTo(ProcessInstanceField.PROCESSID, "test-process").get();
  
  QueryParam[] params = filterSpec.getParameters();
  assertEquals(1, params.length);
  
  QueryParam param = params[0];
  assertEquals(ProcessInstanceField.PROCESSID.toString(), param.getColumn());
  assertEquals("EQUALS_TO", param.getOperator());
  assertEquals("test-process", param.getValue().stream().findFirst().get());
}

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

parameters.length);
List<CoreFunctionFilter> expr = (List<CoreFunctionFilter>) parameters[0].getValue();
assertEquals("OR",
       parameters[0].getOperator());

代码示例来源:origin: kiegroup/droolsjbpm-integration

@Test
public void testGetEqualsTo() {
  TaskQueryFilterSpec filterSpec = new TaskQueryFilterSpecBuilder().equalsTo(TaskField.PROCESSID, "test-process").get();
  
  QueryParam[] params = filterSpec.getParameters();
  assertEquals(1, params.length);
  
  QueryParam param = params[0];
  assertEquals(TaskField.PROCESSID.toString(), param.getColumn());
  assertEquals("EQUALS_TO", param.getOperator());
  assertEquals("test-process", param.getValue().stream().findFirst().get());
}

代码示例来源:origin: kiegroup/droolsjbpm-integration

public QueryFilterSpecBuilder isNull(String column) {
  parameters.add(new QueryParam(column, "IS_NULL", null));
  return this;
}

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

@Test
public void testGroupWithNotSetInterval() {
  
  DataSetGroup dataSetGroup = new DataSetGroup();
  dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
                        COLUMN_TEST,
                        GroupStrategy.DYNAMIC));
 
  List<QueryParam> filterParams = new ArrayList<>();
  List<DataColumn> extraColumns = new ArrayList<>();
  kieServerDataSetProvider.handleDataSetGroup(dataSetDef, 
                        dataSetGroup, 
                        filterParams, 
                        extraColumns);
  assertEquals(1,
         filterParams.size());
  assertEquals(COLUMN_TEST,
         filterParams.get(0).getColumn());
  assertEquals("group",
         filterParams.get(0).getOperator());
  
  assertEquals(1,
         filterParams.get(0).getValue().size());
  assertEquals(COLUMN_TEST,
         filterParams.get(0).getValue().get(0));
}

代码示例来源:origin: kiegroup/droolsjbpm-integration

public QueryFilterSpecBuilder in(String column, List<?> values) {
  parameters.add(new QueryParam(column, "IN", values));
  return this;
}

代码示例来源:origin: org.jbpm/jbpm-wb-kie-server-backend

filterParams.size());
assertEquals(COLUMN_TEST,
       filterParams.get(0).getColumn());
assertEquals("group",
       filterParams.get(0).getOperator());
       filterParams.get(0).getValue().size());
assertEquals(COLUMN_TEST,
       filterParams.get(0).getValue().get(0));
assertEquals(DateIntervalType.DAY.name(),
       filterParams.get(0).getValue().get(1));
assertEquals(30,
       filterParams.get(0).getValue().get(2));

代码示例来源:origin: kiegroup/droolsjbpm-integration

public QueryFilterSpecBuilder isNotNull(String column) {
  parameters.add(new QueryParam(column, "NOT_NULL", null));
  return this;
}

代码示例来源:origin: org.kie.server/kie-server-services-jbpm-search

public <T> T getWithFilters(Integer page, Integer pageSize, QueryCallback queryCallback, RequestCallback reqCallback) {
  QueryParam[] params = new QueryParam[0];
  Map<String, String> columnMapping = null;
  QueryContext queryContext = buildQueryContext(page, pageSize);
  BaseQueryFilterSpec filterSpec = reqCallback.getQueryFilterSpec();
  if (filterSpec != null) {
    queryContext.setOrderBy(filterSpec.getOrderBy());
    queryContext.setAscending(filterSpec.isAscending());
    // build parameters for filtering the query
    if (filterSpec.getParameters() != null) {
      params = new QueryParam[filterSpec.getParameters().length];
      int index = 0;
      for (org.kie.server.api.model.definition.QueryParam param : filterSpec.getParameters()) {
        params[index] = new QueryParam(param.getColumn(), param.getOperator(), param.getValue());
        index++;
      }
    }
  }
  QueryResultMapper<?> resultMapper = QueryMapperRegistry.get().mapperFor(queryCallback.getMapperName(), columnMapping);
  logger.debug("About to perform query '{}' with page {} and page size {}", queryCallback.getQueryName(), page, pageSize);
  Object result = queryService.query(queryCallback.getQueryName(), resultMapper, queryContext, params);
  logger.debug("Result returned from the query {} mapped with {}", result, resultMapper);
  return (T) transform(result, resultMapper);
}

代码示例来源:origin: kiegroup/droolsjbpm-integration

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

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

filterParams.size());
assertEquals(COLUMN_TEST,
       filterParams.get(0).getColumn());
assertEquals("group",
       filterParams.get(0).getOperator());
       filterParams.get(0).getValue().size());
assertEquals(COLUMN_TEST,
       filterParams.get(0).getValue().get(0));
assertEquals(DateIntervalType.DAY.name(),
       filterParams.get(0).getValue().get(1));
assertEquals(30,
       filterParams.get(0).getValue().get(2));

代码示例来源:origin: kiegroup/droolsjbpm-integration

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

代码示例来源:origin: org.jbpm/jbpm-wb-kie-server-backend

@Test
public void appendBetweenIntervalSelectionTest() {
  String filterValue = "testValue";
  Long minValue = Long.valueOf(0);
  Long maxValue = Long.valueOf(2);
  DataSetGroup dataSetGroup = new DataSetGroup();
  dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
                        COLUMN_TEST,
                        GroupStrategy.DYNAMIC));
  List<Interval> intervalList = new ArrayList<Interval>();
  Interval interval = new Interval(filterValue);
  interval.setMinValue(minValue);
  interval.setMaxValue(maxValue);
  intervalList.add(interval);
  dataSetGroup.setSelectedIntervalList(intervalList);
  List<QueryParam> filterParams = new ArrayList<>();
  kieServerDataSetProvider.appendIntervalSelection(dataSetGroup,
                           filterParams);
  assertEquals(1,
         filterParams.size());
  assertEquals(COLUMN_TEST,
         filterParams.get(0).getColumn());
  assertEquals("BETWEEN",
         filterParams.get(0).getOperator());
  assertEquals(Double.valueOf(minValue),
         filterParams.get(0).getValue().get(0));
  assertEquals(Double.valueOf(maxValue),
         filterParams.get(0).getValue().get(1));
}

代码示例来源:origin: kiegroup/droolsjbpm-integration

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

代码示例来源:origin: org.kie.server/kie-server-services-jbpm

int index = 0;
for (org.kie.server.api.model.definition.QueryParam param : filterSpec.getParameters()) {
  params[index] = new QueryParam(param.getColumn(), param.getOperator(), param.getValue());
  index++;

代码示例来源:origin: kiegroup/droolsjbpm-integration

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

相关文章