code: private void attemptToExecuteTask(ApplicationDefinition appDef, Task task, TaskRecord taskRecord) {
          Tenant tenant = Tenant.getTenant(appDef);
          String taskID = taskRecord.getTaskID();
          String claimID = "_claim/" + taskID;
          long claimStamp = System.currentTimeMillis();
          writeTaskClaim(tenant, claimID, claimStamp);
          if (taskClaimedByUs(tenant, claimID)) {
              startTask(appDef, task, taskRecord);
          } else {
          	m_logger.info("Will not start task: it was claimed by another service");
          }
      }
docs: Attempt to start the given task by creating claim and see if we win it.