Search in sources :

Example 1 with ExternalTaskQueryTopicBuilder

use of org.camunda.bpm.engine.externaltask.ExternalTaskQueryTopicBuilder in project camunda-bpm-platform by camunda.

the class FetchExternalTasksDto method buildQuery.

public ExternalTaskQueryBuilder buildQuery(ProcessEngine processEngine) {
    ExternalTaskQueryBuilder fetchBuilder = processEngine.getExternalTaskService().fetchAndLock(getMaxTasks(), getWorkerId(), isUsePriority());
    if (getTopics() != null) {
        for (FetchExternalTaskTopicDto topicDto : getTopics()) {
            ExternalTaskQueryTopicBuilder topicFetchBuilder = fetchBuilder.topic(topicDto.getTopicName(), topicDto.getLockDuration());
            if (topicDto.getBusinessKey() != null) {
                topicFetchBuilder = topicFetchBuilder.businessKey(topicDto.getBusinessKey());
            }
            if (topicDto.getVariables() != null) {
                topicFetchBuilder = topicFetchBuilder.variables(topicDto.getVariables());
            }
            if (topicDto.getProcessVariables() != null) {
                topicFetchBuilder = topicFetchBuilder.processInstanceVariableEquals(topicDto.getProcessVariables());
            }
            if (topicDto.isDeserializeValues()) {
                topicFetchBuilder = topicFetchBuilder.enableCustomObjectDeserialization();
            }
            fetchBuilder = topicFetchBuilder;
        }
    }
    return fetchBuilder;
}
Also used : ExternalTaskQueryBuilder(org.camunda.bpm.engine.externaltask.ExternalTaskQueryBuilder) ExternalTaskQueryTopicBuilder(org.camunda.bpm.engine.externaltask.ExternalTaskQueryTopicBuilder)

Aggregations

ExternalTaskQueryBuilder (org.camunda.bpm.engine.externaltask.ExternalTaskQueryBuilder)1 ExternalTaskQueryTopicBuilder (org.camunda.bpm.engine.externaltask.ExternalTaskQueryTopicBuilder)1