How can I check is there end event in diagram?

I need to disable save button, while there is no end event.
So that`s why I need to know how to modeler for this purpose.

Through the element registry you can do find out if there is an end event:

import { is } from 'bpmn-js/lib/util/ModelUtil';

...

const hasEndEvent = modeler
  .get('elementRegistry')
  .find(element => is(element, 'bpmn:EndEvent'));
1 Like

Thank you! It works!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.