code: function (options) {
        if (!tree || _.isEmpty(tree)) {
          debug('no tree injected');
          return this;
        }
  
        this.getContexts().forEach(function (ctx) {
          ctx.defineOptions(options);
  
          ctx.getAggregates().forEach(function (aggr) {
            aggr.defineOptions(options);
  
            if (aggr.defaultCommandHandler) {
              aggr.defaultCommandHandler.defineOptions(options);
            }
  
            aggr.getCommands().forEach(function (cmd) {
              cmd.defineOptions(options);
  
              if (cmd.preCondition) {
                cmd.preCondition.defineOptions(options);
              }
  
              if (cmd.preLoadCondition) {
                cmd.preLoadCondition.defineOptions(options);
              }
            });
  
            aggr.getEvents().forEach(function (evt) {
              evt.defineOptions(options);
            });
  
            aggr.getCommandHandlers().forEach(function (cmdHndl) {
              cmdHndl.defineOptions(options);
            });
  
            aggr.getBusinessRules().forEach(function (buRu) {
              buRu.defineOptions(options);
            });
          });
        });
        return this;
      }
docs: getCommandHandlerByOldTarget: function (query) { if (!tree || _.isEmpty(tree)) { debug('no tree injected'); return null; }  var ctx; var ctxs = this.getContexts(); for (var c in ctxs) { ctx = ctxs[c]; var handler = getCommandHandlerByOldTarget(ctx, query); if (handler) { return handler; } } return null; },