12345678910111213141516171819202122232425 |
- /**
- * Is an element of the given BPMN type?
- *
- * @param {djs.model.Base|ModdleElement} element
- * @param {string} type
- *
- * @return {boolean}
- */
- export function is(element, type) {
- var bo = getBusinessObject(element);
- return bo && (typeof bo.$instanceOf === 'function') && bo.$instanceOf(type);
- }
- /**
- * Return the business object for a given element.
- *
- * @param {djs.model.Base|ModdleElement} element
- *
- * @return {ModdleElement}
- */
- export function getBusinessObject(element) {
- return (element && element.businessObject) || element;
- }
|