bpmn-moddle
Version:
A moddle wrapper for BPMN 2.0
1 lines • 64.9 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).BpmnModdle=t()}(this,function(){"use strict";var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty;function n(t){return"[object String]"===e.call(t)}function i(e,n){return t.call(e,n)}function r(t,n){var i;return n=function(t){return n=t,i=e.call(n),"[object Function]"===i||"[object AsyncFunction]"===i||"[object GeneratorFunction]"===i||"[object AsyncGeneratorFunction]"===i||"[object Proxy]"===i?t:function(e){return e===t};var n,i}(n),s(t,function(e,t){if(n(e,t))return i=e,!1}),i}function a(e,t){var n=[];return s(e,function(e,i){t(e,i)&&n.push(e)}),n}function s(t,n){var r;if(void 0!==t){var a=function(t){return"[object Array]"===e.call(t)}(t)?p:o;for(var s in t)if(i(t,s)&&!1===n(r=t[s],a(s)))return r}}function o(e){return e}function p(e){return Number(e)}function m(e,t){return e.bind(t)}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function u(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return l.apply(void 0,[e].concat(n))}function c(){}function y(e,t){this.model=e,this.properties=t}c.prototype.get=function(e){return this.$model.properties.get(this,e)},c.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},y.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(c.prototype);s(e.properties,function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function a(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),s(e,m(function(e,t){this.set(t,e)},this))}return a.prototype=i,a.hasType=i.$instanceOf=this.model.hasType,n.defineModel(a,t),n.defineDescriptor(a,e),a};var f={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},d={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};function h(e,t){var n=d[e];return n?n(t):t}function g(e){return!!f[e]}function A(e){return!!d[e]}function E(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function v(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function R(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,s(e,m(this.registerPackage,this))}function b(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function C(e){this.model=e}function x(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function w(e){this.properties=new C(this),this.factory=new y(this,this.properties),this.registry=new R(e,this.properties),this.typeCache={}}v.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),s(t,function(t){t in i&&(n[t]=e[t])}),n;var e,t,n,i},v.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},v.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,a=this.propertiesByName,s=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var o=r.indexOf(e);if(-1===o)throw new Error("property <"+i.name+"> not found in property list");r.splice(o,1),this.addProperty(t,n?void 0:o,s),a[i.name]=a[i.localName]=t},v.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),a=E(r[0],i),s=E(r[1],a.prefix).name,o=this.propertiesByName[s];if(!o)throw new Error("refined property <"+s+"> not found");this.replaceProperty(o,e,n),delete e.redefines},v.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},v.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},v.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},v.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},v.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},v.prototype.hasProperty=function(e){return this.propertiesByName[e]},v.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(s(e.properties,m(function(n){n=u({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))},this)),i.push(e),n[r]=e)},R.prototype.getPackage=function(e){return this.packageMap[e]},R.prototype.getPackages=function(){return this.packages},R.prototype.registerPackage=function(e){e=u({},e);var t=this.packageMap;b(t,e,"prefix"),b(t,e,"uri"),s(e.types,m(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},R.prototype.registerType=function(e,t){var n=E((e=u({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:u(e.meta||{})})).name,t.prefix),i=n.name,r={};s(e.properties,m(function(e){var t=E(e.name,n.prefix),i=t.name;g(e.type)||(e.type=E(e.type,t.prefix).name),u(e,{ns:t,name:i}),r[i]=e},this)),u(e,{ns:n,name:i,propertiesByName:r}),s(e.extends,m(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},R.prototype.mapTypes=function(e,t,n){var i=g(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function a(e){return o(e,!0)}function o(n,i){var a=E(n,g(n)?"":e.prefix);r.mapTypes(a,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");s(i.superClass,n?a:o),t(i,!n),s(i.traits,a)},R.prototype.getEffectiveDescriptor=function(e){var t=E(e),n=new v(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},R.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},C.prototype.set=function(e,t,n){var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:x(e,i,n):e.$attrs[t]=n},C.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&x(e,n,[]),e[i]},C.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},C.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},C.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},w.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},w.prototype.getType=function(e){var t=this.typeCache,i=n(e)?e:e.ns.name,r=t[i];return r||(e=this.registry.getEffectiveDescriptor(i),r=t[i]=this.factory.createType(e)),r},w.prototype.createAny=function(t,n,i){var r=E(t),a={$type:t,$instanceOf:function(e){return e===this.$type}},o={name:t,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:n}};return this.properties.defineDescriptor(a,o),this.properties.defineModel(a,this),this.properties.define(a,"$parent",{enumerable:!1,writable:!0}),s(i,function(t,n){var i;i=t,"[object Object]"===e.call(i)&&void 0!==t.value?a[t.name]=t.value:a[n]=t}),a},w.prototype.getPackage=function(e){return this.registry.getPackage(e)},w.prototype.getPackages=function(){return this.registry.getPackages()},w.prototype.getElementDescriptor=function(e){return e.$descriptor},w.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},w.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},w.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var M=String.fromCharCode,N=Object.prototype.hasOwnProperty,S=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,P={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function B(e,t,n,i){return i?N.call(P,i)?P[i]:"&"+i+";":M(t||parseInt(n,16))}function D(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(S,B):e}Object.keys(P).forEach(function(e){P[e.toUpperCase()]=P[e]});var I="http://www.w3.org/2001/XMLSchema-instance",O="xsi",T="xsi:type",k="non-whitespace outside of root node";function F(e){return new Error(e)}function L(e){return"missing namespace for prefix <"+e+">"}function V(e){return{get:e,enumerable:!0}}function j(e){var t,n={};for(t in e)n[t]=e[t];return n}function $(e){return e+"$uri"}function z(){return{line:0,column:0}}function G(e){throw e}function U(e){if(!this)return new U(e);var t,n,i,r,a,s,o,p,m,l=e&&e.proxy,u=G,c=z,y=!1,f=!1,d=null,h=!1;function g(e){e instanceof Error||(e=F(e)),d=e,u(e,c)}function A(e){a&&(e instanceof Error||(e=F(e)),a(e,c))}this.on=function(e,m){if("function"!=typeof m)throw F("required args <name, cb>");switch(e){case"openTag":n=m;break;case"text":t=m;break;case"closeTag":i=m;break;case"error":u=m;break;case"warn":a=m;break;case"cdata":r=m;break;case"attention":p=m;break;case"question":o=m;break;case"comment":s=m;break;default:throw F("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw F("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[I]=O,f=!0,m=n,this},this.parse=function(e){if("string"!=typeof e)throw F("required args <xml=string>");return d=null,function(e){var a,u,d,E,v,R,b,C,x,w,M,N=f?[]:null,S=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[$(n)]=t;return i}(m):null,P=[],B=0,I=!1,O=!1,F=0,z=0,G="",U=0;function q(){if(null!==M)return M;var e,t,n,i,r,a,s,o,p,l,u,c=f&&S.xmlns,d=f&&y?[]:null,h=U,g=G,E=g.length,v={},R={};e:for(;h<E;h++)if(p=!1,!(32===(l=g.charCodeAt(h))||l<14&&l>8)){for((l<65||l>122||l>90&&l<97)&&95!==l&&58!==l&&(A("illegal first char attribute name"),p=!0),u=h+1;u<E;u++)if(!((l=g.charCodeAt(u))>96&&l<123||l>64&&l<91||l>47&&l<59||46===l||45===l||95===l)){if(32===l||l<14&&l>8){A("missing attribute value"),h=u;continue e}if(61===l)break;A("illegal attribute name char"),p=!0}if("xmlns:xmlns"===(o=g.substring(h,u))&&(A("illegal declaration of xmlns"),p=!0),34===(l=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',h=u+2))&&-1!==(u=g.indexOf("'",h))&&(A("attribute value quote missmatch"),p=!0);else if(39===l)-1===(u=g.indexOf("'",h=u+2))&&-1!==(u=g.indexOf('"',h))&&(A("attribute value quote missmatch"),p=!0);else for(A("missing attribute value quotes"),p=!0,u+=1;u<E&&!(32===(l=g.charCodeAt(u+1))||l<14&&l>8);u++);for(-1===u&&(A("missing closing quotes"),u=E,p=!0),p||(a=g.substring(h,u)),h=u;u+1<E&&!(32===(l=g.charCodeAt(u+1))||l<14&&l>8);u++)h===u&&(A("illegal character after attribute end"),p=!0);if(h=u+1,!p)if(o in R)A("attribute <"+o+"> already defined");else if(R[o]=!0,f)if(y){if(null!==(r="xmlns"===o?"xmlns":120===o.charCodeAt(0)&&"xmlns:"===o.substr(0,6)?o.substr(6):null)){if(e=D(a),t=$(r),!(s=m[e])){if("xmlns"===r||t in S&&S[t]!==e)do{s="ns"+B++}while(void 0!==S[s]);else s=r;m[e]=s}S[r]!==s&&(i||(S=j(S),i=!0),S[r]=s,"xmlns"===r&&(S[$(s)]=e,c=s),S[t]=e),v[o]=a;continue}d.push(o,a)}else-1!==(l=o.indexOf(":"))?(n=S[o.substring(0,l)])?((o=c===n?o.substr(l+1):n+o.substr(l))===T&&(-1!==(l=a.indexOf(":"))?(n=a.substring(0,l),n=S[n]||n,a=n+a.substring(l)):a=c+":"+a),v[o]=a):A(L(o.substring(0,l))):v[o]=a;else v[o]=a}if(y)for(h=0,E=d.length;h<E;h++){if(o=d[h++],a=d[h],-1!==(l=o.indexOf(":"))){if(!(n=S[o.substring(0,l)])){A(L(o.substring(0,l)));continue}(o=c===n?o.substr(l+1):n+o.substr(l))===T&&(-1!==(l=a.indexOf(":"))?(n=a.substring(0,l),n=S[n]||n,a=n+a.substring(l)):a=c+":"+a)}v[o]=a}return M=v}c=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,a=0,s=0,o=z;F>=s&&(t=i.exec(e))&&!((o=t[0].length+t.index)>F);)r+=1,s=o;return-1==F?(a=o,n=e.substring(z)):0===z?n=e.substring(z,F):(a=F-s,n=-1==z?e.substring(F):e.substring(F,z+1)),{data:n,line:r,column:a}},l&&(w=Object.create({},{name:V(function(){return C}),originalName:V(function(){return x}),attrs:V(q),ns:V(function(){return S})}));for(;-1!==z;){if(-1===(F=60===e.charCodeAt(z)?z:e.indexOf("<",z)))return P.length?g("unexpected end of file"):0===z?g("missing start tag"):void(z<e.length&&e.substring(z).trim()&&A(k));if(z!==F)if(P.length){if(t&&(t(e.substring(z,F),D,c),h))return}else if(e.substring(z,F).trim()&&(A(k),h))return;if(33===(v=e.charCodeAt(F+1))){if(91===(E=e.charCodeAt(F+2))&&"CDATA["===e.substr(F+3,6)){if(-1===(z=e.indexOf("]]>",F)))return g("unclosed cdata");if(r&&(r(e.substring(F+9,z),c),h))return;z+=3;continue}if(45===E&&45===e.charCodeAt(F+3)){if(-1===(z=e.indexOf("--\x3e",F)))return g("unclosed comment");if(s&&(s(e.substring(F+4,z),D,c),h))return;z+=3;continue}}if(63!==v){for(u=F+1;;u++){if(R=e.charCodeAt(u),isNaN(R))return z=-1,g("unclosed tag");if(34===R)E=e.indexOf('"',u+1),u=-1!==E?E:u;else if(39===R)E=e.indexOf("'",u+1),u=-1!==E?E:u;else if(62===R){z=u;break}}if(33!==v){if(M={},47===v){if(I=!1,O=!0,!P.length)return g("missing open tag");if(u=C=P.pop(),E=F+2+u.length,e.substring(F+2,E)!==u)return g("closing tag mismatch");for(;E<z;E++)if(!(32===(v=e.charCodeAt(E))||v>8&&v<14))return g("close tag")}else{if(47===e.charCodeAt(z-1)?(u=C=e.substring(F+1,z-1),I=!0,O=!0):(u=C=e.substring(F+1,z),I=!0,O=!1),!(v>96&&v<123||v>64&&v<91||95===v||58===v))return g("illegal first char nodeName");for(E=1,d=u.length;E<d;E++)if(!((v=u.charCodeAt(E))>96&&v<123||v>64&&v<91||v>47&&v<59||45===v||95===v||46==v)){if(32===v||v<14&&v>8){C=u.substring(0,E),M=null;break}return g("invalid nodeName")}O||P.push(C)}if(f){if(a=S,I&&(O||N.push(a),null===M&&(y=-1!==u.indexOf("xmlns",E))&&(U=E,G=u,q(),y=!1)),x=C,-1!==(v=C.indexOf(":"))){if(!(b=S[C.substring(0,v)]))return g("missing namespace on <"+x+">");C=C.substr(v+1)}else b=S.xmlns;b&&(C=b+":"+C)}if(I&&(U=E,G=u,n&&(l?n(w,D,O,c):n(C,q,D,O,c),h)))return;if(O){if(i&&(i(l?w:C,D,I,c),h))return;f&&(S=I?a:N.pop())}z+=1}else{if(p&&(p(e.substring(F,z+1),D,c),h))return;z+=1}}else{if(-1===(z=e.indexOf("?>",F)))return g("unclosed question");if(o&&(o(e.substring(F,z+2),c),h))return;z+=2}}}(e),c=z,h=!1,d},this.stop=function(){h=!0}}function q(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var K={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},_="xsi:type";function H(e){return e.xml&&e.xml.serialize}function X(e){return H(e)===_}function W(e,t){return q(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Q(e){return new Error(e)}function J(e){return e.$descriptor}function Y(e){u(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Q("expected element");var t,n=this.elementsById,i=J(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw Q("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Z(){}function ee(){}function te(){}function ne(e,t){this.property=e,this.context=t}function ie(e,t){this.element=t,this.propertyDesc=e}function re(){}function ae(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function se(e,t,n){ae.call(this,e,t,n)}function oe(e,t,n){this.model=e,this.context=n}function pe(e){e instanceof w&&(e={model:e}),u(this,{lax:!1},e)}Z.prototype.handleEnd=function(){},Z.prototype.handleText=function(){},Z.prototype.handleNode=function(){},ee.prototype=Object.create(Z.prototype),ee.prototype.handleNode=function(){return this},te.prototype=Object.create(Z.prototype),te.prototype.handleText=function(e){this.body=(this.body||"")+e},ne.prototype=Object.create(te.prototype),ne.prototype.handleNode=function(e){if(this.element)throw Q("expected no sub nodes");return this.element=this.createReference(e),this},ne.prototype.handleEnd=function(){this.element.id=this.body},ne.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},ie.prototype=Object.create(te.prototype),ie.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=h(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},re.prototype=Object.create(te.prototype),re.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},ae.prototype=Object.create(re.prototype),ae.prototype.addReference=function(e){this.context.addReference(e)},ae.prototype.handleText=function(e){if(!J(this.element).bodyProperty)throw Q("unexpected body text <"+e+">");te.prototype.handleText.call(this,e)},ae.prototype.handleEnd=function(){var e=this.body,t=this.element,n=J(t).bodyProperty;n&&void 0!==e&&(e=h(n.type,e),t.set(n.name,e))},ae.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=J(i),a=this.context,o=new i({}),p=this.model;return s(n,function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?s(e.split(" "),function(e){a.addReference({element:o,property:i.ns.name,id:e})}):a.addReference({element:o,property:i.ns.name,id:e}):(i?e=h(i.type,e):"xmlns"!==n&&(t=E(n,r.ns.prefix),p.getPackage(t.prefix)&&a.addWarning({message:"unknown attribute <"+n+">",element:o,property:n,value:e})),o.set(n,e))}),o},ae.prototype.getPropertyForNode=function(e){var t,n,i=E(e.name),a=this.type,s=this.model,o=J(a),p=i.name,m=o.propertiesByName[p];if(m&&!m.isAttr)return X(m)&&(t=e.attributes[_])?(t=function(e,t){var n=E(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,s),u({},m,{effectiveType:J(n=s.getType(t)).name})):m;var l=s.getPackage(i.prefix);if(l){if(t=W(i,l),n=s.getType(t),m=r(o.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return u({},m,{effectiveType:J(n).name})}else if(m=r(o.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return m;throw Q("unrecognized element <"+i.name+">")},ae.prototype.toString=function(){return"ElementDescriptor["+J(this.type).name+"]"},ae.prototype.valueHandler=function(e,t){return new ie(e,t)},ae.prototype.referenceHandler=function(e){return new ne(e,this.context)},ae.prototype.handler=function(e){return"Element"===e?new oe(this.model,e,this.context):new ae(this.model,e,this.context)},ae.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,A(n=t.effectiveType||t.type))return this.valueHandler(t,i);var a=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==a&&(t.isMany?i.get(t.name).push(a):i.set(t.name,a),t.isReference?(u(a,{element:i}),this.context.addReference(a)):a.$parent=i),r},se.prototype=Object.create(ae.prototype),se.prototype.createElement=function(e){var t=e.name,n=E(t),i=this.model,r=this.type,a=i.getPackage(n.prefix),s=a&&W(n,a)||t;if(!r.hasType(s))throw Q("unexpected element <"+e.originalName+">");return ae.prototype.createElement.call(this,e)},oe.prototype=Object.create(re.prototype),oe.prototype.createElement=function(e){var t=e.name,n=E(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},oe.prototype.handleChild=function(e){var t=new oe(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},oe.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},pe.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof ae?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,a=this.lax,s=new Y(u({},t,{rootHandler:i})),o=new U({proxy:!0}),p=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function m(e,t,n){var i=t(),r=i.line,a=i.column,o=i.data;"<"===o.charAt(0)&&-1!==o.indexOf(" ")&&(o=o.slice(0,o.indexOf(" "))+">");var p="unparsable content "+(o?o+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:p,error:e}),!0;throw Q(p)}function l(e,t){return m(e,t,!0)}i.context=s,p.push(i);var c=/^<\?xml /i,y=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function d(e,t){try{p.peek().handleText(e)}catch(e){l(e,t)}}var h=r.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{"http://www.w3.org/XML/1998/namespace":"xml"});return o.ns(h).on("openTag",function(e,t,n,i){var r=e.attrs||{},s=Object.keys(r).reduce(function(e,n){var i=t(r[n]);return e[n]=i,e},{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){m(e,t,a)&&p.push(new ee)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},i)}).on("question",function(e){if(c.test(e)){var t=y.exec(e),n=t&&t[1];n&&!f.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){p.pop().handleEnd()}).on("cdata",d).on("text",function(e,t,n){!function(e,t){(e=e.trim())&&d(e,t)}(t(e),n)}).on("error",m).on("warn",l),new Promise(function(t,n){var r;try{o.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,a=n[t.id],o=J(r).propertiesByName[t.property];if(a||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),o.isMany){var p=r.get(o.name),m=p.indexOf(t);-1===m&&(m=p.length),a?p[m]=a:p.splice(m,1)}else r.set(o.name,a)}}()}catch(e){r=e}var a=i.element;r||a||(r=Q("failed to parse document as <"+i.type.$descriptor.name+">"));var p=s.warnings,m=s.references,l=s.elementsById;return r?(r.warnings=p,n(r)):t({rootElement:a,elementsById:l,references:m,warnings:p})})},pe.prototype.handler=function(e){return new se(this.model,e)};var me='<?xml version="1.0" encoding="UTF-8"?>\n',le=/<|>|'|"|&|\n\r|\n/g,ue=/<|>|&/g;function ce(e){var t={},n={},i={},r=[],a=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):a.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,a).filter(function(e){var n=t.getNSKey(e);return i[n]})}}function ye(e,t){return q(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function fe(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function de(e){return n(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function he(e){return t=e.getUsed(),n=function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}},i=[],s(t,function(e,t){i.push(n(e,t))}),i;var t,n,i}var ge={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Ae={"<":"lt",">":"gt","&":"amp"};function Ee(e,t,i){return(e=n(e)?e:""+e).replace(t,function(e){return"&"+i[e]+";"})}function ve(e){this.tagName=e}function Re(){}function be(e){this.tagName=e}function Ce(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function xe(e,t){Ce.call(this,e,t)}function we(){this.value="",this.write=function(e){this.value+=e}}function Me(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Ne(e){return e=u({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new we,r=new Me(i,e.format);if(e.preamble&&r.append(me),(new Ce).build(t).serializeTo(r),!n)return i.value}}}function Se(e,t){w.call(this,e,t)}ve.prototype.build=function(e){return this.element=e,this},ve.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Re.prototype.serializeValue=Re.prototype.serializeTo=function(e){e.append(this.escape?Ee(this.value,ue,Ae):this.value)},Re.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ue)&&(this.escape=!0),this},fe(be,Re),be.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Ce.prototype.build=function(e){this.element=e;var t,n,r=e.$descriptor,s=this.propertyDescriptor,o=r.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=s?this.nsPropertyTagName(s):this.nsTagName(r),this.tagName=this.addTagName(this.ns),o||(n=function(e){return a(e.$descriptor.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!i(e,n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)})}(e),this.parseAttributes(a(n,function(e){return e.isAttr})),this.parseContainments(function(e){return a(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},Ce.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?u({localName:t.ns.localName},e):u({localName:ye(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Ce.prototype.nsPropertyTagName=function(e){return function(e,t){return u({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Ce.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ce.prototype.nsAttributeName=function(e){var t;if(t=n(e)?E(e):e.ns,e.inherited)return{localName:t.localName};var i=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(i),this.isLocalNs(i)?{localName:t.localName}:u({localName:t.localName},i)},Ce.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return s(e,function(r,a){"$body"===a?n.push((new Re).build({type:"String"},r)):"$children"===a?s(r,function(e){n.push(new Ce(t).build(e))}):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,r)&&i.push({name:a,value:r})}),i},Ce.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,a=E(t);if("xmlns"===a.prefix&&(i={prefix:a.localName,uri:n}),a.prefix||"xmlns"!==a.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var s=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(s)}},Ce.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return s(i,function(t,i){var a=n.parseNsAttribute(e,i,t);a&&r.push(a)}),r},Ce.prototype.parseGenericAttributes=function(e,t){var n=this;s(t,function(t){if(t.name!==_)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},Ce.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;s(e,function(e){var r=i.get(e.name),a=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Re).build(e,r[0]));else if(A(e.type))s(r,function(i){n.push(new be(t.addTagName(t.nsPropertyTagName(e))).build(e,i))});else if(a)s(r,function(i){n.push(new ve(t.addTagName(t.nsPropertyTagName(e))).build(i))});else{var o=X(e),p=function(e){return"property"===H(e)}(e);s(r,function(i){var r;r=o?new xe(t,e):p?new Ce(t,e):new Ce(t),n.push(r.build(i))})}})},Ce.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new ce(t):n=t),n},Ce.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,a=e.prefix,s=i.byUri(r);return"xml"===a||s&&!n||i.add(e,t),i.mapPrefix(a,r),e},Ce.prototype.logNamespaceUsed=function(e,t){var n,i,r,a=this.element.$model,s=this.getNamespaces(t),o=e.prefix,p=e.uri;if(!o&&!p)return{localName:e.localName};if(r=K[o]||a&&(a.getPackage(o)||{}).uri,!(p=p||r||s.uriByPrefix(o)))throw new Error("no namespace uri given for prefix <"+o+">");if(!(e=s.byUri(p))){for(n=o,i=1;s.uriByPrefix(n);)n=o+"_"+i++;e=this.logNamespace({prefix:n,uri:p},r===p)}return o&&s.mapPrefix(o,p),e},Ce.prototype.parseAttributes=function(e){var t=this,n=this.element;s(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];s(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},Ce.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),de(e)},Ce.prototype.addAttribute=function(e,t){var i=this.attrs;n(t)&&(t=Ee(t,le,ge)),i.push({name:e,value:t})},Ce.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=he(n).concat(t)),s(t,function(t){e.append(" ").append(de(t.name)).append('="').append(t.value).append('"')})},Ce.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Re;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),s(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},fe(xe,Ce),xe.prototype.parseNsAttributes=function(e){var t=Ce.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),a=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(_),(i.prefix?i.prefix+":":"")+a+n.ns.localName),t},xe.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Se.prototype=Object.create(w.prototype),Se.prototype.fromXML=function(e,t,i){n(t)||(i=t,t="bpmn:Definitions");var r=new pe(u({model:this,lax:!0},i)),a=r.handler(t);return r.fromXML(e,a)},Se.prototype.toXML=function(e,t){var n=new Ne(t);return new Promise(function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}})};var Pe={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{