Assigns the task to another user. This makes the user responsible for the
task and its completion.

@param taskId
The id of the task to assign
@param responsible
The id of the user the task should be assigned to
191021
public void assignTask(int taskId, int responsible) {
		getResourceFactory()
				.getApiResource("/task/" + taskId + "/assign")
				.entity(new AssignValue(responsible),
						MediaType.APPLICATION_JSON_TYPE).post();
	}
145673
public void completed(TaskAttemptID taskid) {
    //
    // Record that this taskid is complete
    //
    completedTask(taskid, TaskStatus.State.SUCCEEDED);
        
    // Note the successful taskid
    setSuccessfulTaskid(taskid);
    
    //
    // Now that the TIP is complete, the other speculative 
    // subtasks will be closed when the owning tasktracker 
    // reports in and calls shouldClose() on this object.
    //

    this.completes++;
    this.execFinishTime = JobTracker.getClock().getTime();
    recomputeProgress();
    
  }
703553
public void waitTask(String taskID, long timeToWait) throws AlgoliaException {
    this.waitTask(taskID, timeToWait, RequestOptions.empty);
  }
192779
@Override
  public final 
  void setupTask(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext
                 ) throws IOException {
    setupTask((TaskAttemptContext) taskContext);
  }
909288
public void addChildTask(Task child)
   {
      child.m_parent = this;
      m_children.add(child);
      setSummary(true);

      if (getParentFile().getProjectConfig().getAutoOutlineLevel() == true)
      {
         child.setOutlineLevel(Integer.valueOf(NumberHelper.getInt(getOutlineLevel()) + 1));
      }
   }
547755
private void readTasks(Integer id)
   {
      Integer currentID = id;
      Table table = getTable("WBSTAB");

      while (currentID.intValue() != 0)
      {
         MapRow row = table.find(currentID);
         Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID"));
         readLeafTasks(task, row.getInteger("FIRST_CHILD_TASK_ID"));
         Integer childID = row.getInteger("CHILD_ID");
         if (childID.intValue() != 0)
         {
            readTasks(childID);
         }
         currentID = row.getInteger("NEXT_ID");
      }
   }
