code: private void completeTasks() {
          synchronized (_userTasks) {
              if (_userTasks.size() > 0) {
                  for (TaskSummary task : _userTasks) {
                      _taskService.claim(task.getId(), _userId);
                      _taskService.start(task.getId(), _userId);
                      Map<String, Object> results = new HashMap<String, Object>();
                      Ticket ticket = _userTickets.get(task.getProcessInstanceId());
                      results.put(TICKET, ticket);
                      _taskService.complete(task.getId(), _userId, results);
                  }
              }
          }
      }
docs: Complete tasks.