Search in sources :

Example 1 with QueryWhere

use of org.jbpm.query.jpa.data.QueryWhere in project jbpm by kiegroup.

the class ErrorInfoQueryBuilderImpl method stackTraceRegex.

@Override
public ErrorInfoQueryBuilder stackTraceRegex(String... stackTraceRegex) {
    QueryWhere queryWhere = getQueryWhere();
    QueryCriteriaType origCriteriaType = queryWhere.getCriteriaType();
    queryWhere.setToLike();
    addObjectParameter(STACK_TRACE_LIST, "stack trace regex", stackTraceRegex);
    switch(origCriteriaType) {
        case NORMAL:
            queryWhere.setToNormal();
            break;
        case RANGE:
            queryWhere.setToRange();
            break;
        case GROUP:
            queryWhere.setToGroup();
            break;
        case REGEXP:
    }
    return this;
}
Also used : QueryWhere(org.jbpm.query.jpa.data.QueryWhere) QueryCriteriaType(org.jbpm.query.jpa.data.QueryWhere.QueryCriteriaType)

Example 2 with QueryWhere

use of org.jbpm.query.jpa.data.QueryWhere in project jbpm by kiegroup.

the class AuditQueryCriteriaUtilTest method auditQueryCriteriaWhereTest.

@Test
public void auditQueryCriteriaWhereTest() {
    QueryWhere where = new QueryWhere();
    // OR
    where.setToUnion();
    where.addParameter(NODE_ID_LIST, "node.id");
    where.addParameter(NODE_INSTANCE_ID_LIST, "node-inst");
    where.addParameter(TYPE_LIST, "type");
    // OR (
    where.newGroup();
    where.setToLike();
    where.addParameter(NODE_NAME_LIST, "n*ends.X");
    where.setToNormal();
    where.setToIntersection();
    where.addParameter(TYPE_LIST, "oneOf3", "twoOf3", "thrOf3");
    where.endGroup();
    where.setToIntersection();
    where.addRangeParameter(PROCESS_INSTANCE_ID_LIST, 0l, true);
    where.addRangeParameter(PROCESS_INSTANCE_ID_LIST, 10l, false);
    where.addParameter(PROCESS_ID_LIST, "org.process.id");
    List<NodeInstanceLog> result = util.doCriteriaQuery(where, NodeInstanceLog.class);
    assertNotNull("Null result from 1rst query.", result);
}
Also used : NodeInstanceLog(org.jbpm.process.audit.NodeInstanceLog) QueryWhere(org.jbpm.query.jpa.data.QueryWhere) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Example 3 with QueryWhere

use of org.jbpm.query.jpa.data.QueryWhere in project jbpm by kiegroup.

the class TaskSummaryQueryBuilderImpl method build.

@Override
public ParametrizedQuery<TaskSummary> build() {
    return new ParametrizedQuery<TaskSummary>() {

        private QueryWhere queryWhere = new QueryWhere(getQueryWhere());

        @Override
        public List<TaskSummary> getResultList() {
            TaskSummaryQueryCommand cmd = new TaskSummaryQueryCommand(queryWhere);
            cmd.setUserId(userId);
            return executor.execute(cmd);
        }
    };
}
Also used : TaskSummaryQueryCommand(org.jbpm.services.task.commands.TaskSummaryQueryCommand) ParametrizedQuery(org.kie.internal.query.ParametrizedQuery) TaskSummary(org.kie.api.task.model.TaskSummary) QueryWhere(org.jbpm.query.jpa.data.QueryWhere)

Example 4 with QueryWhere

use of org.jbpm.query.jpa.data.QueryWhere in project jbpm by kiegroup.

the class AuditQueryCriteriaUtilTest method auditQueryCriteriaMetaTest.

@Test
public void auditQueryCriteriaMetaTest() {
    QueryWhere where = new QueryWhere();
    where.setAscending(QueryParameterIdentifiers.NODE_INSTANCE_ID_LIST);
    where.setCount(10);
    where.setOffset(2);
    List<NodeInstanceLog> result = util.doCriteriaQuery(where, NodeInstanceLog.class);
    assertNotNull("Null result from 1rst query.", result);
}
Also used : NodeInstanceLog(org.jbpm.process.audit.NodeInstanceLog) QueryWhere(org.jbpm.query.jpa.data.QueryWhere) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Aggregations

QueryWhere (org.jbpm.query.jpa.data.QueryWhere)4 NodeInstanceLog (org.jbpm.process.audit.NodeInstanceLog)2 AbstractBaseTest (org.jbpm.test.util.AbstractBaseTest)2 Test (org.junit.Test)2 QueryCriteriaType (org.jbpm.query.jpa.data.QueryWhere.QueryCriteriaType)1 TaskSummaryQueryCommand (org.jbpm.services.task.commands.TaskSummaryQueryCommand)1 TaskSummary (org.kie.api.task.model.TaskSummary)1 ParametrizedQuery (org.kie.internal.query.ParametrizedQuery)1