Append/Override Customer Rule

@nikku
I have implement an new RuleProvider and would like to append(add) some restriction(rule).
but I found the code below would override all the “connection.create” rule. How can I add the origin rule back?

this.addRule('connection.create', HIGH_PRIORITY, function(context) {
  var source = context.source,
      target = context.target;

  //return is(source, 'bpmn:ExclusiveGateway');
  return some condition;
});

I can not call canConnect which provided by RuleProvider ,how can I add back these rules (such as : EndEvent forbidden to add outgoing )?

Rule provides may either give the final yes or no decision or indicate that evaluation should continued by returning nothing (i.e. via empty return statement).

Our documentation was actually wrong about this and I corrected it. Take a look at the RuleProvider.

Have a look at the example we provide there:

  /**
   * Return `true`, `false` or nothing to denote
   * _allowed_, _not allowed_ and _continue evaluating_.
   */
  this.addRule('shape.resize', function(context) {

    var shape = context.shape;

    if (!context.newBounds) {
      // check general resizability
      if (!shape.resizable) {
        return false;
      }

      // not returning anything (read: undefined)
      // will continue the evaluation of other rules
      // (with lower priority)
      return;
    } else {
      // element must have minimum size of 10*10 points
      return context.newBounds.width > 10 && context.newBounds.height > 10;
    }
  });

You can check the low-level test cases we got for rule evaluation, too.

Tip: If you would like to properly include source code snippets in posts use three backticks:

```
Your code here
```

Fixed. Thanks a lot @nikku