protected List<Command> buildCommandChain(Config rootConfig, String configKey, Command finalChild, boolean ignoreNotifications) {
    Preconditions.checkNotNull(rootConfig);
    Preconditions.checkNotNull(configKey);
    Preconditions.checkNotNull(finalChild);
    List<? extends Config> commandConfigs = new Configs().getConfigList(rootConfig, configKey, Collections.<Config>emptyList());
    List<Command> commands = Lists.newArrayList();
    Command currentParent = this;
    Connector lastConnector = null;        
    for (int i = 0; i < commandConfigs.size(); i++) {
      boolean isLast = (i == commandConfigs.size() - 1);
      Connector connector = new Connector(ignoreNotifications && isLast);
      if (isLast) {
        connector.setChild(finalChild);
      }
      Config cmdConfig = commandConfigs.get(i);
      Command cmd = buildCommand(cmdConfig, currentParent, connector);
      commands.add(cmd);
      if (i > 0) {
        lastConnector.setChild(cmd);
      }
      connector.setParent(cmd);
      currentParent = connector;
      lastConnector = connector;
    }
    return commands;
  }
protected List < Command > buildCommandChain ( Config rootConfig , String configKey , Command finalChild , boolean ignoreNotifications ) { Preconditions . checkNotNull ( rootConfig ) ; Preconditions . checkNotNull ( configKey ) ; Preconditions . checkNotNull ( finalChild ) ; List < ? extends Config > commandConfigs = new Configs ( ) . getConfigList ( rootConfig , configKey , Collections . < Config > emptyList ( ) ) ; List < Command > commands = Lists . newArrayList ( ) ; Command currentParent = this ; Connector lastConnector = null ; for ( int i = 0 ; i < commandConfigs . size ( ) ; i ++ ) { boolean isLast = ( i == commandConfigs . size ( ) - 1 ) ; Connector connector = new Connector ( ignoreNotifications && isLast ) ; if ( isLast ) { connector . setChild ( finalChild ) ; } Config cmdConfig = commandConfigs . get ( i ) ; Command cmd = buildCommand ( cmdConfig , currentParent , connector ) ; commands . add ( cmd ) ; if ( i > 0 ) { lastConnector . setChild ( cmd ) ; } connector . setParent ( cmd ) ; currentParent = connector ; lastConnector = connector ; } return commands ; }
Factory method to create the chain of commands rooted at the given rootConfig. The last command
in the chain will feed records into finalChild.

@param ignoreNotifications
if true indicates don't forward notifications at the end of the chain of commands.
This is a feature that multi-branch commands like tryRules and ifThenElse need to
avoid sending a notification multiple times to finalChild, once from each branch.