How to use the dmn-js-shared/lib/util/DiUtil.containsDi function in dmn-js-shared

To help you get started, we’ve selected a few dmn-js-shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bpmn-io / dmn-js / packages / dmn-js / src / Modeler.js View on Github external
var definitionsView;

    for (var i = 0; i < views.length; i++) {

      const view = views[i];
      const el = view.element;

      if (is(el, 'dmn:Decision')) {
        return view;
      }

      if (is(el, 'dmn:Definitions')) {
        definitionsView = view;

        if (containsDi(el)) {
          return view;
        }
      }
    }

    return definitionsView || views[0];
  }
github bpmn-io / dmn-js / packages / dmn-js-drd / src / features / generate-di / DiGenerator.js View on Github external
eventBus.on('import.start', ({ definitions }) => {
    if (!containsDi(definitions)) {
      createDi(definitions);
    }
  });
}
github bpmn-io / dmn-js / packages / dmn-js / lib / Modeler.js View on Github external
var definitionsView;

    for (var i = 0; i < views.length; i++) {

      const view = views[i];
      const el = view.element;

      if (is(el, 'dmn:Decision')) {
        return view;
      }

      if (is(el, 'dmn:Definitions')) {
        definitionsView = view;

        if (containsDi(el)) {
          return view;
        }
      }
    }

    return definitionsView || views[0];
  }
github bpmn-io / dmn-js / packages / dmn-js / lib / Viewer.js View on Github external
opens(element) {
          return is(element, 'dmn:Definitions') && containsDi(element);
        }
      },