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;
}
Aggregations