347741
protected void processTask(Row row)
   {
      Integer uniqueID = row.getInteger("TASK_UID");
      if (uniqueID != null && uniqueID.intValue() >= 0)
      {
         Task task = m_project.addTask();
         TimeUnit durationFormat = MPDUtility.getDurationTimeUnits(row.getInt("TASK_DUR_FMT"));

         task.setActualCost(row.getCurrency("TASK_ACT_COST"));
         task.setActualDuration(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_ACT_DUR"), durationFormat));
         task.setActualFinish(row.getDate("TASK_ACT_FINISH"));
         task.setActualOvertimeCost(row.getCurrency("TASK_ACT_OVT_COST"));
         task.setActualOvertimeWork(row.getDuration("TASK_ACT_OVT_WORK"));
         //task.setActualOvertimeWorkProtected();
         task.setActualStart(row.getDate("TASK_ACT_START"));
         task.setActualWork(row.getDuration("TASK_ACT_WORK"));
         //task.setActualWorkProtected();
         task.setACWP(row.getCurrency("TASK_ACWP"));
         task.setBaselineCost(row.getCurrency("TASK_BASE_COST"));
         task.setBaselineDuration(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_BASE_DUR"), durationFormat));
         task.setBaselineFinish(row.getDate("TASK_BASE_FINISH"));
         task.setBaselineStart(row.getDate("TASK_BASE_START"));
         task.setBaselineWork(row.getDuration("TASK_BASE_WORK"));
         //task.setBCWP(row.getCurrency("TASK_BCWP")); //@todo FIXME
         //task.setBCWS(row.getCurrency("TASK_BCWS")); //@todo FIXME
         task.setCalendar(m_project.getCalendarByUniqueID(row.getInteger("TASK_CAL_UID")));
         //task.setConfirmed();
         task.setConstraintDate(row.getDate("TASK_CONSTRAINT_DATE"));
         task.setConstraintType(ConstraintType.getInstance(row.getInt("TASK_CONSTRAINT_TYPE")));
         //task.setContact();
         task.setCost(row.getCurrency("TASK_COST"));
         //task.setCost1();
         //task.setCost2();
         //task.setCost3();
         //task.setCost4();
         //task.setCost5();
         //task.setCost6();
         //task.setCost7();
         //task.setCost8();
         //task.setCost9();
         //task.setCost10();
         //task.setCostVariance();
         task.setCreateDate(row.getDate("TASK_CREATION_DATE"));
         //task.setCritical(row.getBoolean("TASK_IS_CRITICAL")); @todo FIX ME
         //task.setCV();
         //task.setDate1();
         //task.setDate2();
         //task.setDate3();
         //task.setDate4();
         //task.setDate5();
         //task.setDate6();
         //task.setDate7();
         //task.setDate8();
         //task.setDate9();
         //task.setDate10();
         task.setDeadline(row.getDate("TASK_DEADLINE"));
         //task.setDelay();
         task.setDuration(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_DUR"), durationFormat));

         //task.setDuration1();
         //task.setDuration2();
         //task.setDuration3();
         //task.setDuration4();
         //task.setDuration5();
         //task.setDuration6();
         //task.setDuration7();
         //task.setDuration8();
         //task.setDuration9();
         //task.setDuration10();

         task.setDurationVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_DUR_VAR"), durationFormat));
         task.setEarlyFinish(row.getDate("TASK_EARLY_FINISH"));
         task.setEarlyStart(row.getDate("TASK_EARLY_START"));
         //task.setEarnedValueMethod();
         task.setEffortDriven(row.getBoolean("TASK_IS_EFFORT_DRIVEN"));
         task.setEstimated(row.getBoolean("TASK_DUR_IS_EST"));
         task.setExpanded(!row.getBoolean("TASK_IS_COLLAPSED"));
         task.setExternalTask(row.getBoolean("TASK_IS_EXTERNAL"));
         //task.setExternalTaskProject();
         task.setFinish(row.getDate("TASK_FINISH_DATE"));
         //task.setFinish1();
         //task.setFinish2();
         //task.setFinish3();
         //task.setFinish4();
         //task.setFinish5();
         //task.setFinish6();
         //task.setFinish7();
         //task.setFinish8();
         //task.setFinish9();
         //task.setFinish10();
         //task.setFinishVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_FINISH_VAR"), durationFormat)); // Calculate for consistent results?
         //task.setFixed();
         task.setFixedCost(row.getCurrency("TASK_FIXED_COST"));
         task.setFixedCostAccrual(AccrueType.getInstance(row.getInt("TASK_FIXED_COST_ACCRUAL")));
         //task.setFlag1();
         //task.setFlag2();
         //task.setFlag3();
         //task.setFlag4();
         //task.setFlag5();
         //task.setFlag6();
         //task.setFlag7();
         //task.setFlag8();
         //task.setFlag9();
         //task.setFlag10();
         //task.setFlag11();
         //task.setFlag12();
         //task.setFlag13();
         //task.setFlag14();
         //task.setFlag15();
         //task.setFlag16();
         //task.setFlag17();
         //task.setFlag18();
         //task.setFlag19();
         //task.setFlag20();
         task.setFreeSlack(row.getDuration("TASK_FREE_SLACK").convertUnits(durationFormat, m_project.getProjectProperties()));
         task.setHideBar(row.getBoolean("TASK_BAR_IS_HIDDEN"));
         //task.setHyperlink();
         //task.setHyperlinkAddress();
         //task.setHyperlinkSubAddress();
         task.setID(row.getInteger("TASK_ID"));
         task.setIgnoreResourceCalendar(row.getBoolean("TASK_IGNORES_RES_CAL"));
         task.setLateFinish(row.getDate("TASK_LATE_FINISH"));
         task.setLateStart(row.getDate("TASK_LATE_START"));
         task.setLevelAssignments(row.getBoolean("TASK_LEVELING_ADJUSTS_ASSN"));
         task.setLevelingCanSplit(row.getBoolean("TASK_LEVELING_CAN_SPLIT"));
         task.setLevelingDelayFormat(MPDUtility.getDurationTimeUnits(row.getInt("TASK_LEVELING_DELAY_FMT")));
         task.setLevelingDelay(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_LEVELING_DELAY"), task.getLevelingDelayFormat()));
         //task.setLinkedFields(row.getBoolean("TASK_HAS_LINKED_FIELDS")); @todo FIXME
         task.setMarked(row.getBoolean("TASK_IS_MARKED"));
         task.setMilestone(row.getBoolean("TASK_IS_MILESTONE"));
         task.setName(row.getString("TASK_NAME"));
         //task.setNull();
         //task.setNumber1();
         //task.setNumber2();
         //task.setNumber3();
         //task.setNumber4();
         //task.setNumber5();
         //task.setNumber6();
         //task.setNumber7();
         //task.setNumber8();
         //task.setNumber9();
         //task.setNumber10();
         //task.setNumber11();
         //task.setNumber12();
         //task.setNumber13();
         //task.setNumber14();
         //task.setNumber15();
         //task.setNumber16();
         //task.setNumber17();
         //task.setNumber18();
         //task.setNumber19();
         //task.setNumber20();
         task.setObjects(getNullOnValue(row.getInteger("TASK_NUM_OBJECTS"), 0));
         //task.setOutlineCode1();
         //task.setOutlineCode2();
         //task.setOutlineCode3();
         //task.setOutlineCode4();
         //task.setOutlineCode5();
         //task.setOutlineCode6();
         //task.setOutlineCode7();
         //task.setOutlineCode8();
         //task.setOutlineCode9();
         //task.setOutlineCode10();
         task.setOutlineLevel(row.getInteger("TASK_OUTLINE_LEVEL"));
         task.setOutlineNumber(row.getString("TASK_OUTLINE_NUM"));
         task.setOverAllocated(row.getBoolean("TASK_IS_OVERALLOCATED"));
         task.setOvertimeCost(row.getCurrency("TASK_OVT_COST"));
         //task.setOvertimeWork();
         task.setPercentageComplete(row.getDouble("TASK_PCT_COMP"));
         task.setPercentageWorkComplete(row.getDouble("TASK_PCT_WORK_COMP"));
         //task.setPhysicalPercentComplete();
         task.setPreleveledFinish(row.getDate("TASK_PRELEVELED_FINISH"));
         task.setPreleveledStart(row.getDate("TASK_PRELEVELED_START"));
         task.setPriority(Priority.getInstance(row.getInt("TASK_PRIORITY")));
         task.setRecurring(row.getBoolean("TASK_IS_RECURRING"));
         task.setRegularWork(row.getDuration("TASK_REG_WORK"));
         task.setRemainingCost(row.getCurrency("TASK_REM_COST"));
         task.setRemainingDuration(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_REM_DUR"), durationFormat));
         task.setRemainingOvertimeCost(row.getCurrency("TASK_REM_OVT_COST"));
         task.setRemainingOvertimeWork(row.getDuration("TASK_REM_OVT_WORK"));
         task.setRemainingWork(row.getDuration("TASK_REM_WORK"));
         //task.setResourceGroup();
         //task.setResourceInitials();
         //task.setResourceNames();
         task.setResume(row.getDate("TASK_RESUME_DATE"));
         //task.setResumeNoEarlierThan();
         //task.setResumeValid();
         task.setRollup(row.getBoolean("TASK_IS_ROLLED_UP"));
         task.setStart(row.getDate("TASK_START_DATE"));
         //task.setStart1();
         //task.setStart2();
         //task.setStart3();
         //task.setStart4();
         //task.setStart5();
         //task.setStart6();
         //task.setStart7();
         //task.setStart8();
         //task.setStart9();
         //task.setStart10();
         //task.setStartVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_START_VAR"), durationFormat)); // more accurate by calculation?
         task.setStop(row.getDate("TASK_STOP_DATE"));
         task.setSummary(row.getBoolean("TASK_IS_SUMMARY"));
         //task.setText1();
         //task.setText2();
         //task.setText3();
         //task.setText4();
         //task.setText5();
         //task.setText6();
         //task.setText7();
         //task.setText8();
         //task.setText9();
         //task.setText10();
         //task.setText11();
         //task.setText12();
         //task.setText13();
         //task.setText14();
         //task.setText15();
         //task.setText16();
         //task.setText17();
         //task.setText18();
         //task.setText19();
         //task.setText20();
         //task.setText21();
         //task.setText22();
         //task.setText23();
         //task.setText24();
         //task.setText25();
         //task.setText26();
         //task.setText27();
         //task.setText28();
         //task.setText29();
         //task.setText30();
         //task.setTotalSlack(row.getDuration("TASK_TOTAL_SLACK")); //@todo FIX ME
         task.setType(TaskType.getInstance(row.getInt("TASK_TYPE")));
         task.setUniqueID(uniqueID);
         //task.setUpdateNeeded();
         task.setWBS(row.getString("TASK_WBS"));
         //task.setWBSLevel();
         task.setWork(row.getDuration("TASK_WORK"));
         //task.setWorkVariance();

         //TASK_HAS_NOTES = false ( java.lang.Boolean)
         //TASK_RTF_NOTES = null ( )
         String notes = row.getString("TASK_RTF_NOTES");
         if (notes != null)
         {
            if (m_preserveNoteFormatting == false)
            {
               notes = RtfHelper.strip(notes);
            }
            task.setNotes(notes);
         }

         //
         // Calculate the cost variance
         //
         if (task.getCost() != null && task.getBaselineCost() != null)
         {
            task.setCostVariance(NumberHelper.getDouble(task.getCost().doubleValue() - task.getBaselineCost().doubleValue()));
         }

         //
         // Set default flag values
         //
         task.setFlag(1, false);
         task.setFlag(2, false);
         task.setFlag(3, false);
         task.setFlag(4, false);
         task.setFlag(5, false);
         task.setFlag(6, false);
         task.setFlag(7, false);
         task.setFlag(8, false);
         task.setFlag(9, false);
         task.setFlag(10, false);

         //
         // If we have a WBS value from the MPD file, don't autogenerate
         //
         if (task.getWBS() != null)
         {
            m_autoWBS = false;
         }

         //
         // Attempt to identify null tasks
         //
         if (task.getName() == null && task.getStart() == null && task.getFinish() == null)
         {
            task.setNull(true);
         }

         m_eventManager.fireTaskReadEvent(task);
      }
   }
878982
@Override
	public List<TaskSummary> getTasksAssignedAsBusinessAdministrator(String userId, String language) {
		return delegate.getTasksAssignedAsBusinessAdministrator(userId, language);
	}
399175
public void addTaskProperties(Task task)
    {
    	if (task == null)
    		return;
        this.put(TrxMessageHeader.USER_ID, task.getProperty(DBParams.USER_ID));
//?         BaseDatabase.addDBProperties(m_mapMessageHeader, task, null);	// Note: m_mapMessageHeader is guaranteed not null by previous call.
    }
1024938
void reportTaskFinished(TaskAttemptID taskid, boolean commitPending) {
    TaskInProgress tip;
    synchronized (this) {
      tip = tasks.get(taskid);
    }
    if (tip != null) {
      tip.reportTaskFinished(commitPending);
    } else {
      LOG.warn("Unknown child task finished: "+taskid+". Ignored.");
    }
  }
274269
@Override
	public void setup(PactTaskContext<GenericCoGrouper<IT1, IT2, OT>, OT> context) {
		this.taskContext = context;
		this.running = true;
	}
556903
public void registerTaskManager(final TaskExecutorConnection taskExecutorConnection, SlotReport initialSlotReport) {
		checkInit();

		LOG.debug("Registering TaskManager {} under {} at the SlotManager.", taskExecutorConnection.getResourceID(), taskExecutorConnection.getInstanceID());

		// we identify task managers by their instance id
		if (taskManagerRegistrations.containsKey(taskExecutorConnection.getInstanceID())) {
			reportSlotStatus(taskExecutorConnection.getInstanceID(), initialSlotReport);
		} else {
			// first register the TaskManager
			ArrayList<SlotID> reportedSlots = new ArrayList<>();

			for (SlotStatus slotStatus : initialSlotReport) {
				reportedSlots.add(slotStatus.getSlotID());
			}

			TaskManagerRegistration taskManagerRegistration = new TaskManagerRegistration(
				taskExecutorConnection,
				reportedSlots);

			taskManagerRegistrations.put(taskExecutorConnection.getInstanceID(), taskManagerRegistration);

			// next register the new slots
			for (SlotStatus slotStatus : initialSlotReport) {
				registerSlot(
					slotStatus.getSlotID(),
					slotStatus.getAllocationID(),
					slotStatus.getJobID(),
					slotStatus.getResourceProfile(),
					taskExecutorConnection);
			}
		}

	}
1005708
public void startTask(int id, String taskName) {
        if (isActivated) {
            durations.add(new Duration(id, taskName, BenchmarkUtil.elapsedRealTimeNanos()));
        }
    }
1268925
public function deleteTask($taskId)
    {
        if ($taskId instanceof Tasks) {
            $taskId = $taskId->id;
        }

        $this->service->tasks->delete($this->tasklist, $taskId);
    }
1207621
public synchronized int cancelTask(final int taskId) throws UnsuccessfulException, NotFoundException {
    if (getTask(taskId, runningTasks) != null) {
      throw new UnsuccessfulException("The task " + taskId + " is running");
    } else if (getTask(taskId, finishedTasks) != null) {
      throw new UnsuccessfulException("The task " + taskId + " has finished");
    }

    final TaskEntity task = getTask(taskId, taskQueue);
    if (task == null) {
      final String message =
          new StringBuilder().append("Task with ID ").append(taskId).append(" is not found").toString();
      throw new NotFoundException(message);
    } else {
      taskQueue.remove(task);
      canceledTasks.add(task);
      return taskId;
    }
  }
470754
public String start(String taskId) {
        long now = System.currentTimeMillis();
        return insert("INSERT INTO TaskLogs (taskId, resultType, startDate) VALUES (?, ?, ?)",
                Integer.parseInt(taskId), TaskLog.INCOMPLETE, now);
    }
222863
public void taskletComplete(final int taskletId, final Object result) {
    final boolean aggregateOnCount;
    synchronized (stateLock) {
      completedTasklets.add(new ImmutablePair<>(taskletId, result));
      removePendingTaskletReferenceCount(taskletId);
      aggregateOnCount = aggregateOnCount();
    }

    if (aggregateOnCount) {
      aggregateTasklets(AggregateTriggerType.COUNT);
    }
  }