lib/definitions/aggregate.js
function (businessRule) {
    if (!businessRule || !_.isObject(businessRule)) {
      var err = new Error('Please inject a valid businessRule object!');
      debug(err);
      throw err;
    }

    if (this.businessRules.indexOf(businessRule) < 0) {
      businessRule.defineAggregate(this);
      this.businessRules.push(businessRule);
      this.businessRules = _.sortBy(this.businessRules, function(br) {
        return br.priority;
      });
    }
  }
function (businessRule) {
    if (!businessRule || !_.isObject(businessRule)) {
      var err = new Error('Please inject a valid businessRule object!');
      debug(err);
      throw err;
    }

    if (this.businessRules.indexOf(businessRule) < 0) {
      businessRule.defineAggregate(this);
      this.businessRules.push(businessRule);
      this.businessRules = _.sortBy(this.businessRules, function(br) {
        return br.priority;
      });
    }
  }
function ( businessRule ) { if ( ! businessRule || ! _ . isObject ( businessRule ) ) { var err = new Error ( 'Please inject a valid businessRule object!' ) ; debug ( err ) ; throw err ; } if ( this . businessRules . indexOf ( businessRule ) < 0 ) { businessRule . defineAggregate ( this ) ; this . businessRules . push ( businessRule ) ; this . businessRules = _ . sortBy ( this . businessRules , function ( br ) { return br . priority ; } ) ; } }
Add businessRule module.
@param {BusinessRule} businessRule The businessRule module to be injected.
Add businessRule module .