@Override
  public void updateProperties(Resource resource, Request request, Predicate predicate) {

    Integer taskId = (Integer) resource.getPropertyValue(TASK_ID_PROPERTY_ID);

    StateProvider.Process process = getClusterDefinition().getProcess(taskId);

    if (process != null) {
      resource.setProperty(TASK_STATUS_PROPERTY_ID, process.isRunning() ? "IN_PROGRESS" : "COMPLETED");

      Set<String> propertyIds = getRequestPropertyIds(request, predicate);

      if (contains(propertyIds, TASK_EXIT_CODE_PROPERTY_ID)) {
        resource.setProperty(TASK_EXIT_CODE_PROPERTY_ID, process.getExitCode());
      }
      if (contains(propertyIds, TASK_STDERR_PROPERTY_ID)) {
        resource.setProperty(TASK_STDERR_PROPERTY_ID, process.getError());
      }
      if (contains(propertyIds, TASK_STOUT_PROPERTY_ID)) {
        resource.setProperty(TASK_STOUT_PROPERTY_ID, process.getOutput());
      }
    }
  }
Construct a resource provider based on the given cluster definition.

@param clusterDefinition  the cluster definition
contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/msi/TaskProvider.java