Retrieve the Activity ID value for this task.
@param task Task instance
@return Activity ID value
18468
private String getActivityID(Task task)
   {
      String result = null;
      if (m_activityIDField != null)
      {
         Object value = task.getCachedValue(m_activityIDField);
         if (value != null)
         {
            result = value.toString();
         }
      }
      return result;
   }
197906
public String getTaskId() {
    Task task = getTask();
    return task != null ? task.getId() : null;
  }
986155
public OvhTaskPop domain_task_account_id_GET(String domain, Long id) throws IOException {
		String qPath = "/email/domain/{domain}/task/account/{id}";
		StringBuilder sb = path(qPath, domain, id);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhTaskPop.class);
	}
846894
private BigInteger getTaskCalendarID(Task mpx)
   {
      BigInteger result = null;
      ProjectCalendar cal = mpx.getCalendar();
      if (cal != null)
      {
         result = NumberHelper.getBigInteger(cal.getUniqueID());
      }
      else
      {
         result = NULL_CALENDAR_ID;
      }
      return (result);
   }
562769
@Nullable
	private TaskSlot getTaskSlot(AllocationID allocationId) {
		Preconditions.checkNotNull(allocationId);

		return allocationIDTaskSlotMap.get(allocationId);
	}
1300822
@Override
  public int compareTo(ID o) {
    TaskAttemptID that = (TaskAttemptID)o;
    int tipComp = this.taskId.compareTo(that.taskId);
    if(tipComp == 0) {
      return this.id - that.id;
    }
    else return tipComp;
  }
254388
public void readTask(Task task) {
        Map<String, String> props = task.getProperties();
        setAccount(props.get(ACCOUNT_PROP));
        setStoreId(props.get(STORE_ID_PROP));
        setSpaceId(props.get(SPACE_ID_PROP));
        this.attempts = task.getAttempts();
    }
798493
private java.util.Map<JobHistory.Keys, String> getLastSuccessfulTaskAttempt(JobHistory.Task task) {
    
    Map<String, JobHistory.TaskAttempt> taskAttempts = task.getTaskAttempts();
    int size = taskAttempts.size();
    java.util.Iterator<Map.Entry<String, JobHistory.TaskAttempt>> kv = taskAttempts.entrySet().iterator();
    for (int i=0; i<size; i++) {
      // CHECK_IT: Only one SUCCESSFUL TASK ATTEMPT
      Map.Entry<String, JobHistory.TaskAttempt> tae = kv.next();
      JobHistory.TaskAttempt attempt = tae.getValue();
      if (attempt.getValues().get(JobHistory.Keys.TASK_STATUS).equals("SUCCESS")) {
        return attempt.getValues();
      }
    }
    
    return null;
  }
256317
private void writeTask(Task task)
   {
      if (!task.getNull())
      {
         if (extractAndConvertTaskType(task) == null || task.getSummary())
         {
            writeWBS(task);
         }
         else
         {
            writeActivity(task);
         }
      }
   }
253017
protected void setLastUserTaskID(UserTask task) {
        String name = task.getName();
        if (name != null && name.length() > 0) {
            int i = name.indexOf(DEFAULT_USERTASK_NAME_PREFIX);
            if (i == 0) {
                String numStr = name.substring(5);
                try {
                    int num = Integer.parseInt(numStr);
                    if (num >= LastUserTaskID) {
                        LastUserTaskID = num;
                    }
                } catch (NumberFormatException nfe) {
                    // do nothing
                }
            }
        }
    }
935922
public TimerTaskData getTimerTaskData(Serializable taskID) {
		TimerTaskCacheData timerTaskCacheData = new TimerTaskCacheData(taskID, baseFqn, cluster);
		if (timerTaskCacheData.exists()) {
			return timerTaskCacheData.getTaskData();
		}
		else {
			return null;
		}
	}
81034
def task(self):
        
        # If we have no .task_id, this is a no-op to return None.
        if not self.task_id:
            return defer.succeed(None)
        return self.connection.getTaskInfo(self.task_id)
1275565
@Override
	public TaskBase getTask(String processDefinitionName, Long taskid) {
		ProcessDefinition pd = getProcessDefinition(processDefinitionName);
		if (pd == null) {
			throw new WorkflowException("Could not find active process for "+processDefinitionName);
		}
		TaskBase task = getTask(pd,taskid);
		if (task == null) {
			throw new WorkflowException("Could not find task for "+processDefinitionName+":"+taskid);
		}
		return task;
	}
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;
    }
  }
1071364
public String schedule(TriggerTask task) {
        if (getCurrentScheduler() == null) {
            throw new IllegalStateException("New scheduler should be crea");
        }
        ScheduledFuture<?> future = getCurrentScheduler().schedule(task.getRunnable(), task.getTrigger());
        String id = Schedulers.getUUID();
        runningSchedullers.put(id, future);
        Schedulers.increaseNoOfRunningSchedullers();
        setCurrentScheduler(null);
        return id;
    }
963060
@Override
    public String getDestination(String task) {
        MappingConfig config = rdbMapping.get(task);
        if (config != null) {
            return config.getDestination();
        }
        return null;
    }
515035
public TaskDef getTaskDef(String taskType) {
        Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
        return getForEntity("metadata/taskdefs/{tasktype}", null, TaskDef.class, taskType);
    }