Search in sources :

Example 1 with TaskSummaryQueryBuilderImpl

use of org.jbpm.services.task.impl.TaskSummaryQueryBuilderImpl in project jbpm by kiegroup.

the class RuntimeDataServiceImpl method getTasksByVariable.

@Override
public List<TaskSummary> getTasksByVariable(String userId, String variableName, List<Status> statuses, QueryContext queryContext) {
    TaskSummaryQueryBuilder queryBuilder = new TaskSummaryQueryBuilderImpl(userId, taskService).intersect();
    addVariableNameAndVariableValueParameters(queryBuilder, variableName);
    if (statuses != null && !statuses.isEmpty()) {
        queryBuilder.status(statuses.toArray(new Status[statuses.size()]));
    }
    setQueryContextOptions(queryContext, queryBuilder);
    return queryBuilder.build().getResultList();
}
Also used : Status(org.kie.api.task.model.Status) TaskSummaryQueryBuilder(org.kie.internal.task.query.TaskSummaryQueryBuilder) TaskSummaryQueryBuilderImpl(org.jbpm.services.task.impl.TaskSummaryQueryBuilderImpl)

Example 2 with TaskSummaryQueryBuilderImpl

use of org.jbpm.services.task.impl.TaskSummaryQueryBuilderImpl in project jbpm by kiegroup.

the class RuntimeDataServiceImpl method getTasksByVariableAndValue.

@Override
public List<TaskSummary> getTasksByVariableAndValue(String userId, String variableName, String variableValue, List<Status> statuses, QueryContext queryContext) {
    TaskSummaryQueryBuilder queryBuilder = new TaskSummaryQueryBuilderImpl(userId, taskService).intersect();
    addVariableNameAndVariableValueParameters(queryBuilder, variableName, variableValue);
    if (statuses != null && !statuses.isEmpty()) {
        queryBuilder.status(statuses.toArray(new Status[statuses.size()]));
    }
    setQueryContextOptions(queryContext, queryBuilder);
    return queryBuilder.build().getResultList();
}
Also used : Status(org.kie.api.task.model.Status) TaskSummaryQueryBuilder(org.kie.internal.task.query.TaskSummaryQueryBuilder) TaskSummaryQueryBuilderImpl(org.jbpm.services.task.impl.TaskSummaryQueryBuilderImpl)

Aggregations

TaskSummaryQueryBuilderImpl (org.jbpm.services.task.impl.TaskSummaryQueryBuilderImpl)2 Status (org.kie.api.task.model.Status)2 TaskSummaryQueryBuilder (org.kie.internal.task.query.TaskSummaryQueryBuilder)2