code: public static String getTaskId(final Configuration config) {
      try {
        return Tang.Factory.getTang().newInjector(config).getNamedInstance(TaskConfigurationOptions.Identifier.class);
      } catch (final InjectionException ex) {
        throw new RuntimeException("Unable to determine task identifier. Giving up.", ex);
      }
    }
docs: Extracts a task id from the given configuration.
  
  @param config
  @return the task id in the given configuration.
  @throws RuntimeException if the configuration can't be parsed.