private synchronized int recordProcess(StateProvider.Process process, int requestId, String context) {

    if (requestId == -1) {
      requestId = nextRequestId++;

      Resource request = new ResourceImpl(Resource.Type.Request);

      request.setProperty(RequestProvider.REQUEST_ID_PROPERTY_ID, requestId);
      request.setProperty(RequestProvider.REQUEST_CLUSTER_NAME_PROPERTY_ID, clusterName);
      request.setProperty(RequestProvider.REQUEST_CONTEXT_ID, context);

      requestResources.add(request);
    }

    Resource task = new ResourceImpl(Resource.Type.Task);
    int taskId = nextTaskId++;

    taskResources.add(task);

    task.setProperty(TaskProvider.TASK_ID_PROPERTY_ID, taskId);
    task.setProperty(TaskProvider.TASK_REQUEST_ID_PROPERTY_ID, requestId);
    task.setProperty(TaskProvider.TASK_CLUSTER_NAME_PROPERTY_ID, clusterName);

    processes.put(taskId, process);
    return requestId;
  }
Get the set of task resources

@return the set of task resources
contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/msi/ClusterDefinition.java