code: public void completeTask() {
      assertTaskAssociated();
      processEngine.getTaskService().setVariablesLocal(getTask().getId(), getAndClearCachedLocalVariableMap());
      processEngine.getTaskService().setVariables(getTask().getId(), getAndClearCachedVariableMap());
      processEngine.getTaskService().complete(getTask().getId());
      associationManager.disAssociate();
    }
docs: Completes the current UserTask, see {@link TaskService#complete(String)}
  <p/>
  Ends the current unit of work (flushes changes to process variables set
  using {@link #setVariable(String, Object)} or made on
  {@link BusinessProcessScoped @BusinessProcessScoped} beans).
  
  @throws ProcessEngineCdiException
  if no task is currently associated
  @throws ProcessEngineException
  if the activiti command fails