use of org.camunda.bpm.engine.externaltask.LockedExternalTask in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQuerySortingTest method completeExternalTask.
protected void completeExternalTask(String externalTaskId, String topic, String workerId, boolean usePriority) {
List<LockedExternalTask> list = externalTaskService.fetchAndLock(100, workerId, usePriority).topic(topic, LOCK_DURATION).execute();
externalTaskService.complete(externalTaskId, workerId);
// unlock the remaining tasks
for (LockedExternalTask lockedExternalTask : list) {
if (!lockedExternalTask.getId().equals(externalTaskId)) {
externalTaskService.unlock(lockedExternalTask.getId());
}
}
}
Aggregations