camunda-bpmn-js 0.13.0-alpha.8 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/assets/base-navigated-viewer.css +2 -0
- package/dist/assets/base-viewer.css +2 -0
- package/dist/assets/camunda-cloud-navigated-viewer.css +1 -0
- package/dist/assets/camunda-cloud-viewer.css +1 -0
- package/dist/assets/camunda-platform-navigated-viewer.css +1 -0
- package/dist/assets/camunda-platform-viewer.css +1 -0
- package/dist/assets/properties-panel.css +900 -901
- package/dist/base-navigated-viewer.development.js +22218 -0
- package/dist/base-navigated-viewer.production.min.js +2 -0
- package/dist/base-viewer.development.js +21227 -0
- package/dist/base-viewer.production.min.js +2 -0
- package/dist/camunda-cloud-modeler.development.js +1249 -944
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-navigated-viewer.development.js +23041 -0
- package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -0
- package/dist/camunda-cloud-viewer.development.js +22050 -0
- package/dist/camunda-cloud-viewer.production.min.js +2 -0
- package/dist/camunda-platform-modeler.development.js +1464 -1381
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/dist/camunda-platform-navigated-viewer.development.js +23413 -0
- package/dist/camunda-platform-navigated-viewer.production.min.js +2 -0
- package/dist/camunda-platform-viewer.development.js +22422 -0
- package/dist/camunda-platform-viewer.production.min.js +2 -0
- package/lib/base/NavigatedViewer.js +3 -0
- package/lib/base/Viewer.js +3 -0
- package/lib/camunda-cloud/Modeler.js +7 -11
- package/lib/camunda-cloud/NavigatedViewer.js +34 -0
- package/lib/camunda-cloud/Viewer.js +34 -0
- package/lib/camunda-cloud/util/commonModules.js +14 -0
- package/lib/camunda-platform/Modeler.js +5 -5
- package/lib/camunda-platform/NavigatedViewer.js +25 -0
- package/lib/camunda-platform/Viewer.js +24 -0
- package/lib/camunda-platform/util/commonModules.js +7 -0
- package/package.json +9 -4
- package/styles/base-navigated-viewer.css +2 -0
- package/styles/base-viewer.css +2 -0
- package/styles/camunda-cloud-navigated-viewer.css +1 -0
- package/styles/camunda-cloud-viewer.css +1 -0
- package/styles/camunda-platform-navigated-viewer.css +1 -0
- package/styles/camunda-platform-viewer.css +1 -0
- package/util/index.js +39 -0
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +0 -115
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +0 -76
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +0 -86
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +0 -138
- package/lib/camunda-cloud/features/modeling/behavior/RemoveAssignmentDefinitionBehavior.js +0 -51
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +0 -136
- package/lib/camunda-cloud/features/modeling/behavior/index.js +0 -24
- package/lib/camunda-cloud/features/modeling/index.js +0 -7
- package/lib/camunda-cloud/helper/CalledElementHelper.js +0 -72
- package/lib/camunda-cloud/helper/ElementHelper.js +0 -18
- package/lib/camunda-cloud/helper/FormsHelper.js +0 -84
- package/lib/camunda-cloud/helper/InputOutputHelper.js +0 -138
- package/lib/camunda-cloud/helper/Utils.js +0 -10
- package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +0 -41
- package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +0 -54
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +0 -96
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +0 -68
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +0 -44
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +0 -54
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +0 -71
- package/lib/camunda-platform/features/modeling/behavior/UserTaskGeneratedFormsBehavior.js +0 -116
- package/lib/camunda-platform/features/modeling/behavior/index.js +0 -26
- package/lib/camunda-platform/features/modeling/index.js +0 -7
- package/lib/camunda-platform/helper/InputOutputHelper.js +0 -29
|
@@ -71903,25 +71903,32 @@
|
|
|
71903
71903
|
|
|
71904
71904
|
|
|
71905
71905
|
getDefault(element) {
|
|
71906
|
-
return find(this.getAll(), function (template) {
|
|
71907
|
-
return
|
|
71906
|
+
return find(this.getAll(element), function (template) {
|
|
71907
|
+
return template.isDefault;
|
|
71908
71908
|
}) || null;
|
|
71909
71909
|
}
|
|
71910
71910
|
/**
|
|
71911
|
-
* Get all templates (with given ID).
|
|
71912
|
-
*
|
|
71913
|
-
* @param {string} [id]
|
|
71911
|
+
* Get all templates (with given ID or applicable to element).
|
|
71914
71912
|
*
|
|
71913
|
+
* @param {String|djs.model.Base} [id]
|
|
71915
71914
|
* @return {Array<ElementTemplate>}
|
|
71916
71915
|
*/
|
|
71917
71916
|
|
|
71918
71917
|
|
|
71919
71918
|
getAll(id) {
|
|
71920
|
-
|
|
71921
|
-
|
|
71922
|
-
|
|
71919
|
+
return this._getTemplateVerions(id, false);
|
|
71920
|
+
}
|
|
71921
|
+
/**
|
|
71922
|
+
* Get all templates (with given ID or applicable to element) with the latest
|
|
71923
|
+
* version.
|
|
71924
|
+
*
|
|
71925
|
+
* @param {String|djs.model.Base} [id]
|
|
71926
|
+
* @return {Array<ElementTemplate>}
|
|
71927
|
+
*/
|
|
71928
|
+
|
|
71923
71929
|
|
|
71924
|
-
|
|
71930
|
+
getLatest(id) {
|
|
71931
|
+
return this._getTemplateVerions(id, true);
|
|
71925
71932
|
}
|
|
71926
71933
|
/**
|
|
71927
71934
|
* Set templates.
|
|
@@ -71937,13 +71944,54 @@
|
|
|
71937
71944
|
version = isUndefined(template.version) ? '_' : template.version;
|
|
71938
71945
|
|
|
71939
71946
|
if (!this._templates[id]) {
|
|
71940
|
-
this._templates[id] = {
|
|
71947
|
+
this._templates[id] = {
|
|
71948
|
+
latest: template
|
|
71949
|
+
};
|
|
71941
71950
|
}
|
|
71942
71951
|
|
|
71943
71952
|
this._templates[id][version] = template;
|
|
71953
|
+
const latestVerions = this._templates[id].latest.version;
|
|
71954
|
+
|
|
71955
|
+
if (isUndefined(latestVerions) || template.version > latestVerions) {
|
|
71956
|
+
this._templates[id].latest = template;
|
|
71957
|
+
}
|
|
71944
71958
|
});
|
|
71945
71959
|
}
|
|
71946
71960
|
|
|
71961
|
+
_getTemplateVerions(id, latestOnly) {
|
|
71962
|
+
if (typeof id === 'boolean') {
|
|
71963
|
+
latestOnly = id;
|
|
71964
|
+
id = undefined;
|
|
71965
|
+
}
|
|
71966
|
+
|
|
71967
|
+
const templates = this._templates;
|
|
71968
|
+
|
|
71969
|
+
const getVersions = template => {
|
|
71970
|
+
const {
|
|
71971
|
+
latest,
|
|
71972
|
+
...versions
|
|
71973
|
+
} = template;
|
|
71974
|
+
return latestOnly ? [latest] : values(versions);
|
|
71975
|
+
};
|
|
71976
|
+
|
|
71977
|
+
if (isUndefined(id)) {
|
|
71978
|
+
return flatten(values(templates).map(getVersions));
|
|
71979
|
+
}
|
|
71980
|
+
|
|
71981
|
+
if (isObject(id)) {
|
|
71982
|
+
const element = id;
|
|
71983
|
+
return filter(this._getTemplateVerions(latestOnly), function (template) {
|
|
71984
|
+
return isAny(element, template.appliesTo);
|
|
71985
|
+
}) || [];
|
|
71986
|
+
}
|
|
71987
|
+
|
|
71988
|
+
if (isString(id)) {
|
|
71989
|
+
return templates[id] && getVersions(templates[id]);
|
|
71990
|
+
}
|
|
71991
|
+
|
|
71992
|
+
throw new Error('argument must be of type {String|djs.model.Base|Undefined}');
|
|
71993
|
+
}
|
|
71994
|
+
|
|
71947
71995
|
_getTemplateId(element) {
|
|
71948
71996
|
return getTemplateId(element);
|
|
71949
71997
|
}
|
|
@@ -72493,8 +72541,10 @@
|
|
|
72493
72541
|
const businessObject = getBusinessObject(element);
|
|
72494
72542
|
const type = businessObject.$type,
|
|
72495
72543
|
eventDefinitionType = getEventDefinitionType(businessObject);
|
|
72544
|
+
const newBusinessObject = createBlankBusinessObject(element, injector);
|
|
72496
72545
|
const newElement = replace.replaceElement(element, {
|
|
72497
72546
|
type: type,
|
|
72547
|
+
businessObject: newBusinessObject,
|
|
72498
72548
|
eventDefinitionType: eventDefinitionType
|
|
72499
72549
|
});
|
|
72500
72550
|
selection.select(newElement);
|
|
@@ -72552,6 +72602,29 @@
|
|
|
72552
72602
|
return string;
|
|
72553
72603
|
}
|
|
72554
72604
|
|
|
72605
|
+
function createBlankBusinessObject(element, injector) {
|
|
72606
|
+
const bpmnFactory = injector.get('bpmnFactory'),
|
|
72607
|
+
bpmnJs = injector.get('bpmnjs');
|
|
72608
|
+
const bo = getBusinessObject(element),
|
|
72609
|
+
newBo = bpmnFactory.create(bo.$type),
|
|
72610
|
+
label = getLabel(element);
|
|
72611
|
+
|
|
72612
|
+
if (!label) {
|
|
72613
|
+
return newBo;
|
|
72614
|
+
}
|
|
72615
|
+
|
|
72616
|
+
if (is$1(element, 'bpmn:Group')) {
|
|
72617
|
+
const definitions = bpmnJs.getDefinitions();
|
|
72618
|
+
const categoryValue = createCategoryValue(definitions, bpmnFactory);
|
|
72619
|
+
newBo.categoryValueRef = categoryValue;
|
|
72620
|
+
}
|
|
72621
|
+
|
|
72622
|
+
setLabel({
|
|
72623
|
+
businessObject: newBo
|
|
72624
|
+
}, label);
|
|
72625
|
+
return newBo;
|
|
72626
|
+
}
|
|
72627
|
+
|
|
72555
72628
|
function unlinkTemplate(element, injector) {
|
|
72556
72629
|
const modeling = injector.get('modeling'); // remove template attributes
|
|
72557
72630
|
|
|
@@ -72944,15 +73017,25 @@
|
|
|
72944
73017
|
const newBinding = newProperty.binding,
|
|
72945
73018
|
newBindingType = newBinding.type;
|
|
72946
73019
|
return newBindingType === 'zeebe:input' || newBindingType === 'zeebe:output';
|
|
72947
|
-
});
|
|
72948
|
-
|
|
72949
|
-
if (!newProperties.length) {
|
|
72950
|
-
return;
|
|
72951
|
-
}
|
|
73020
|
+
});
|
|
72952
73021
|
|
|
72953
73022
|
const businessObject = this._getOrCreateExtensionElements(element);
|
|
72954
73023
|
|
|
72955
|
-
let ioMapping = findExtension$1(businessObject, 'zeebe:IoMapping');
|
|
73024
|
+
let ioMapping = findExtension$1(businessObject, 'zeebe:IoMapping'); // (1) remove old mappings if no new specified
|
|
73025
|
+
|
|
73026
|
+
if (!newProperties.length) {
|
|
73027
|
+
if (!ioMapping) {
|
|
73028
|
+
return;
|
|
73029
|
+
}
|
|
73030
|
+
|
|
73031
|
+
commandStack.execute('element.updateModdleProperties', {
|
|
73032
|
+
element,
|
|
73033
|
+
moddleElement: businessObject,
|
|
73034
|
+
properties: {
|
|
73035
|
+
values: without(businessObject.get('values'), ioMapping)
|
|
73036
|
+
}
|
|
73037
|
+
});
|
|
73038
|
+
}
|
|
72956
73039
|
|
|
72957
73040
|
if (!ioMapping) {
|
|
72958
73041
|
ioMapping = bpmnFactory.create('zeebe:IoMapping');
|
|
@@ -73063,15 +73146,25 @@
|
|
|
73063
73146
|
const newBinding = newProperty.binding,
|
|
73064
73147
|
newBindingType = newBinding.type;
|
|
73065
73148
|
return newBindingType === 'zeebe:taskHeader';
|
|
73066
|
-
});
|
|
73067
|
-
|
|
73068
|
-
if (!newProperties.length) {
|
|
73069
|
-
return;
|
|
73070
|
-
}
|
|
73149
|
+
});
|
|
73071
73150
|
|
|
73072
73151
|
const businessObject = this._getOrCreateExtensionElements(element);
|
|
73073
73152
|
|
|
73074
|
-
let taskHeaders = findExtension$1(businessObject, 'zeebe:TaskHeaders');
|
|
73153
|
+
let taskHeaders = findExtension$1(businessObject, 'zeebe:TaskHeaders'); // (1) remove old headers if no new specified
|
|
73154
|
+
|
|
73155
|
+
if (!newProperties.length) {
|
|
73156
|
+
if (!taskHeaders) {
|
|
73157
|
+
return;
|
|
73158
|
+
}
|
|
73159
|
+
|
|
73160
|
+
commandStack.execute('element.updateModdleProperties', {
|
|
73161
|
+
element,
|
|
73162
|
+
moddleElement: businessObject,
|
|
73163
|
+
properties: {
|
|
73164
|
+
values: without(businessObject.get('values'), taskHeaders)
|
|
73165
|
+
}
|
|
73166
|
+
});
|
|
73167
|
+
}
|
|
73075
73168
|
|
|
73076
73169
|
if (!taskHeaders) {
|
|
73077
73170
|
taskHeaders = bpmnFactory.create('zeebe:TaskHeaders');
|
|
@@ -73918,9 +74011,9 @@
|
|
|
73918
74011
|
};
|
|
73919
74012
|
}
|
|
73920
74013
|
|
|
73921
|
-
const newerTemplate =
|
|
74014
|
+
const newerTemplate = elementTemplates.getLatest(templateId)[0];
|
|
73922
74015
|
|
|
73923
|
-
if (newerTemplate) {
|
|
74016
|
+
if (newerTemplate !== template) {
|
|
73924
74017
|
return {
|
|
73925
74018
|
type: 'OUTDATED_TEMPLATE',
|
|
73926
74019
|
template,
|
|
@@ -73934,26 +74027,6 @@
|
|
|
73934
74027
|
};
|
|
73935
74028
|
}
|
|
73936
74029
|
|
|
73937
|
-
function findNewestElementTemplate(elementTemplates, currentElementTemplate) {
|
|
73938
|
-
if (isUndefined(currentElementTemplate.version)) {
|
|
73939
|
-
return null;
|
|
73940
|
-
}
|
|
73941
|
-
|
|
73942
|
-
return elementTemplates.getAll().filter(function (elementTemplate) {
|
|
73943
|
-
return currentElementTemplate.id === elementTemplate.id && !isUndefined(elementTemplate.version);
|
|
73944
|
-
}).reduce(function (newestElementTemplate, elementTemplate) {
|
|
73945
|
-
if (currentElementTemplate.version < elementTemplate.version) {
|
|
73946
|
-
return elementTemplate;
|
|
73947
|
-
}
|
|
73948
|
-
|
|
73949
|
-
if (newestElementTemplate && newestElementTemplate.version < elementTemplate.version) {
|
|
73950
|
-
return elementTemplate;
|
|
73951
|
-
}
|
|
73952
|
-
|
|
73953
|
-
return newestElementTemplate;
|
|
73954
|
-
}, null);
|
|
73955
|
-
}
|
|
73956
|
-
|
|
73957
74030
|
function TemplateProps({
|
|
73958
74031
|
element,
|
|
73959
74032
|
elementTemplates
|
|
@@ -75002,9 +75075,7 @@
|
|
|
75002
75075
|
}
|
|
75003
75076
|
|
|
75004
75077
|
_shouldShowTemplateProperties(element) {
|
|
75005
|
-
return getTemplateId$1(element) || this._elementTemplates.getAll().
|
|
75006
|
-
return isAny(element, template.appliesTo);
|
|
75007
|
-
});
|
|
75078
|
+
return getTemplateId$1(element) || this._elementTemplates.getAll(element).length;
|
|
75008
75079
|
}
|
|
75009
75080
|
|
|
75010
75081
|
}
|
|
@@ -75069,6 +75140,16 @@
|
|
|
75069
75140
|
children: translate('How to define conditions')
|
|
75070
75141
|
});
|
|
75071
75142
|
},
|
|
75143
|
+
decisionId: element => {
|
|
75144
|
+
const translate = useService('translate');
|
|
75145
|
+
return o$2("a", {
|
|
75146
|
+
href: "https://docs.camunda.io/docs/reference/bpmn-processes/business-rule-tasks/business-rule-tasks/#defining-a-task",
|
|
75147
|
+
target: "_blank",
|
|
75148
|
+
rel: "noopener",
|
|
75149
|
+
title: translate('Business rule task documentation'),
|
|
75150
|
+
children: translate('How to configure a business rule task')
|
|
75151
|
+
});
|
|
75152
|
+
},
|
|
75072
75153
|
formType: element => {
|
|
75073
75154
|
const translate = useService('translate');
|
|
75074
75155
|
return o$2("a", {
|
|
@@ -75339,864 +75420,674 @@
|
|
|
75339
75420
|
disabledCollapsedSubprocessPopupProvider: [ 'type', DisabledCollapsedSubprocessPopupProvider ]
|
|
75340
75421
|
};
|
|
75341
75422
|
|
|
75342
|
-
var DEFAULT_RENDER_PRIORITY$2 = 1000;
|
|
75343
|
-
|
|
75344
75423
|
/**
|
|
75345
|
-
*
|
|
75424
|
+
* Flatten array, one level deep.
|
|
75346
75425
|
*
|
|
75347
|
-
* @param {
|
|
75348
|
-
*
|
|
75426
|
+
* @param {Array<?>} arr
|
|
75427
|
+
*
|
|
75428
|
+
* @return {Array<?>}
|
|
75349
75429
|
*/
|
|
75350
|
-
function BaseRenderer$1(eventBus, renderPriority) {
|
|
75351
|
-
var self = this;
|
|
75352
|
-
|
|
75353
|
-
renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY$2;
|
|
75354
|
-
|
|
75355
|
-
eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {
|
|
75356
|
-
var type = evt.type,
|
|
75357
|
-
element = context.element,
|
|
75358
|
-
visuals = context.gfx,
|
|
75359
|
-
attrs = context.attrs;
|
|
75360
|
-
|
|
75361
|
-
if (self.canRender(element)) {
|
|
75362
|
-
if (type === 'render.shape') {
|
|
75363
|
-
return self.drawShape(visuals, element, attrs);
|
|
75364
|
-
} else {
|
|
75365
|
-
return self.drawConnection(visuals, element, attrs);
|
|
75366
|
-
}
|
|
75367
|
-
}
|
|
75368
|
-
});
|
|
75369
75430
|
|
|
75370
|
-
|
|
75371
|
-
|
|
75372
|
-
|
|
75373
|
-
|
|
75374
|
-
|
|
75375
|
-
|
|
75376
|
-
|
|
75377
|
-
|
|
75378
|
-
|
|
75431
|
+
var nativeToString$1 = Object.prototype.toString;
|
|
75432
|
+
var nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
75433
|
+
function isUndefined$3(obj) {
|
|
75434
|
+
return obj === undefined;
|
|
75435
|
+
}
|
|
75436
|
+
function isArray$3(obj) {
|
|
75437
|
+
return nativeToString$1.call(obj) === '[object Array]';
|
|
75438
|
+
}
|
|
75439
|
+
function isFunction$1(obj) {
|
|
75440
|
+
var tag = nativeToString$1.call(obj);
|
|
75441
|
+
return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object AsyncGeneratorFunction]' || tag === '[object Proxy]';
|
|
75379
75442
|
}
|
|
75380
|
-
|
|
75381
75443
|
/**
|
|
75382
|
-
*
|
|
75383
|
-
* the element/connection.
|
|
75384
|
-
*
|
|
75385
|
-
* @param {element} element
|
|
75444
|
+
* Ensure collection is an array.
|
|
75386
75445
|
*
|
|
75387
|
-
* @
|
|
75446
|
+
* @param {Object} obj
|
|
75388
75447
|
*/
|
|
75389
|
-
BaseRenderer$1.prototype.canRender = function() {};
|
|
75390
75448
|
|
|
75391
|
-
|
|
75392
|
-
|
|
75393
|
-
|
|
75394
|
-
|
|
75395
|
-
* @param {Shape} shape
|
|
75396
|
-
*
|
|
75397
|
-
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
75398
|
-
*/
|
|
75399
|
-
BaseRenderer$1.prototype.drawShape = function() {};
|
|
75449
|
+
function ensureArray$1(obj) {
|
|
75450
|
+
if (isArray$3(obj)) {
|
|
75451
|
+
return;
|
|
75452
|
+
}
|
|
75400
75453
|
|
|
75454
|
+
throw new Error('must supply array');
|
|
75455
|
+
}
|
|
75401
75456
|
/**
|
|
75402
|
-
*
|
|
75457
|
+
* Return true, if target owns a property with the given key.
|
|
75403
75458
|
*
|
|
75404
|
-
* @param {
|
|
75405
|
-
* @param {
|
|
75459
|
+
* @param {Object} target
|
|
75460
|
+
* @param {String} key
|
|
75406
75461
|
*
|
|
75407
|
-
* @
|
|
75462
|
+
* @return {Boolean}
|
|
75408
75463
|
*/
|
|
75409
|
-
|
|
75464
|
+
|
|
75465
|
+
function has$1(target, key) {
|
|
75466
|
+
return nativeHasOwnProperty$1.call(target, key);
|
|
75467
|
+
}
|
|
75410
75468
|
|
|
75411
75469
|
/**
|
|
75412
|
-
*
|
|
75470
|
+
* Find element in collection.
|
|
75413
75471
|
*
|
|
75414
|
-
* @param
|
|
75472
|
+
* @param {Array|Object} collection
|
|
75473
|
+
* @param {Function|Object} matcher
|
|
75415
75474
|
*
|
|
75416
|
-
* @return {
|
|
75475
|
+
* @return {Object}
|
|
75417
75476
|
*/
|
|
75418
|
-
BaseRenderer$1.prototype.getShapePath = function() {};
|
|
75419
75477
|
|
|
75478
|
+
function find$1(collection, matcher) {
|
|
75479
|
+
matcher = toMatcher$1(matcher);
|
|
75480
|
+
var match;
|
|
75481
|
+
forEach$1(collection, function (val, key) {
|
|
75482
|
+
if (matcher(val, key)) {
|
|
75483
|
+
match = val;
|
|
75484
|
+
return false;
|
|
75485
|
+
}
|
|
75486
|
+
});
|
|
75487
|
+
return match;
|
|
75488
|
+
}
|
|
75420
75489
|
/**
|
|
75421
|
-
*
|
|
75490
|
+
* Iterate over collection; returning something
|
|
75491
|
+
* (non-undefined) will stop iteration.
|
|
75422
75492
|
*
|
|
75423
|
-
* @param
|
|
75493
|
+
* @param {Array|Object} collection
|
|
75494
|
+
* @param {Function} iterator
|
|
75424
75495
|
*
|
|
75425
|
-
* @return {
|
|
75496
|
+
* @return {Object} return result that stopped the iteration
|
|
75426
75497
|
*/
|
|
75427
|
-
BaseRenderer$1.prototype.getConnectionPath = function() {};
|
|
75428
75498
|
|
|
75429
|
-
function
|
|
75499
|
+
function forEach$1(collection, iterator) {
|
|
75500
|
+
var val, result;
|
|
75430
75501
|
|
|
75431
|
-
if (
|
|
75432
|
-
|
|
75433
|
-
// may fail on webkit
|
|
75434
|
-
return target.ownerDocument.importNode(element, true);
|
|
75435
|
-
} catch (e) {
|
|
75436
|
-
// ignore
|
|
75437
|
-
}
|
|
75502
|
+
if (isUndefined$3(collection)) {
|
|
75503
|
+
return;
|
|
75438
75504
|
}
|
|
75439
75505
|
|
|
75440
|
-
|
|
75441
|
-
}
|
|
75506
|
+
var convertKey = isArray$3(collection) ? toNum$1 : identity$1;
|
|
75442
75507
|
|
|
75443
|
-
|
|
75444
|
-
|
|
75445
|
-
|
|
75508
|
+
for (var key in collection) {
|
|
75509
|
+
if (has$1(collection, key)) {
|
|
75510
|
+
val = collection[key];
|
|
75511
|
+
result = iterator(val, convertKey(key));
|
|
75446
75512
|
|
|
75513
|
+
if (result === false) {
|
|
75514
|
+
return val;
|
|
75515
|
+
}
|
|
75516
|
+
}
|
|
75517
|
+
}
|
|
75518
|
+
}
|
|
75447
75519
|
/**
|
|
75448
|
-
*
|
|
75520
|
+
* Return collection without element.
|
|
75449
75521
|
*
|
|
75450
|
-
* @param {
|
|
75451
|
-
* @param {
|
|
75522
|
+
* @param {Array} arr
|
|
75523
|
+
* @param {Function} matcher
|
|
75452
75524
|
*
|
|
75453
|
-
* @return {
|
|
75525
|
+
* @return {Array}
|
|
75454
75526
|
*/
|
|
75455
|
-
function appendTo$1(element, target) {
|
|
75456
|
-
return target.appendChild(ensureImported$1(element, target));
|
|
75457
|
-
}
|
|
75458
75527
|
|
|
75459
|
-
|
|
75460
|
-
|
|
75461
|
-
|
|
75528
|
+
function without$1(arr, matcher) {
|
|
75529
|
+
if (isUndefined$3(arr)) {
|
|
75530
|
+
return [];
|
|
75531
|
+
}
|
|
75462
75532
|
|
|
75463
|
-
|
|
75464
|
-
|
|
75465
|
-
|
|
75466
|
-
|
|
75467
|
-
|
|
75468
|
-
*
|
|
75469
|
-
* @return {SVGElement} the element
|
|
75470
|
-
*/
|
|
75471
|
-
function append$1(target, node) {
|
|
75472
|
-
appendTo$1(node, target);
|
|
75473
|
-
return target;
|
|
75533
|
+
ensureArray$1(arr);
|
|
75534
|
+
matcher = toMatcher$1(matcher);
|
|
75535
|
+
return arr.filter(function (el, idx) {
|
|
75536
|
+
return !matcher(el, idx);
|
|
75537
|
+
});
|
|
75474
75538
|
}
|
|
75475
75539
|
|
|
75476
|
-
|
|
75477
|
-
|
|
75478
|
-
|
|
75540
|
+
function toMatcher$1(matcher) {
|
|
75541
|
+
return isFunction$1(matcher) ? matcher : function (e) {
|
|
75542
|
+
return e === matcher;
|
|
75543
|
+
};
|
|
75544
|
+
}
|
|
75479
75545
|
|
|
75480
|
-
|
|
75546
|
+
function identity$1(arg) {
|
|
75547
|
+
return arg;
|
|
75548
|
+
}
|
|
75481
75549
|
|
|
75482
|
-
|
|
75483
|
-
|
|
75484
|
-
|
|
75485
|
-
'clip': 1,
|
|
75486
|
-
'clip-path': 1,
|
|
75487
|
-
'clip-rule': 1,
|
|
75488
|
-
'color': 1,
|
|
75489
|
-
'color-interpolation': 1,
|
|
75490
|
-
'color-interpolation-filters': 1,
|
|
75491
|
-
'color-profile': 1,
|
|
75492
|
-
'color-rendering': 1,
|
|
75493
|
-
'cursor': 1,
|
|
75494
|
-
'direction': 1,
|
|
75495
|
-
'display': 1,
|
|
75496
|
-
'dominant-baseline': 1,
|
|
75497
|
-
'enable-background': 1,
|
|
75498
|
-
'fill': 1,
|
|
75499
|
-
'fill-opacity': 1,
|
|
75500
|
-
'fill-rule': 1,
|
|
75501
|
-
'filter': 1,
|
|
75502
|
-
'flood-color': 1,
|
|
75503
|
-
'flood-opacity': 1,
|
|
75504
|
-
'font': 1,
|
|
75505
|
-
'font-family': 1,
|
|
75506
|
-
'font-size': LENGTH_ATTR$1,
|
|
75507
|
-
'font-size-adjust': 1,
|
|
75508
|
-
'font-stretch': 1,
|
|
75509
|
-
'font-style': 1,
|
|
75510
|
-
'font-variant': 1,
|
|
75511
|
-
'font-weight': 1,
|
|
75512
|
-
'glyph-orientation-horizontal': 1,
|
|
75513
|
-
'glyph-orientation-vertical': 1,
|
|
75514
|
-
'image-rendering': 1,
|
|
75515
|
-
'kerning': 1,
|
|
75516
|
-
'letter-spacing': 1,
|
|
75517
|
-
'lighting-color': 1,
|
|
75518
|
-
'marker': 1,
|
|
75519
|
-
'marker-end': 1,
|
|
75520
|
-
'marker-mid': 1,
|
|
75521
|
-
'marker-start': 1,
|
|
75522
|
-
'mask': 1,
|
|
75523
|
-
'opacity': 1,
|
|
75524
|
-
'overflow': 1,
|
|
75525
|
-
'pointer-events': 1,
|
|
75526
|
-
'shape-rendering': 1,
|
|
75527
|
-
'stop-color': 1,
|
|
75528
|
-
'stop-opacity': 1,
|
|
75529
|
-
'stroke': 1,
|
|
75530
|
-
'stroke-dasharray': 1,
|
|
75531
|
-
'stroke-dashoffset': 1,
|
|
75532
|
-
'stroke-linecap': 1,
|
|
75533
|
-
'stroke-linejoin': 1,
|
|
75534
|
-
'stroke-miterlimit': 1,
|
|
75535
|
-
'stroke-opacity': 1,
|
|
75536
|
-
'stroke-width': LENGTH_ATTR$1,
|
|
75537
|
-
'text-anchor': 1,
|
|
75538
|
-
'text-decoration': 1,
|
|
75539
|
-
'text-rendering': 1,
|
|
75540
|
-
'unicode-bidi': 1,
|
|
75541
|
-
'visibility': 1,
|
|
75542
|
-
'word-spacing': 1,
|
|
75543
|
-
'writing-mode': 1
|
|
75544
|
-
};
|
|
75550
|
+
function toNum$1(arg) {
|
|
75551
|
+
return Number(arg);
|
|
75552
|
+
}
|
|
75545
75553
|
|
|
75554
|
+
/**
|
|
75555
|
+
* Get extension elements of business object. Optionally filter by type.
|
|
75556
|
+
*
|
|
75557
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
75558
|
+
* @param {String} [type=undefined]
|
|
75559
|
+
* @returns {Array<ModdleElement>}
|
|
75560
|
+
*/
|
|
75561
|
+
function getExtensionElementsList$1(element, type = undefined) {
|
|
75562
|
+
const businessObject = getBusinessObject(element),
|
|
75563
|
+
extensionElements = businessObject.get('extensionElements');
|
|
75546
75564
|
|
|
75547
|
-
|
|
75548
|
-
|
|
75549
|
-
return node.style[name];
|
|
75550
|
-
} else {
|
|
75551
|
-
return node.getAttributeNS(null, name);
|
|
75565
|
+
if (!extensionElements) {
|
|
75566
|
+
return [];
|
|
75552
75567
|
}
|
|
75553
|
-
}
|
|
75554
75568
|
|
|
75555
|
-
|
|
75556
|
-
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
75569
|
+
const values = extensionElements.get('values');
|
|
75557
75570
|
|
|
75558
|
-
|
|
75571
|
+
if (!values || !values.length) {
|
|
75572
|
+
return [];
|
|
75573
|
+
}
|
|
75559
75574
|
|
|
75560
75575
|
if (type) {
|
|
75561
|
-
|
|
75562
|
-
if (type === LENGTH_ATTR$1 && typeof value === 'number') {
|
|
75563
|
-
value = String(value) + 'px';
|
|
75564
|
-
}
|
|
75565
|
-
|
|
75566
|
-
node.style[hyphenated] = value;
|
|
75567
|
-
} else {
|
|
75568
|
-
node.setAttributeNS(null, name, value);
|
|
75576
|
+
return values.filter(value => is$1(value, type));
|
|
75569
75577
|
}
|
|
75570
|
-
}
|
|
75571
75578
|
|
|
75572
|
-
|
|
75573
|
-
|
|
75574
|
-
var names = Object.keys(attrs), i, name;
|
|
75575
|
-
|
|
75576
|
-
for (i = 0, name; (name = names[i]); i++) {
|
|
75577
|
-
setAttribute$1(node, name, attrs[name]);
|
|
75578
|
-
}
|
|
75579
|
+
return values;
|
|
75579
75580
|
}
|
|
75580
75581
|
|
|
75581
75582
|
/**
|
|
75582
|
-
*
|
|
75583
|
-
*
|
|
75584
|
-
* @param {SVGElement} node
|
|
75585
|
-
* @param {Object} [attrs]
|
|
75586
|
-
* @param {String} [name]
|
|
75587
|
-
* @param {String} [value]
|
|
75583
|
+
* Remove one or more extension elements. Remove bpmn:ExtensionElements afterwards if it's empty.
|
|
75588
75584
|
*
|
|
75589
|
-
* @
|
|
75585
|
+
* @param {ModdleElement} element
|
|
75586
|
+
* @param {ModdleElement} businessObject
|
|
75587
|
+
* @param {ModdleElement|Array<ModdleElement>} extensionElementsToRemove
|
|
75588
|
+
* @param {CommandStack} commandStack
|
|
75590
75589
|
*/
|
|
75591
|
-
function
|
|
75592
|
-
if (
|
|
75593
|
-
|
|
75594
|
-
setAttribute$1(node, name, value);
|
|
75595
|
-
} else {
|
|
75596
|
-
return getAttribute$1(node, name);
|
|
75597
|
-
}
|
|
75598
|
-
} else {
|
|
75599
|
-
setAttributes$1(node, name);
|
|
75590
|
+
function removeExtensionElements$1(element, businessObject, extensionElementsToRemove, commandStack) {
|
|
75591
|
+
if (!isArray$3(extensionElementsToRemove)) {
|
|
75592
|
+
extensionElementsToRemove = [ extensionElementsToRemove ];
|
|
75600
75593
|
}
|
|
75601
75594
|
|
|
75602
|
-
|
|
75595
|
+
const extensionElements = businessObject.get('extensionElements'),
|
|
75596
|
+
values = extensionElements.get('values').filter(value => !extensionElementsToRemove.includes(value));
|
|
75597
|
+
|
|
75598
|
+
commandStack.execute('element.updateModdleProperties', {
|
|
75599
|
+
element,
|
|
75600
|
+
moddleElement: extensionElements,
|
|
75601
|
+
properties: {
|
|
75602
|
+
values
|
|
75603
|
+
}
|
|
75604
|
+
});
|
|
75603
75605
|
}
|
|
75604
75606
|
|
|
75605
|
-
|
|
75606
|
-
|
|
75607
|
-
};
|
|
75607
|
+
const HIGH_PRIORITY$m = 5000;
|
|
75608
|
+
|
|
75608
75609
|
|
|
75609
75610
|
/**
|
|
75610
|
-
*
|
|
75611
|
+
* Zeebe BPMN behavior ensuring that bpmn:BusinessRuleTask only has one of the following:
|
|
75612
|
+
*
|
|
75613
|
+
* (1) zeebe:CalledDecision
|
|
75614
|
+
* (2) zeebe:TaskDefinition and zeebe:TaskHeaders
|
|
75611
75615
|
*/
|
|
75616
|
+
class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor$1 {
|
|
75617
|
+
constructor(commandStack, eventBus) {
|
|
75618
|
+
super(eventBus);
|
|
75612
75619
|
|
|
75613
|
-
|
|
75620
|
+
/**
|
|
75621
|
+
* Remove zeebe:CalledDecision if zeebe:TaskDefinition is about to be added.
|
|
75622
|
+
*/
|
|
75623
|
+
this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY$m, function(context) {
|
|
75624
|
+
const {
|
|
75625
|
+
element,
|
|
75626
|
+
moddleElement,
|
|
75627
|
+
properties
|
|
75628
|
+
} = context;
|
|
75614
75629
|
|
|
75615
|
-
|
|
75630
|
+
if (
|
|
75631
|
+
!is$1(element, 'bpmn:BusinessRuleTask')
|
|
75632
|
+
|| !is$1(moddleElement, 'bpmn:ExtensionElements')
|
|
75633
|
+
|| !properties.values
|
|
75634
|
+
) {
|
|
75635
|
+
return;
|
|
75636
|
+
}
|
|
75616
75637
|
|
|
75617
|
-
|
|
75638
|
+
const calledDecision = getCalledDecision$2(element),
|
|
75639
|
+
taskDefinition = getTaskDefinition$3(element);
|
|
75618
75640
|
|
|
75619
|
-
|
|
75620
|
-
|
|
75621
|
-
|
|
75622
|
-
|
|
75623
|
-
|
|
75624
|
-
|
|
75625
|
-
|
|
75626
|
-
|
|
75627
|
-
|
|
75628
|
-
}
|
|
75641
|
+
if (
|
|
75642
|
+
calledDecision
|
|
75643
|
+
&& !taskDefinition
|
|
75644
|
+
&& properties.values.find(value => is$1(value, 'zeebe:CalledDecision'))
|
|
75645
|
+
&& properties.values.find(value => is$1(value, 'zeebe:TaskDefinition'))
|
|
75646
|
+
) {
|
|
75647
|
+
properties.values = without$1(properties.values, calledDecision);
|
|
75648
|
+
}
|
|
75649
|
+
}, true);
|
|
75629
75650
|
|
|
75630
|
-
|
|
75651
|
+
/**
|
|
75652
|
+
* Remove zeebe:TaskDefinition and zeebe:TaskHeaders if zeebe:CalledDecision is about to be added.
|
|
75653
|
+
*/
|
|
75654
|
+
this.preExecute('element.updateModdleProperties', HIGH_PRIORITY$m, function(context) {
|
|
75655
|
+
const {
|
|
75656
|
+
element,
|
|
75657
|
+
moddleElement,
|
|
75658
|
+
properties
|
|
75659
|
+
} = context;
|
|
75631
75660
|
|
|
75632
|
-
|
|
75633
|
-
|
|
75634
|
-
|
|
75661
|
+
if (
|
|
75662
|
+
!is$1(element, 'bpmn:BusinessRuleTask')
|
|
75663
|
+
|| !is$1(moddleElement, 'bpmn:ExtensionElements')
|
|
75664
|
+
|| !properties.values
|
|
75665
|
+
) {
|
|
75666
|
+
return;
|
|
75667
|
+
}
|
|
75635
75668
|
|
|
75636
|
-
|
|
75669
|
+
const calledDecision = getCalledDecision$2(element),
|
|
75670
|
+
taskDefinition = getTaskDefinition$3(element),
|
|
75671
|
+
taskHeaders = getTaskHeaders$1(element);
|
|
75637
75672
|
|
|
75638
|
-
|
|
75673
|
+
if (
|
|
75674
|
+
!calledDecision
|
|
75675
|
+
&& (taskDefinition || taskHeaders)
|
|
75676
|
+
&& properties.values.find(value => is$1(value, 'zeebe:CalledDecision'))
|
|
75677
|
+
&& properties.values.find(value => is$1(value, 'zeebe:TaskDefinition') || is$1(value, 'zeebe:TaskHeaders'))
|
|
75678
|
+
) {
|
|
75679
|
+
properties.values = without$1(properties.values, (value) => value === taskDefinition || value === taskHeaders);
|
|
75680
|
+
}
|
|
75681
|
+
}, true);
|
|
75639
75682
|
|
|
75640
|
-
while (parent.firstChild) {
|
|
75641
|
-
fragment.appendChild(parent.firstChild);
|
|
75642
75683
|
}
|
|
75643
|
-
|
|
75644
|
-
return fragment;
|
|
75645
75684
|
}
|
|
75646
75685
|
|
|
75647
|
-
|
|
75686
|
+
CleanUpBusinessRuleTaskBehavior.$inject = [
|
|
75687
|
+
'commandStack',
|
|
75688
|
+
'eventBus'
|
|
75689
|
+
];
|
|
75648
75690
|
|
|
75649
|
-
var parser;
|
|
75650
75691
|
|
|
75651
|
-
|
|
75652
|
-
parser = new DOMParser();
|
|
75653
|
-
parser.async = false;
|
|
75692
|
+
// helpers //////////
|
|
75654
75693
|
|
|
75655
|
-
|
|
75694
|
+
function getCalledDecision$2(element) {
|
|
75695
|
+
const businessObject = getBusinessObject(element);
|
|
75696
|
+
|
|
75697
|
+
return getExtensionElementsList$1(businessObject, 'zeebe:CalledDecision')[ 0 ];
|
|
75656
75698
|
}
|
|
75657
75699
|
|
|
75658
|
-
|
|
75659
|
-
|
|
75660
|
-
|
|
75700
|
+
function getTaskDefinition$3(element) {
|
|
75701
|
+
const businessObject = getBusinessObject(element);
|
|
75702
|
+
|
|
75703
|
+
return getExtensionElementsList$1(businessObject, 'zeebe:TaskDefinition')[ 0 ];
|
|
75704
|
+
}
|
|
75705
|
+
|
|
75706
|
+
function getTaskHeaders$1(element) {
|
|
75707
|
+
const businessObject = getBusinessObject(element);
|
|
75661
75708
|
|
|
75709
|
+
return getExtensionElementsList$1(businessObject, 'zeebe:TaskHeaders')[ 0 ];
|
|
75710
|
+
}
|
|
75662
75711
|
|
|
75663
75712
|
/**
|
|
75664
|
-
*
|
|
75713
|
+
* Creates a new element and set the parent to it
|
|
75665
75714
|
*
|
|
75666
|
-
* @
|
|
75667
|
-
* @param {Object} [attrs] attributes to set on the element
|
|
75715
|
+
* @method ElementHelper#createElement
|
|
75668
75716
|
*
|
|
75669
|
-
* @
|
|
75717
|
+
* @param {String} elementType of the new element
|
|
75718
|
+
* @param {Object} properties of the new element in key-value pairs
|
|
75719
|
+
* @param {moddle.object} parent of the new element
|
|
75720
|
+
* @param {BpmnFactory} factory which creates the new element
|
|
75721
|
+
*
|
|
75722
|
+
* @returns {djs.model.Base} element which is created
|
|
75670
75723
|
*/
|
|
75671
|
-
function
|
|
75672
|
-
var element;
|
|
75673
|
-
|
|
75674
|
-
if (name.charAt(0) === '<') {
|
|
75675
|
-
element = parse$3(name).firstChild;
|
|
75676
|
-
element = document.importNode(element, true);
|
|
75677
|
-
} else {
|
|
75678
|
-
element = document.createElementNS(ns$1.svg, name);
|
|
75679
|
-
}
|
|
75680
|
-
|
|
75681
|
-
if (attrs) {
|
|
75682
|
-
attr$2(element, attrs);
|
|
75683
|
-
}
|
|
75724
|
+
function createElement$1(elementType, properties, parent, factory) {
|
|
75725
|
+
var element = factory.create(elementType, properties);
|
|
75726
|
+
element.$parent = parent;
|
|
75684
75727
|
|
|
75685
75728
|
return element;
|
|
75686
75729
|
}
|
|
75687
75730
|
|
|
75688
75731
|
/**
|
|
75689
|
-
*
|
|
75732
|
+
* Get zeebe:IoMapping from an element.
|
|
75733
|
+
*
|
|
75734
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
75735
|
+
*
|
|
75736
|
+
* @return {ModdleElement}
|
|
75690
75737
|
*/
|
|
75738
|
+
function getIoMapping$1(element) {
|
|
75739
|
+
const businessObject = getBusinessObject(element);
|
|
75691
75740
|
|
|
75692
|
-
|
|
75693
|
-
create$2('svg');
|
|
75694
|
-
|
|
75695
|
-
function getModelerTemplateIcon(element) {
|
|
75696
|
-
var modelerTemplateIcon = getBusinessObject(element).get('zeebe:modelerTemplateIcon');
|
|
75697
|
-
return modelerTemplateIcon;
|
|
75698
|
-
}
|
|
75699
|
-
|
|
75700
|
-
var HIGH_PRIORITY$m = 1250;
|
|
75701
|
-
|
|
75702
|
-
|
|
75703
|
-
function IconsRenderer(
|
|
75704
|
-
bpmnRenderer,
|
|
75705
|
-
eventBus
|
|
75706
|
-
) {
|
|
75707
|
-
this._bpmnRenderer = bpmnRenderer;
|
|
75708
|
-
|
|
75709
|
-
BaseRenderer$1.call(this, eventBus, HIGH_PRIORITY$m);
|
|
75710
|
-
}
|
|
75711
|
-
|
|
75712
|
-
inherits_browser(IconsRenderer, BaseRenderer$1);
|
|
75713
|
-
|
|
75714
|
-
IconsRenderer.prototype.canRender = function(element) {
|
|
75741
|
+
const extensionElements = businessObject.get('extensionElements');
|
|
75715
75742
|
|
|
75716
|
-
if (
|
|
75717
|
-
return
|
|
75743
|
+
if (!extensionElements) {
|
|
75744
|
+
return;
|
|
75718
75745
|
}
|
|
75719
75746
|
|
|
75720
|
-
return (
|
|
75721
|
-
is$1(
|
|
75722
|
-
!!getModelerTemplateIcon(element)
|
|
75723
|
-
);
|
|
75724
|
-
};
|
|
75725
|
-
|
|
75726
|
-
IconsRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
75727
|
-
|
|
75728
|
-
var renderer = this._bpmnRenderer.handlers['bpmn:Task'];
|
|
75729
|
-
|
|
75730
|
-
var gfx = renderer(parentGfx, element);
|
|
75731
|
-
|
|
75732
|
-
var modelerTemplateIcon = getModelerTemplateIcon(element);
|
|
75733
|
-
|
|
75734
|
-
var icon = create$2('image');
|
|
75735
|
-
attr$2(icon, {
|
|
75736
|
-
href: modelerTemplateIcon,
|
|
75737
|
-
x: 4,
|
|
75738
|
-
y: 4
|
|
75747
|
+
return extensionElements.get('values').find((value) => {
|
|
75748
|
+
return is$1(value, 'zeebe:IoMapping');
|
|
75739
75749
|
});
|
|
75750
|
+
}
|
|
75740
75751
|
|
|
75741
|
-
|
|
75742
|
-
|
|
75743
|
-
|
|
75744
|
-
|
|
75752
|
+
/**
|
|
75753
|
+
* Get zeebe:InputParameters from an element.
|
|
75754
|
+
*
|
|
75755
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
75756
|
+
*
|
|
75757
|
+
* @return {Array<ModdleElement>}
|
|
75758
|
+
*/
|
|
75759
|
+
function getInputParameters(element) {
|
|
75760
|
+
const ioMapping = getIoMapping$1(element);
|
|
75745
75761
|
|
|
75746
|
-
|
|
75747
|
-
|
|
75748
|
-
|
|
75749
|
-
];
|
|
75762
|
+
if (ioMapping) {
|
|
75763
|
+
return ioMapping.get('zeebe:inputParameters');
|
|
75764
|
+
}
|
|
75750
75765
|
|
|
75751
|
-
|
|
75752
|
-
|
|
75753
|
-
elementTemplatesIconsRenderer: [ 'type', IconsRenderer ]
|
|
75754
|
-
};
|
|
75766
|
+
return [];
|
|
75767
|
+
}
|
|
75755
75768
|
|
|
75756
75769
|
/**
|
|
75757
|
-
* Get
|
|
75770
|
+
* Get zeebe:OutputParameters from an element.
|
|
75758
75771
|
*
|
|
75759
75772
|
* @param {djs.model.Base|ModdleElement} element
|
|
75760
|
-
*
|
|
75761
|
-
* @
|
|
75773
|
+
*
|
|
75774
|
+
* @return {Array<ModdleElement>}
|
|
75762
75775
|
*/
|
|
75763
|
-
function
|
|
75764
|
-
const
|
|
75765
|
-
extensionElements = businessObject.get('extensionElements');
|
|
75776
|
+
function getOutputParameters(element) {
|
|
75777
|
+
const ioMapping = getIoMapping$1(element);
|
|
75766
75778
|
|
|
75767
|
-
if (
|
|
75768
|
-
return
|
|
75779
|
+
if (ioMapping) {
|
|
75780
|
+
return ioMapping.get('zeebe:outputParameters');
|
|
75769
75781
|
}
|
|
75770
75782
|
|
|
75771
|
-
|
|
75783
|
+
return [];
|
|
75784
|
+
}
|
|
75772
75785
|
|
|
75773
|
-
|
|
75774
|
-
|
|
75786
|
+
/**
|
|
75787
|
+
* Get default value for zeebe:propagateAllChildVariables.
|
|
75788
|
+
*
|
|
75789
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
75790
|
+
*
|
|
75791
|
+
* @returns {boolean}
|
|
75792
|
+
*/
|
|
75793
|
+
function getPropagateAllChildVariablesDefault(element) {
|
|
75794
|
+
if (!is$1(element, 'bpmn:CallActivity')) {
|
|
75795
|
+
return false;
|
|
75775
75796
|
}
|
|
75776
75797
|
|
|
75777
|
-
|
|
75778
|
-
|
|
75798
|
+
const outputParameters = getOutputParameters(element);
|
|
75799
|
+
|
|
75800
|
+
if (outputParameters) {
|
|
75801
|
+
return !outputParameters.length;
|
|
75779
75802
|
}
|
|
75803
|
+
}
|
|
75780
75804
|
|
|
75781
|
-
|
|
75805
|
+
/**
|
|
75806
|
+
* Get zeebe:CalledElement of an element.
|
|
75807
|
+
*
|
|
75808
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
75809
|
+
*
|
|
75810
|
+
* @returns {ModdleElement}
|
|
75811
|
+
*/
|
|
75812
|
+
function getCalledElement$1(element) {
|
|
75813
|
+
const calledElements = getCalledElements$1(element);
|
|
75814
|
+
|
|
75815
|
+
return calledElements[ 0 ];
|
|
75816
|
+
}
|
|
75817
|
+
|
|
75818
|
+
function getCalledElements$1(element) {
|
|
75819
|
+
const businessObject = getBusinessObject(element);
|
|
75820
|
+
|
|
75821
|
+
return getExtensionElementsList$1(businessObject, 'zeebe:CalledElement');
|
|
75782
75822
|
}
|
|
75783
75823
|
|
|
75784
75824
|
/**
|
|
75785
|
-
*
|
|
75825
|
+
* Check whether zeebe:propagateAllChildVariables is set on an element.
|
|
75826
|
+
* Fall back to default if zeebe:propagateAllChildVariables not set.
|
|
75786
75827
|
*
|
|
75787
|
-
* @param {ModdleElement} element
|
|
75788
|
-
*
|
|
75789
|
-
* @
|
|
75790
|
-
* @param {CommandStack} commandStack
|
|
75828
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
75829
|
+
*
|
|
75830
|
+
* @returns {boolean}
|
|
75791
75831
|
*/
|
|
75792
|
-
function
|
|
75793
|
-
if (!
|
|
75794
|
-
|
|
75832
|
+
function isPropagateAllChildVariables$1(element) {
|
|
75833
|
+
if (!is$1(element, 'bpmn:CallActivity')) {
|
|
75834
|
+
return false;
|
|
75795
75835
|
}
|
|
75796
75836
|
|
|
75797
|
-
const
|
|
75798
|
-
|
|
75837
|
+
const businessObject = getBusinessObject(element),
|
|
75838
|
+
calledElement = getCalledElement$1(businessObject);
|
|
75799
75839
|
|
|
75800
|
-
|
|
75801
|
-
|
|
75802
|
-
|
|
75803
|
-
|
|
75804
|
-
|
|
75805
|
-
}
|
|
75806
|
-
});
|
|
75840
|
+
if (calledElement && has$1(calledElement, 'propagateAllChildVariables')) {
|
|
75841
|
+
return calledElement.get('propagateAllChildVariables') || false;
|
|
75842
|
+
} else {
|
|
75843
|
+
return getPropagateAllChildVariablesDefault(element);
|
|
75844
|
+
}
|
|
75807
75845
|
}
|
|
75808
75846
|
|
|
75809
75847
|
const HIGH_PRIORITY$n = 5000;
|
|
75810
75848
|
|
|
75811
75849
|
|
|
75812
75850
|
/**
|
|
75813
|
-
* Zeebe BPMN behavior
|
|
75814
|
-
*
|
|
75815
|
-
* (1) zeebe:CalledDecision
|
|
75816
|
-
* (2) zeebe:TaskDefinition and zeebe:TaskHeaders
|
|
75851
|
+
* Zeebe BPMN specific behavior for creating call activities.
|
|
75817
75852
|
*/
|
|
75818
|
-
class
|
|
75819
|
-
constructor(
|
|
75853
|
+
class CreateZeebeCallActivityBehavior extends CommandInterceptor$1 {
|
|
75854
|
+
constructor(bpmnFactory, eventBus, modeling) {
|
|
75820
75855
|
super(eventBus);
|
|
75821
75856
|
|
|
75822
75857
|
/**
|
|
75823
|
-
*
|
|
75858
|
+
* Add zeebe:CalledElement extension element with zeebe:propagateAllChildVariables attribute = false
|
|
75859
|
+
* when creating bpmn:CallActivity.
|
|
75824
75860
|
*/
|
|
75825
|
-
this.
|
|
75826
|
-
const {
|
|
75827
|
-
element,
|
|
75828
|
-
moddleElement,
|
|
75829
|
-
properties
|
|
75830
|
-
} = context;
|
|
75861
|
+
this.postExecuted('shape.create', HIGH_PRIORITY$n, function(context) {
|
|
75862
|
+
const { shape } = context;
|
|
75831
75863
|
|
|
75832
|
-
if (
|
|
75833
|
-
!is$1(element, 'bpmn:BusinessRuleTask')
|
|
75834
|
-
|| !is$1(moddleElement, 'bpmn:ExtensionElements')
|
|
75835
|
-
|| !properties.values
|
|
75836
|
-
) {
|
|
75864
|
+
if (!is$1(shape, 'bpmn:CallActivity')) {
|
|
75837
75865
|
return;
|
|
75838
75866
|
}
|
|
75839
75867
|
|
|
75840
|
-
const
|
|
75841
|
-
taskDefinition = getTaskDefinition$3(element);
|
|
75868
|
+
const businessObject = getBusinessObject(shape);
|
|
75842
75869
|
|
|
75843
|
-
|
|
75844
|
-
calledDecision
|
|
75845
|
-
&& !taskDefinition
|
|
75846
|
-
&& properties.values.find(value => is$1(value, 'zeebe:CalledDecision'))
|
|
75847
|
-
&& properties.values.find(value => is$1(value, 'zeebe:TaskDefinition'))
|
|
75848
|
-
) {
|
|
75849
|
-
properties.values = without(properties.values, calledDecision);
|
|
75850
|
-
}
|
|
75851
|
-
}, true);
|
|
75870
|
+
let calledElement = getCalledElement$1(businessObject);
|
|
75852
75871
|
|
|
75853
|
-
|
|
75854
|
-
|
|
75855
|
-
*/
|
|
75856
|
-
this.preExecute('element.updateModdleProperties', HIGH_PRIORITY$n, function(context) {
|
|
75857
|
-
const {
|
|
75858
|
-
element,
|
|
75859
|
-
moddleElement,
|
|
75860
|
-
properties
|
|
75861
|
-
} = context;
|
|
75872
|
+
if (!calledElement) {
|
|
75873
|
+
let extensionElements = businessObject.get('extensionElements');
|
|
75862
75874
|
|
|
75863
|
-
|
|
75864
|
-
|
|
75865
|
-
|
|
75866
|
-
|
|
75867
|
-
|
|
75868
|
-
|
|
75869
|
-
|
|
75875
|
+
if (!extensionElements) {
|
|
75876
|
+
extensionElements = createElement$1(
|
|
75877
|
+
'bpmn:ExtensionElements',
|
|
75878
|
+
{
|
|
75879
|
+
values: []
|
|
75880
|
+
},
|
|
75881
|
+
businessObject,
|
|
75882
|
+
bpmnFactory
|
|
75883
|
+
);
|
|
75870
75884
|
|
|
75871
|
-
|
|
75872
|
-
|
|
75873
|
-
taskHeaders = getTaskHeaders$1(element);
|
|
75885
|
+
modeling.updateProperties(shape, { extensionElements });
|
|
75886
|
+
}
|
|
75874
75887
|
|
|
75875
|
-
|
|
75876
|
-
|
|
75877
|
-
|
|
75878
|
-
|
|
75879
|
-
|
|
75880
|
-
|
|
75881
|
-
|
|
75888
|
+
calledElement = createElement$1(
|
|
75889
|
+
'zeebe:CalledElement',
|
|
75890
|
+
{
|
|
75891
|
+
propagateAllChildVariables: false
|
|
75892
|
+
},
|
|
75893
|
+
extensionElements,
|
|
75894
|
+
bpmnFactory
|
|
75895
|
+
);
|
|
75896
|
+
|
|
75897
|
+
modeling.updateModdleProperties(shape, extensionElements, {
|
|
75898
|
+
values: [
|
|
75899
|
+
...(extensionElements.values || []),
|
|
75900
|
+
calledElement
|
|
75901
|
+
]
|
|
75902
|
+
});
|
|
75903
|
+
} else if (!has$1(calledElement, 'propagateAllChildVariables')) {
|
|
75904
|
+
|
|
75905
|
+
// set zeebe:propagateAllChildVariables to false if zeebe:CalledElement exists
|
|
75906
|
+
modeling.updateModdleProperties(shape, calledElement, {
|
|
75907
|
+
propagateAllChildVariables: false
|
|
75908
|
+
});
|
|
75882
75909
|
}
|
|
75883
75910
|
}, true);
|
|
75884
75911
|
|
|
75885
75912
|
}
|
|
75886
75913
|
}
|
|
75887
75914
|
|
|
75888
|
-
|
|
75889
|
-
'
|
|
75890
|
-
'eventBus'
|
|
75915
|
+
CreateZeebeCallActivityBehavior.$inject = [
|
|
75916
|
+
'bpmnFactory',
|
|
75917
|
+
'eventBus',
|
|
75918
|
+
'modeling'
|
|
75891
75919
|
];
|
|
75892
75920
|
|
|
75893
|
-
|
|
75894
|
-
|
|
75895
|
-
|
|
75896
|
-
function getCalledDecision$2(element) {
|
|
75897
|
-
const businessObject = getBusinessObject(element);
|
|
75898
|
-
|
|
75899
|
-
return getExtensionElementsList$1(businessObject, 'zeebe:CalledDecision')[ 0 ];
|
|
75900
|
-
}
|
|
75901
|
-
|
|
75902
|
-
function getTaskDefinition$3(element) {
|
|
75903
|
-
const businessObject = getBusinessObject(element);
|
|
75904
|
-
|
|
75905
|
-
return getExtensionElementsList$1(businessObject, 'zeebe:TaskDefinition')[ 0 ];
|
|
75906
|
-
}
|
|
75907
|
-
|
|
75908
|
-
function getTaskHeaders$1(element) {
|
|
75909
|
-
const businessObject = getBusinessObject(element);
|
|
75910
|
-
|
|
75911
|
-
return getExtensionElementsList$1(businessObject, 'zeebe:TaskHeaders')[ 0 ];
|
|
75921
|
+
function createCommonjsModule$2(fn, module) {
|
|
75922
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
75912
75923
|
}
|
|
75913
75924
|
|
|
75914
|
-
|
|
75925
|
+
var hat_1$1 = createCommonjsModule$2(function (module) {
|
|
75926
|
+
var hat = module.exports = function (bits, base) {
|
|
75927
|
+
if (!base) base = 16;
|
|
75928
|
+
if (bits === undefined) bits = 128;
|
|
75929
|
+
if (bits <= 0) return '0';
|
|
75930
|
+
|
|
75931
|
+
var digits = Math.log(Math.pow(2, bits)) / Math.log(base);
|
|
75932
|
+
for (var i = 2; digits === Infinity; i *= 2) {
|
|
75933
|
+
digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;
|
|
75934
|
+
}
|
|
75935
|
+
|
|
75936
|
+
var rem = digits - Math.floor(digits);
|
|
75937
|
+
|
|
75938
|
+
var res = '';
|
|
75939
|
+
|
|
75940
|
+
for (var i = 0; i < Math.floor(digits); i++) {
|
|
75941
|
+
var x = Math.floor(Math.random() * base).toString(base);
|
|
75942
|
+
res = x + res;
|
|
75943
|
+
}
|
|
75944
|
+
|
|
75945
|
+
if (rem) {
|
|
75946
|
+
var b = Math.pow(base, rem);
|
|
75947
|
+
var x = Math.floor(Math.random() * b).toString(base);
|
|
75948
|
+
res = x + res;
|
|
75949
|
+
}
|
|
75950
|
+
|
|
75951
|
+
var parsed = parseInt(res, base);
|
|
75952
|
+
if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {
|
|
75953
|
+
return hat(bits, base)
|
|
75954
|
+
}
|
|
75955
|
+
else return res;
|
|
75956
|
+
};
|
|
75915
75957
|
|
|
75958
|
+
hat.rack = function (bits, base, expandBy) {
|
|
75959
|
+
var fn = function (data) {
|
|
75960
|
+
var iters = 0;
|
|
75961
|
+
do {
|
|
75962
|
+
if (iters ++ > 10) {
|
|
75963
|
+
if (expandBy) bits += expandBy;
|
|
75964
|
+
else throw new Error('too many ID collisions, use more bits')
|
|
75965
|
+
}
|
|
75966
|
+
|
|
75967
|
+
var id = hat(bits, base);
|
|
75968
|
+
} while (Object.hasOwnProperty.call(hats, id));
|
|
75969
|
+
|
|
75970
|
+
hats[id] = data;
|
|
75971
|
+
return id;
|
|
75972
|
+
};
|
|
75973
|
+
var hats = fn.hats = {};
|
|
75974
|
+
|
|
75975
|
+
fn.get = function (id) {
|
|
75976
|
+
return fn.hats[id];
|
|
75977
|
+
};
|
|
75978
|
+
|
|
75979
|
+
fn.set = function (id, value) {
|
|
75980
|
+
fn.hats[id] = value;
|
|
75981
|
+
return fn;
|
|
75982
|
+
};
|
|
75983
|
+
|
|
75984
|
+
fn.bits = bits || 128;
|
|
75985
|
+
fn.base = base || 16;
|
|
75986
|
+
return fn;
|
|
75987
|
+
};
|
|
75988
|
+
});
|
|
75916
75989
|
|
|
75917
75990
|
/**
|
|
75918
|
-
*
|
|
75991
|
+
* Create a new id generator / cache instance.
|
|
75992
|
+
*
|
|
75993
|
+
* You may optionally provide a seed that is used internally.
|
|
75994
|
+
*
|
|
75995
|
+
* @param {Seed} seed
|
|
75919
75996
|
*/
|
|
75920
|
-
class CreateZeebeBoundaryEventBehavior extends CommandInterceptor$1 {
|
|
75921
|
-
constructor(bpmnFactory, elementFactory, eventBus) {
|
|
75922
|
-
super(eventBus);
|
|
75923
|
-
|
|
75924
|
-
/**
|
|
75925
|
-
* Replace intermediate catch event with boundary event when attaching it to a shape.
|
|
75926
|
-
*/
|
|
75927
|
-
this.preExecute('shape.create', HIGH_PRIORITY$o, function(context) {
|
|
75928
|
-
const {
|
|
75929
|
-
shape,
|
|
75930
|
-
host
|
|
75931
|
-
} = context;
|
|
75932
|
-
|
|
75933
|
-
const businessObject = getBusinessObject(shape);
|
|
75934
|
-
|
|
75935
|
-
let attrs = {
|
|
75936
|
-
cancelActivity: true
|
|
75937
|
-
};
|
|
75938
|
-
|
|
75939
|
-
let newBusinessObject,
|
|
75940
|
-
hostBusinessObject,
|
|
75941
|
-
boundaryEvent,
|
|
75942
|
-
eventDefinitions;
|
|
75943
|
-
|
|
75944
|
-
if (!host || !is$1(shape, 'bpmn:IntermediateCatchEvent')) {
|
|
75945
|
-
return;
|
|
75946
|
-
}
|
|
75947
|
-
|
|
75948
|
-
hostBusinessObject = getBusinessObject(host);
|
|
75949
|
-
|
|
75950
|
-
attrs = {
|
|
75951
|
-
...attrs,
|
|
75952
|
-
attachedToRef: hostBusinessObject
|
|
75953
|
-
};
|
|
75954
|
-
|
|
75955
|
-
eventDefinitions = businessObject.eventDefinitions;
|
|
75956
|
-
|
|
75957
|
-
newBusinessObject = bpmnFactory.create('bpmn:BoundaryEvent', attrs);
|
|
75958
|
-
|
|
75959
|
-
boundaryEvent = {
|
|
75960
|
-
type: 'bpmn:BoundaryEvent',
|
|
75961
|
-
businessObject: newBusinessObject,
|
|
75962
|
-
};
|
|
75963
|
-
|
|
75964
|
-
if (eventDefinitions && eventDefinitions[0]) {
|
|
75965
|
-
boundaryEvent = {
|
|
75966
|
-
...boundaryEvent,
|
|
75967
|
-
eventDefinitionType: eventDefinitions[0].$type
|
|
75968
|
-
};
|
|
75969
|
-
}
|
|
75970
|
-
|
|
75971
|
-
context.shape = elementFactory.createShape(boundaryEvent);
|
|
75972
|
-
|
|
75973
|
-
}, true);
|
|
75974
75997
|
|
|
75998
|
+
function Ids$1(seed) {
|
|
75999
|
+
if (!(this instanceof Ids$1)) {
|
|
76000
|
+
return new Ids$1(seed);
|
|
75975
76001
|
}
|
|
75976
|
-
}
|
|
75977
|
-
|
|
75978
|
-
CreateZeebeBoundaryEventBehavior.$inject = [
|
|
75979
|
-
'bpmnFactory',
|
|
75980
|
-
'elementFactory',
|
|
75981
|
-
'eventBus'
|
|
75982
|
-
];
|
|
75983
76002
|
|
|
76003
|
+
seed = seed || [128, 36, 1];
|
|
76004
|
+
this._seed = seed.length ? hat_1$1.rack(seed[0], seed[1], seed[2]) : seed;
|
|
76005
|
+
}
|
|
75984
76006
|
/**
|
|
75985
|
-
*
|
|
75986
|
-
*
|
|
75987
|
-
* @method ElementHelper#createElement
|
|
76007
|
+
* Generate a next id.
|
|
75988
76008
|
*
|
|
75989
|
-
* @param {
|
|
75990
|
-
* @param {Object} properties of the new element in key-value pairs
|
|
75991
|
-
* @param {moddle.object} parent of the new element
|
|
75992
|
-
* @param {BpmnFactory} factory which creates the new element
|
|
76009
|
+
* @param {Object} [element] element to bind the id to
|
|
75993
76010
|
*
|
|
75994
|
-
* @
|
|
76011
|
+
* @return {String} id
|
|
75995
76012
|
*/
|
|
75996
|
-
function createElement$1(elementType, properties, parent, factory) {
|
|
75997
|
-
var element = factory.create(elementType, properties);
|
|
75998
|
-
element.$parent = parent;
|
|
75999
|
-
|
|
76000
|
-
return element;
|
|
76001
|
-
}
|
|
76002
76013
|
|
|
76014
|
+
Ids$1.prototype.next = function (element) {
|
|
76015
|
+
return this._seed(element || true);
|
|
76016
|
+
};
|
|
76003
76017
|
/**
|
|
76004
|
-
*
|
|
76018
|
+
* Generate a next id with a given prefix.
|
|
76005
76019
|
*
|
|
76006
|
-
* @param {
|
|
76020
|
+
* @param {Object} [element] element to bind the id to
|
|
76007
76021
|
*
|
|
76008
|
-
* @return {
|
|
76022
|
+
* @return {String} id
|
|
76009
76023
|
*/
|
|
76010
|
-
function getIoMapping$1(element) {
|
|
76011
|
-
const businessObject = getBusinessObject(element);
|
|
76012
76024
|
|
|
76013
|
-
const extensionElements = businessObject.get('extensionElements');
|
|
76014
76025
|
|
|
76015
|
-
|
|
76016
|
-
|
|
76017
|
-
|
|
76026
|
+
Ids$1.prototype.nextPrefixed = function (prefix, element) {
|
|
76027
|
+
var id;
|
|
76028
|
+
|
|
76029
|
+
do {
|
|
76030
|
+
id = prefix + this.next(true);
|
|
76031
|
+
} while (this.assigned(id)); // claim {prefix}{random}
|
|
76018
76032
|
|
|
76019
|
-
return extensionElements.get('values').find((value) => {
|
|
76020
|
-
return is$1(value, 'zeebe:IoMapping');
|
|
76021
|
-
});
|
|
76022
|
-
}
|
|
76023
76033
|
|
|
76034
|
+
this.claim(id, element); // return
|
|
76035
|
+
|
|
76036
|
+
return id;
|
|
76037
|
+
};
|
|
76024
76038
|
/**
|
|
76025
|
-
*
|
|
76026
|
-
*
|
|
76027
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
76039
|
+
* Manually claim an existing id.
|
|
76028
76040
|
*
|
|
76029
|
-
* @
|
|
76041
|
+
* @param {String} id
|
|
76042
|
+
* @param {String} [element] element the id is claimed by
|
|
76030
76043
|
*/
|
|
76031
|
-
function getInputParameters(element) {
|
|
76032
|
-
const ioMapping = getIoMapping$1(element);
|
|
76033
|
-
|
|
76034
|
-
if (ioMapping) {
|
|
76035
|
-
return ioMapping.get('zeebe:inputParameters');
|
|
76036
|
-
}
|
|
76037
76044
|
|
|
76038
|
-
return [];
|
|
76039
|
-
}
|
|
76040
76045
|
|
|
76046
|
+
Ids$1.prototype.claim = function (id, element) {
|
|
76047
|
+
this._seed.set(id, element || true);
|
|
76048
|
+
};
|
|
76041
76049
|
/**
|
|
76042
|
-
*
|
|
76043
|
-
*
|
|
76044
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
76050
|
+
* Returns true if the given id has already been assigned.
|
|
76045
76051
|
*
|
|
76046
|
-
* @
|
|
76052
|
+
* @param {String} id
|
|
76053
|
+
* @return {Boolean}
|
|
76047
76054
|
*/
|
|
76048
|
-
function getOutputParameters(element) {
|
|
76049
|
-
const ioMapping = getIoMapping$1(element);
|
|
76050
|
-
|
|
76051
|
-
if (ioMapping) {
|
|
76052
|
-
return ioMapping.get('zeebe:outputParameters');
|
|
76053
|
-
}
|
|
76054
76055
|
|
|
76055
|
-
return [];
|
|
76056
|
-
}
|
|
76057
76056
|
|
|
76057
|
+
Ids$1.prototype.assigned = function (id) {
|
|
76058
|
+
return this._seed.get(id) || false;
|
|
76059
|
+
};
|
|
76058
76060
|
/**
|
|
76059
|
-
*
|
|
76060
|
-
*
|
|
76061
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
76061
|
+
* Unclaim an id.
|
|
76062
76062
|
*
|
|
76063
|
-
* @
|
|
76063
|
+
* @param {String} id the id to unclaim
|
|
76064
76064
|
*/
|
|
76065
|
-
function getPropagateAllChildVariablesDefault(element) {
|
|
76066
|
-
if (!is$1(element, 'bpmn:CallActivity')) {
|
|
76067
|
-
return false;
|
|
76068
|
-
}
|
|
76069
76065
|
|
|
76070
|
-
const outputParameters = getOutputParameters(element);
|
|
76071
|
-
|
|
76072
|
-
if (outputParameters) {
|
|
76073
|
-
return !outputParameters.length;
|
|
76074
|
-
}
|
|
76075
|
-
}
|
|
76076
76066
|
|
|
76067
|
+
Ids$1.prototype.unclaim = function (id) {
|
|
76068
|
+
delete this._seed.hats[id];
|
|
76069
|
+
};
|
|
76077
76070
|
/**
|
|
76078
|
-
*
|
|
76079
|
-
*
|
|
76080
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
76081
|
-
*
|
|
76082
|
-
* @returns {ModdleElement}
|
|
76083
|
-
*/
|
|
76084
|
-
function getCalledElement$1(element) {
|
|
76085
|
-
const calledElements = getCalledElements$1(element);
|
|
76086
|
-
|
|
76087
|
-
return calledElements[ 0 ];
|
|
76088
|
-
}
|
|
76089
|
-
|
|
76090
|
-
function getCalledElements$1(element) {
|
|
76091
|
-
const businessObject = getBusinessObject(element);
|
|
76092
|
-
|
|
76093
|
-
return getExtensionElementsList$1(businessObject, 'zeebe:CalledElement');
|
|
76094
|
-
}
|
|
76095
|
-
|
|
76096
|
-
/**
|
|
76097
|
-
* Check whether zeebe:propagateAllChildVariables is set on an element.
|
|
76098
|
-
* Fall back to default if zeebe:propagateAllChildVariables not set.
|
|
76099
|
-
*
|
|
76100
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
76101
|
-
*
|
|
76102
|
-
* @returns {boolean}
|
|
76103
|
-
*/
|
|
76104
|
-
function isPropagateAllChildVariables$1(element) {
|
|
76105
|
-
if (!is$1(element, 'bpmn:CallActivity')) {
|
|
76106
|
-
return false;
|
|
76107
|
-
}
|
|
76108
|
-
|
|
76109
|
-
const businessObject = getBusinessObject(element),
|
|
76110
|
-
calledElement = getCalledElement$1(businessObject);
|
|
76111
|
-
|
|
76112
|
-
if (calledElement && has(calledElement, 'propagateAllChildVariables')) {
|
|
76113
|
-
return calledElement.get('propagateAllChildVariables') || false;
|
|
76114
|
-
} else {
|
|
76115
|
-
return getPropagateAllChildVariablesDefault(element);
|
|
76116
|
-
}
|
|
76117
|
-
}
|
|
76118
|
-
|
|
76119
|
-
const HIGH_PRIORITY$p = 5000;
|
|
76120
|
-
|
|
76121
|
-
|
|
76122
|
-
/**
|
|
76123
|
-
* Zeebe BPMN specific behavior for creating call activities.
|
|
76071
|
+
* Clear all claimed ids.
|
|
76124
76072
|
*/
|
|
76125
|
-
class CreateZeebeCallActivityBehavior extends CommandInterceptor$1 {
|
|
76126
|
-
constructor(bpmnFactory, eventBus, modeling) {
|
|
76127
|
-
super(eventBus);
|
|
76128
|
-
|
|
76129
|
-
/**
|
|
76130
|
-
* Add zeebe:CalledElement extension element with zeebe:propagateAllChildVariables attribute = false
|
|
76131
|
-
* when creating bpmn:CallActivity.
|
|
76132
|
-
*/
|
|
76133
|
-
this.postExecuted('shape.create', HIGH_PRIORITY$p, function(context) {
|
|
76134
|
-
const { shape } = context;
|
|
76135
|
-
|
|
76136
|
-
if (!is$1(shape, 'bpmn:CallActivity')) {
|
|
76137
|
-
return;
|
|
76138
|
-
}
|
|
76139
|
-
|
|
76140
|
-
const businessObject = getBusinessObject(shape);
|
|
76141
|
-
|
|
76142
|
-
let calledElement = getCalledElement$1(businessObject);
|
|
76143
|
-
|
|
76144
|
-
if (!calledElement) {
|
|
76145
|
-
let extensionElements = businessObject.get('extensionElements');
|
|
76146
|
-
|
|
76147
|
-
if (!extensionElements) {
|
|
76148
|
-
extensionElements = createElement$1(
|
|
76149
|
-
'bpmn:ExtensionElements',
|
|
76150
|
-
{
|
|
76151
|
-
values: []
|
|
76152
|
-
},
|
|
76153
|
-
businessObject,
|
|
76154
|
-
bpmnFactory
|
|
76155
|
-
);
|
|
76156
|
-
|
|
76157
|
-
modeling.updateProperties(shape, { extensionElements });
|
|
76158
|
-
}
|
|
76159
|
-
|
|
76160
|
-
calledElement = createElement$1(
|
|
76161
|
-
'zeebe:CalledElement',
|
|
76162
|
-
{
|
|
76163
|
-
propagateAllChildVariables: false
|
|
76164
|
-
},
|
|
76165
|
-
extensionElements,
|
|
76166
|
-
bpmnFactory
|
|
76167
|
-
);
|
|
76168
76073
|
|
|
76169
|
-
modeling.updateModdleProperties(shape, extensionElements, {
|
|
76170
|
-
values: [
|
|
76171
|
-
...(extensionElements.values || []),
|
|
76172
|
-
calledElement
|
|
76173
|
-
]
|
|
76174
|
-
});
|
|
76175
|
-
} else if (!has(calledElement, 'propagateAllChildVariables')) {
|
|
76176
76074
|
|
|
76177
|
-
|
|
76178
|
-
|
|
76179
|
-
|
|
76180
|
-
});
|
|
76181
|
-
}
|
|
76182
|
-
}, true);
|
|
76075
|
+
Ids$1.prototype.clear = function () {
|
|
76076
|
+
var hats = this._seed.hats,
|
|
76077
|
+
id;
|
|
76183
76078
|
|
|
76079
|
+
for (id in hats) {
|
|
76080
|
+
this.unclaim(id);
|
|
76184
76081
|
}
|
|
76185
|
-
}
|
|
76082
|
+
};
|
|
76186
76083
|
|
|
76187
|
-
|
|
76188
|
-
'bpmnFactory',
|
|
76189
|
-
'eventBus',
|
|
76190
|
-
'modeling'
|
|
76191
|
-
];
|
|
76084
|
+
const ids$2 = new Ids$1([ 32, 32, 1 ]);
|
|
76192
76085
|
|
|
76193
76086
|
/**
|
|
76194
|
-
*
|
|
76087
|
+
* Get ID with prefix.
|
|
76195
76088
|
*/
|
|
76196
|
-
function
|
|
76197
|
-
|
|
76198
|
-
|
|
76199
|
-
return ids.nextPrefixed(prefix);
|
|
76089
|
+
function getPrefixedId(prefix) {
|
|
76090
|
+
return ids$2.nextPrefixed(prefix);
|
|
76200
76091
|
}
|
|
76201
76092
|
|
|
76202
76093
|
const USER_TASK_FORM_PREFIX$1 = 'UserTaskForm_';
|
|
@@ -76212,7 +76103,7 @@
|
|
|
76212
76103
|
}
|
|
76213
76104
|
|
|
76214
76105
|
function createFormId() {
|
|
76215
|
-
return
|
|
76106
|
+
return getPrefixedId(USER_TASK_FORM_PREFIX$1);
|
|
76216
76107
|
}
|
|
76217
76108
|
|
|
76218
76109
|
function createFormKey(formId) {
|
|
@@ -76231,7 +76122,7 @@
|
|
|
76231
76122
|
function findUserTaskForm(formKey, rootElement) {
|
|
76232
76123
|
const userTaskForms = getExtensionElementsList$1(rootElement, 'zeebe:UserTaskForm');
|
|
76233
76124
|
|
|
76234
|
-
return find(userTaskForms, (userTaskForm) => {
|
|
76125
|
+
return find$1(userTaskForms, (userTaskForm) => {
|
|
76235
76126
|
const id = userTaskForm.get('zeebe:id');
|
|
76236
76127
|
|
|
76237
76128
|
return createFormKey(id) === formKey;
|
|
@@ -76390,7 +76281,7 @@
|
|
|
76390
76281
|
return parent;
|
|
76391
76282
|
}
|
|
76392
76283
|
|
|
76393
|
-
const HIGH_PRIORITY$
|
|
76284
|
+
const HIGH_PRIORITY$o = 5000;
|
|
76394
76285
|
|
|
76395
76286
|
|
|
76396
76287
|
/**
|
|
@@ -76401,7 +76292,7 @@
|
|
|
76401
76292
|
constructor(commandStack, eventBus) {
|
|
76402
76293
|
super(eventBus);
|
|
76403
76294
|
|
|
76404
|
-
this.postExecuted('element.updateModdleProperties' , HIGH_PRIORITY$
|
|
76295
|
+
this.postExecuted('element.updateModdleProperties' , HIGH_PRIORITY$o, function(context) {
|
|
76405
76296
|
const {
|
|
76406
76297
|
element,
|
|
76407
76298
|
moddleElement
|
|
@@ -76415,8 +76306,8 @@
|
|
|
76415
76306
|
|
|
76416
76307
|
if (
|
|
76417
76308
|
is$1(element, 'bpmn:UserTask')
|
|
76418
|
-
&& isUndefined(assignmentDefinition.get('zeebe:assignee'))
|
|
76419
|
-
&& isUndefined(assignmentDefinition.get('zeebe:candidateGroups'))
|
|
76309
|
+
&& isUndefined$3(assignmentDefinition.get('zeebe:assignee'))
|
|
76310
|
+
&& isUndefined$3(assignmentDefinition.get('zeebe:candidateGroups'))
|
|
76420
76311
|
) {
|
|
76421
76312
|
const businessObject = getBusinessObject(element);
|
|
76422
76313
|
|
|
@@ -76432,7 +76323,7 @@
|
|
|
76432
76323
|
'eventBus'
|
|
76433
76324
|
];
|
|
76434
76325
|
|
|
76435
|
-
const HIGH_PRIORITY$
|
|
76326
|
+
const HIGH_PRIORITY$p = 5000;
|
|
76436
76327
|
|
|
76437
76328
|
|
|
76438
76329
|
/**
|
|
@@ -76450,7 +76341,7 @@
|
|
|
76450
76341
|
* Remove zeebe:Output elements if zeebe:propagateAllChildVariables is set to true.
|
|
76451
76342
|
* Remove zeebe:IoMapping extension element if empty.
|
|
76452
76343
|
*/
|
|
76453
|
-
this.postExecute('element.updateModdleProperties' , HIGH_PRIORITY$
|
|
76344
|
+
this.postExecute('element.updateModdleProperties' , HIGH_PRIORITY$p, function(context) {
|
|
76454
76345
|
const {
|
|
76455
76346
|
element,
|
|
76456
76347
|
moddleElement,
|
|
@@ -76490,7 +76381,7 @@
|
|
|
76490
76381
|
* Set zeebe:propagateAllChildVariables of zeebe:CalledElement to false if
|
|
76491
76382
|
* zeebe:Output or zeebe:IoMapping with zeebe:Output is added.
|
|
76492
76383
|
*/
|
|
76493
|
-
this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY$
|
|
76384
|
+
this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY$p, function(context) {
|
|
76494
76385
|
const {
|
|
76495
76386
|
element,
|
|
76496
76387
|
moddleElement,
|
|
@@ -76547,29 +76438,21 @@
|
|
|
76547
76438
|
'modeling'
|
|
76548
76439
|
];
|
|
76549
76440
|
|
|
76550
|
-
var
|
|
76441
|
+
var behaviorsModule = {
|
|
76551
76442
|
__init__: [
|
|
76552
76443
|
'cleanUpBusinessRuleTaskBehavior',
|
|
76553
|
-
'createZeebeBoundaryEventBehavior',
|
|
76554
76444
|
'createZeebeCallActivityBehavior',
|
|
76555
76445
|
'formDefinitionBehavior',
|
|
76556
76446
|
'removeAssignmentDefinitionBehavior',
|
|
76557
76447
|
'updatePropagateAllChildVariablesBehavior'
|
|
76558
76448
|
],
|
|
76559
76449
|
cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
|
|
76560
|
-
createZeebeBoundaryEventBehavior: [ 'type', CreateZeebeBoundaryEventBehavior ],
|
|
76561
76450
|
createZeebeCallActivityBehavior: [ 'type', CreateZeebeCallActivityBehavior ],
|
|
76562
76451
|
formDefinitionBehavior: [ 'type', FormDefinitionBehavior ],
|
|
76563
76452
|
removeAssignmentDefinitionBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior$1 ],
|
|
76564
76453
|
updatePropagateAllChildVariablesBehavior: [ 'type', UpdatePropagateAllChildVariablesBehavior ]
|
|
76565
76454
|
};
|
|
76566
76455
|
|
|
76567
|
-
var modelingModule = {
|
|
76568
|
-
__depends__: [
|
|
76569
|
-
zeebeModelingBehaviors
|
|
76570
|
-
]
|
|
76571
|
-
};
|
|
76572
|
-
|
|
76573
76456
|
const PALETTE_OPTIONS = [
|
|
76574
76457
|
'hand-tool',
|
|
76575
76458
|
'lasso-tool',
|
|
@@ -76677,10 +76560,6 @@
|
|
|
76677
76560
|
zeebeContextPadProvider: [ 'type', ContextPadProvider$1 ],
|
|
76678
76561
|
};
|
|
76679
76562
|
|
|
76680
|
-
var drilldownModule = {
|
|
76681
|
-
drilldownOverlayBehavior: [ 'value', null ],
|
|
76682
|
-
};
|
|
76683
|
-
|
|
76684
76563
|
const REPLACE_OPTIONS = [
|
|
76685
76564
|
'replace-with-service-task',
|
|
76686
76565
|
'replace-with-script-task',
|
|
@@ -76790,124 +76669,656 @@
|
|
|
76790
76669
|
zeebeReplaceMenuProvider: [ 'type', ReplaceMenuProvider$1 ]
|
|
76791
76670
|
};
|
|
76792
76671
|
|
|
76793
|
-
const HIGH_PRIORITY$
|
|
76672
|
+
const HIGH_PRIORITY$q = 5000;
|
|
76673
|
+
|
|
76674
|
+
/**
|
|
76675
|
+
* Zeebe rule provider that allows to create boundary events with catch events
|
|
76676
|
+
*
|
|
76677
|
+
* See {@link CustomRules} for the default implementation
|
|
76678
|
+
* of BPMN 2.0 modeling rules provided by bpmn-js.
|
|
76679
|
+
*
|
|
76680
|
+
* @param {EventBus} eventBus
|
|
76681
|
+
*/
|
|
76682
|
+
class CustomRules extends BpmnRules {
|
|
76683
|
+
|
|
76684
|
+
constructor(eventBus) {
|
|
76685
|
+
super(eventBus);
|
|
76686
|
+
}
|
|
76687
|
+
|
|
76688
|
+
init() {
|
|
76689
|
+
super.init();
|
|
76690
|
+
this.addRule('shape.attach', HIGH_PRIORITY$q,(context) => {
|
|
76691
|
+
return this.canAttach(
|
|
76692
|
+
context.shape,
|
|
76693
|
+
context.target,
|
|
76694
|
+
null,
|
|
76695
|
+
context.position);
|
|
76696
|
+
});
|
|
76697
|
+
}
|
|
76698
|
+
|
|
76699
|
+
canAttach(elements, target, source, position) {
|
|
76700
|
+
function isBoundaryEvent(element) {
|
|
76701
|
+
return !isLabel(element) && is$1(element, 'bpmn:BoundaryEvent');
|
|
76702
|
+
}
|
|
76703
|
+
|
|
76704
|
+
/**
|
|
76705
|
+
* In Zeebe we treat IntermediateCatchEvents as boundary events too,
|
|
76706
|
+
* this must be reflected in the rules.
|
|
76707
|
+
*/
|
|
76708
|
+
function isBoundaryCandidate(element) {
|
|
76709
|
+
return isBoundaryEvent(element) || (
|
|
76710
|
+
(
|
|
76711
|
+
is$1(element, 'bpmn:IntermediateCatchEvent') ||
|
|
76712
|
+
is$1(element, 'bpmn:IntermediateThrowEvent')
|
|
76713
|
+
) && !element.parent
|
|
76714
|
+
);
|
|
76715
|
+
}
|
|
76716
|
+
|
|
76717
|
+
function isForCompensation(e) {
|
|
76718
|
+
return getBusinessObject(e).isForCompensation;
|
|
76719
|
+
}
|
|
76720
|
+
|
|
76721
|
+
function isReceiveTaskAfterEventBasedGateway(element) {
|
|
76722
|
+
return (
|
|
76723
|
+
is$1(element, 'bpmn:ReceiveTask') &&
|
|
76724
|
+
find(element.incoming, function(incoming) {
|
|
76725
|
+
return is$1(incoming.source, 'bpmn:EventBasedGateway');
|
|
76726
|
+
})
|
|
76727
|
+
);
|
|
76728
|
+
}
|
|
76729
|
+
|
|
76730
|
+
if (!Array.isArray(elements)) {
|
|
76731
|
+
elements = [ elements ];
|
|
76732
|
+
}
|
|
76733
|
+
|
|
76734
|
+
// disallow appending as boundary event
|
|
76735
|
+
if (source) {
|
|
76736
|
+
return false;
|
|
76737
|
+
}
|
|
76738
|
+
|
|
76739
|
+
// only (re-)attach one element at a time
|
|
76740
|
+
if (elements.length !== 1) {
|
|
76741
|
+
return false;
|
|
76742
|
+
}
|
|
76743
|
+
|
|
76744
|
+
const element = elements[0];
|
|
76745
|
+
|
|
76746
|
+
// do not attach labels
|
|
76747
|
+
if (isLabel(element)) {
|
|
76748
|
+
return false;
|
|
76749
|
+
}
|
|
76750
|
+
|
|
76751
|
+
// only handle boundary events
|
|
76752
|
+
if (!isBoundaryCandidate(element)) {
|
|
76753
|
+
return false;
|
|
76754
|
+
}
|
|
76755
|
+
|
|
76756
|
+
// allow default move operation
|
|
76757
|
+
if (!target) {
|
|
76758
|
+
return true;
|
|
76759
|
+
}
|
|
76760
|
+
|
|
76761
|
+
// disallow drop on event sub processes
|
|
76762
|
+
if (isEventSubProcess(target)) {
|
|
76763
|
+
return false;
|
|
76764
|
+
}
|
|
76765
|
+
|
|
76766
|
+
// only allow drop on non compensation activities
|
|
76767
|
+
if (!is$1(target, 'bpmn:Activity') || isForCompensation(target)) {
|
|
76768
|
+
return false;
|
|
76769
|
+
}
|
|
76770
|
+
|
|
76771
|
+
// only attach to subprocess border
|
|
76772
|
+
if (position && !getBoundaryAttachment(position, target)) {
|
|
76773
|
+
return false;
|
|
76774
|
+
}
|
|
76775
|
+
|
|
76776
|
+
// do not attach on receive tasks after event based gateways
|
|
76777
|
+
if (isReceiveTaskAfterEventBasedGateway(target)) {
|
|
76778
|
+
return false;
|
|
76779
|
+
}
|
|
76780
|
+
|
|
76781
|
+
return 'attach';
|
|
76782
|
+
}
|
|
76783
|
+
}
|
|
76784
|
+
|
|
76785
|
+
CustomRules.$inject = [ 'eventBus' ];
|
|
76786
|
+
|
|
76787
|
+
var rulesModule = {
|
|
76788
|
+
__init__: [ 'bpmnRules' ],
|
|
76789
|
+
bpmnRules: [ 'type', CustomRules ]
|
|
76790
|
+
};
|
|
76791
|
+
|
|
76792
|
+
var isFunction$2 = require$$0.isFunction,
|
|
76793
|
+
isObject$1 = require$$0.isObject,
|
|
76794
|
+
some$1 = require$$0.some;
|
|
76795
|
+
|
|
76796
|
+
var WILDCARD = '*';
|
|
76797
|
+
|
|
76798
|
+
const zeebeServiceTaskProperties = [ 'zeebe:TaskDefinition', 'zeebe:Subscription', 'zeebe:TaskHeaders','zeebe:LoopCharacteristics','zeebe:Input' ];
|
|
76799
|
+
|
|
76800
|
+
function ZeebeModdleExtension(eventBus) {
|
|
76801
|
+
|
|
76802
|
+
var self = this;
|
|
76803
|
+
|
|
76804
|
+
eventBus.on('moddleCopy.canCopyProperty', function(context) {
|
|
76805
|
+
var property = context.property,
|
|
76806
|
+
parent = context.parent;
|
|
76807
|
+
|
|
76808
|
+
return self.canCopyProperty(property, parent);
|
|
76809
|
+
});
|
|
76810
|
+
}
|
|
76811
|
+
|
|
76812
|
+
ZeebeModdleExtension.$inject = [ 'eventBus' ];
|
|
76813
|
+
|
|
76814
|
+
ZeebeModdleExtension.prototype.canCopyProperty = function(property, parent) {
|
|
76815
|
+
|
|
76816
|
+
// (1) check if property is allowed in parent
|
|
76817
|
+
if (isObject$1(property) && !isAllowedInParent(property, parent)) {
|
|
76818
|
+
return false;
|
|
76819
|
+
}
|
|
76820
|
+
|
|
76821
|
+
// (2) check for specific scenarios
|
|
76822
|
+
if (!this.canHostServiceTaskLikeProperties(property, parent)) {
|
|
76823
|
+
return false;
|
|
76824
|
+
}
|
|
76825
|
+
};
|
|
76826
|
+
|
|
76827
|
+
ZeebeModdleExtension.prototype.canHostServiceTaskLikeProperties = function(property, parent) {
|
|
76828
|
+
|
|
76829
|
+
if (isAllowedInZeebeServiceTask(property)) {
|
|
76830
|
+
|
|
76831
|
+
var serviceTaskLike = getParent$2(parent, 'bpmn:IntermediateThrowEvent') || getParent$2(parent, 'bpmn:EndEvent');
|
|
76832
|
+
|
|
76833
|
+
if (serviceTaskLike) {
|
|
76834
|
+
return isMessageEvent(serviceTaskLike);
|
|
76835
|
+
}
|
|
76836
|
+
}
|
|
76837
|
+
|
|
76838
|
+
return true;
|
|
76839
|
+
};
|
|
76840
|
+
|
|
76841
|
+
var extension = ZeebeModdleExtension;
|
|
76842
|
+
|
|
76843
|
+
// helpers //////////
|
|
76844
|
+
|
|
76845
|
+
function is$3(element, type) {
|
|
76846
|
+
return element && isFunction$2(element.$instanceOf) && element.$instanceOf(type);
|
|
76847
|
+
}
|
|
76848
|
+
|
|
76849
|
+
function getParent$2(element, type) {
|
|
76850
|
+
if (!type) {
|
|
76851
|
+
return element.$parent;
|
|
76852
|
+
}
|
|
76853
|
+
|
|
76854
|
+
if (is$3(element, type)) {
|
|
76855
|
+
return element;
|
|
76856
|
+
}
|
|
76857
|
+
|
|
76858
|
+
if (!element.$parent) {
|
|
76859
|
+
return;
|
|
76860
|
+
}
|
|
76861
|
+
|
|
76862
|
+
return getParent$2(element.$parent, type);
|
|
76863
|
+
}
|
|
76864
|
+
|
|
76865
|
+
function isAllowedInParent(property, parent) {
|
|
76866
|
+
|
|
76867
|
+
// (1) find property descriptor
|
|
76868
|
+
var descriptor = property.$type && property.$model.getTypeDescriptor(property.$type);
|
|
76869
|
+
|
|
76870
|
+
var allowedIn = descriptor && descriptor.meta && descriptor.meta.allowedIn;
|
|
76871
|
+
|
|
76872
|
+
if (!allowedIn || isWildcard(allowedIn)) {
|
|
76873
|
+
return true;
|
|
76874
|
+
}
|
|
76875
|
+
|
|
76876
|
+
// (2) check if property has parent of allowed type
|
|
76877
|
+
return some$1(allowedIn, function(type) {
|
|
76878
|
+
return getParent$2(parent, type);
|
|
76879
|
+
});
|
|
76880
|
+
}
|
|
76881
|
+
|
|
76882
|
+
function isWildcard(allowedIn) {
|
|
76883
|
+
return allowedIn.indexOf(WILDCARD) !== -1;
|
|
76884
|
+
}
|
|
76885
|
+
|
|
76886
|
+
function isMessageEvent(event) {
|
|
76887
|
+
const eventDefinitions = event.get('eventDefinitions');
|
|
76888
|
+
|
|
76889
|
+
return eventDefinitions.some(function(def) {
|
|
76890
|
+
return is$3(def, 'bpmn:MessageEventDefinition');
|
|
76891
|
+
});
|
|
76892
|
+
}
|
|
76893
|
+
|
|
76894
|
+
// check if property is allowed in ZeebeServiceTask but not for none events
|
|
76895
|
+
function isAllowedInZeebeServiceTask(property) {
|
|
76896
|
+
return zeebeServiceTaskProperties.some(function(propertyType) {
|
|
76897
|
+
return is$3(property, propertyType);
|
|
76898
|
+
});
|
|
76899
|
+
}
|
|
76900
|
+
|
|
76901
|
+
var lib = {
|
|
76902
|
+
__init__: [ 'zeebeModdleExtension' ],
|
|
76903
|
+
zeebeModdleExtension: [ 'type', extension ]
|
|
76904
|
+
};
|
|
76905
|
+
|
|
76906
|
+
var DEFAULT_RENDER_PRIORITY$2 = 1000;
|
|
76907
|
+
|
|
76908
|
+
/**
|
|
76909
|
+
* The base implementation of shape and connection renderers.
|
|
76910
|
+
*
|
|
76911
|
+
* @param {EventBus} eventBus
|
|
76912
|
+
* @param {number} [renderPriority=1000]
|
|
76913
|
+
*/
|
|
76914
|
+
function BaseRenderer$1(eventBus, renderPriority) {
|
|
76915
|
+
var self = this;
|
|
76916
|
+
|
|
76917
|
+
renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY$2;
|
|
76918
|
+
|
|
76919
|
+
eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {
|
|
76920
|
+
var type = evt.type,
|
|
76921
|
+
element = context.element,
|
|
76922
|
+
visuals = context.gfx,
|
|
76923
|
+
attrs = context.attrs;
|
|
76924
|
+
|
|
76925
|
+
if (self.canRender(element)) {
|
|
76926
|
+
if (type === 'render.shape') {
|
|
76927
|
+
return self.drawShape(visuals, element, attrs);
|
|
76928
|
+
} else {
|
|
76929
|
+
return self.drawConnection(visuals, element, attrs);
|
|
76930
|
+
}
|
|
76931
|
+
}
|
|
76932
|
+
});
|
|
76933
|
+
|
|
76934
|
+
eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {
|
|
76935
|
+
if (self.canRender(element)) {
|
|
76936
|
+
if (evt.type === 'render.getShapePath') {
|
|
76937
|
+
return self.getShapePath(element);
|
|
76938
|
+
} else {
|
|
76939
|
+
return self.getConnectionPath(element);
|
|
76940
|
+
}
|
|
76941
|
+
}
|
|
76942
|
+
});
|
|
76943
|
+
}
|
|
76944
|
+
|
|
76945
|
+
/**
|
|
76946
|
+
* Should check whether *this* renderer can render
|
|
76947
|
+
* the element/connection.
|
|
76948
|
+
*
|
|
76949
|
+
* @param {element} element
|
|
76950
|
+
*
|
|
76951
|
+
* @returns {boolean}
|
|
76952
|
+
*/
|
|
76953
|
+
BaseRenderer$1.prototype.canRender = function() {};
|
|
76954
|
+
|
|
76955
|
+
/**
|
|
76956
|
+
* Provides the shape's snap svg element to be drawn on the `canvas`.
|
|
76957
|
+
*
|
|
76958
|
+
* @param {djs.Graphics} visuals
|
|
76959
|
+
* @param {Shape} shape
|
|
76960
|
+
*
|
|
76961
|
+
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
76962
|
+
*/
|
|
76963
|
+
BaseRenderer$1.prototype.drawShape = function() {};
|
|
76964
|
+
|
|
76965
|
+
/**
|
|
76966
|
+
* Provides the shape's snap svg element to be drawn on the `canvas`.
|
|
76967
|
+
*
|
|
76968
|
+
* @param {djs.Graphics} visuals
|
|
76969
|
+
* @param {Connection} connection
|
|
76970
|
+
*
|
|
76971
|
+
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
76972
|
+
*/
|
|
76973
|
+
BaseRenderer$1.prototype.drawConnection = function() {};
|
|
76974
|
+
|
|
76975
|
+
/**
|
|
76976
|
+
* Gets the SVG path of a shape that represents it's visual bounds.
|
|
76977
|
+
*
|
|
76978
|
+
* @param {Shape} shape
|
|
76979
|
+
*
|
|
76980
|
+
* @return {string} svg path
|
|
76981
|
+
*/
|
|
76982
|
+
BaseRenderer$1.prototype.getShapePath = function() {};
|
|
76983
|
+
|
|
76984
|
+
/**
|
|
76985
|
+
* Gets the SVG path of a connection that represents it's visual bounds.
|
|
76986
|
+
*
|
|
76987
|
+
* @param {Connection} connection
|
|
76988
|
+
*
|
|
76989
|
+
* @return {string} svg path
|
|
76990
|
+
*/
|
|
76991
|
+
BaseRenderer$1.prototype.getConnectionPath = function() {};
|
|
76992
|
+
|
|
76993
|
+
function ensureImported$1(element, target) {
|
|
76994
|
+
|
|
76995
|
+
if (element.ownerDocument !== target.ownerDocument) {
|
|
76996
|
+
try {
|
|
76997
|
+
// may fail on webkit
|
|
76998
|
+
return target.ownerDocument.importNode(element, true);
|
|
76999
|
+
} catch (e) {
|
|
77000
|
+
// ignore
|
|
77001
|
+
}
|
|
77002
|
+
}
|
|
77003
|
+
|
|
77004
|
+
return element;
|
|
77005
|
+
}
|
|
77006
|
+
|
|
77007
|
+
/**
|
|
77008
|
+
* appendTo utility
|
|
77009
|
+
*/
|
|
77010
|
+
|
|
77011
|
+
/**
|
|
77012
|
+
* Append a node to a target element and return the appended node.
|
|
77013
|
+
*
|
|
77014
|
+
* @param {SVGElement} element
|
|
77015
|
+
* @param {SVGElement} target
|
|
77016
|
+
*
|
|
77017
|
+
* @return {SVGElement} the appended node
|
|
77018
|
+
*/
|
|
77019
|
+
function appendTo$1(element, target) {
|
|
77020
|
+
return target.appendChild(ensureImported$1(element, target));
|
|
77021
|
+
}
|
|
77022
|
+
|
|
77023
|
+
/**
|
|
77024
|
+
* append utility
|
|
77025
|
+
*/
|
|
77026
|
+
|
|
77027
|
+
/**
|
|
77028
|
+
* Append a node to an element
|
|
77029
|
+
*
|
|
77030
|
+
* @param {SVGElement} element
|
|
77031
|
+
* @param {SVGElement} node
|
|
77032
|
+
*
|
|
77033
|
+
* @return {SVGElement} the element
|
|
77034
|
+
*/
|
|
77035
|
+
function append$1(target, node) {
|
|
77036
|
+
appendTo$1(node, target);
|
|
77037
|
+
return target;
|
|
77038
|
+
}
|
|
77039
|
+
|
|
77040
|
+
/**
|
|
77041
|
+
* attribute accessor utility
|
|
77042
|
+
*/
|
|
77043
|
+
|
|
77044
|
+
var LENGTH_ATTR$1 = 2;
|
|
77045
|
+
|
|
77046
|
+
var CSS_PROPERTIES$1 = {
|
|
77047
|
+
'alignment-baseline': 1,
|
|
77048
|
+
'baseline-shift': 1,
|
|
77049
|
+
'clip': 1,
|
|
77050
|
+
'clip-path': 1,
|
|
77051
|
+
'clip-rule': 1,
|
|
77052
|
+
'color': 1,
|
|
77053
|
+
'color-interpolation': 1,
|
|
77054
|
+
'color-interpolation-filters': 1,
|
|
77055
|
+
'color-profile': 1,
|
|
77056
|
+
'color-rendering': 1,
|
|
77057
|
+
'cursor': 1,
|
|
77058
|
+
'direction': 1,
|
|
77059
|
+
'display': 1,
|
|
77060
|
+
'dominant-baseline': 1,
|
|
77061
|
+
'enable-background': 1,
|
|
77062
|
+
'fill': 1,
|
|
77063
|
+
'fill-opacity': 1,
|
|
77064
|
+
'fill-rule': 1,
|
|
77065
|
+
'filter': 1,
|
|
77066
|
+
'flood-color': 1,
|
|
77067
|
+
'flood-opacity': 1,
|
|
77068
|
+
'font': 1,
|
|
77069
|
+
'font-family': 1,
|
|
77070
|
+
'font-size': LENGTH_ATTR$1,
|
|
77071
|
+
'font-size-adjust': 1,
|
|
77072
|
+
'font-stretch': 1,
|
|
77073
|
+
'font-style': 1,
|
|
77074
|
+
'font-variant': 1,
|
|
77075
|
+
'font-weight': 1,
|
|
77076
|
+
'glyph-orientation-horizontal': 1,
|
|
77077
|
+
'glyph-orientation-vertical': 1,
|
|
77078
|
+
'image-rendering': 1,
|
|
77079
|
+
'kerning': 1,
|
|
77080
|
+
'letter-spacing': 1,
|
|
77081
|
+
'lighting-color': 1,
|
|
77082
|
+
'marker': 1,
|
|
77083
|
+
'marker-end': 1,
|
|
77084
|
+
'marker-mid': 1,
|
|
77085
|
+
'marker-start': 1,
|
|
77086
|
+
'mask': 1,
|
|
77087
|
+
'opacity': 1,
|
|
77088
|
+
'overflow': 1,
|
|
77089
|
+
'pointer-events': 1,
|
|
77090
|
+
'shape-rendering': 1,
|
|
77091
|
+
'stop-color': 1,
|
|
77092
|
+
'stop-opacity': 1,
|
|
77093
|
+
'stroke': 1,
|
|
77094
|
+
'stroke-dasharray': 1,
|
|
77095
|
+
'stroke-dashoffset': 1,
|
|
77096
|
+
'stroke-linecap': 1,
|
|
77097
|
+
'stroke-linejoin': 1,
|
|
77098
|
+
'stroke-miterlimit': 1,
|
|
77099
|
+
'stroke-opacity': 1,
|
|
77100
|
+
'stroke-width': LENGTH_ATTR$1,
|
|
77101
|
+
'text-anchor': 1,
|
|
77102
|
+
'text-decoration': 1,
|
|
77103
|
+
'text-rendering': 1,
|
|
77104
|
+
'unicode-bidi': 1,
|
|
77105
|
+
'visibility': 1,
|
|
77106
|
+
'word-spacing': 1,
|
|
77107
|
+
'writing-mode': 1
|
|
77108
|
+
};
|
|
77109
|
+
|
|
77110
|
+
|
|
77111
|
+
function getAttribute$1(node, name) {
|
|
77112
|
+
if (CSS_PROPERTIES$1[name]) {
|
|
77113
|
+
return node.style[name];
|
|
77114
|
+
} else {
|
|
77115
|
+
return node.getAttributeNS(null, name);
|
|
77116
|
+
}
|
|
77117
|
+
}
|
|
77118
|
+
|
|
77119
|
+
function setAttribute$1(node, name, value) {
|
|
77120
|
+
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
77121
|
+
|
|
77122
|
+
var type = CSS_PROPERTIES$1[hyphenated];
|
|
77123
|
+
|
|
77124
|
+
if (type) {
|
|
77125
|
+
// append pixel unit, unless present
|
|
77126
|
+
if (type === LENGTH_ATTR$1 && typeof value === 'number') {
|
|
77127
|
+
value = String(value) + 'px';
|
|
77128
|
+
}
|
|
77129
|
+
|
|
77130
|
+
node.style[hyphenated] = value;
|
|
77131
|
+
} else {
|
|
77132
|
+
node.setAttributeNS(null, name, value);
|
|
77133
|
+
}
|
|
77134
|
+
}
|
|
77135
|
+
|
|
77136
|
+
function setAttributes$1(node, attrs) {
|
|
77137
|
+
|
|
77138
|
+
var names = Object.keys(attrs), i, name;
|
|
77139
|
+
|
|
77140
|
+
for (i = 0, name; (name = names[i]); i++) {
|
|
77141
|
+
setAttribute$1(node, name, attrs[name]);
|
|
77142
|
+
}
|
|
77143
|
+
}
|
|
77144
|
+
|
|
77145
|
+
/**
|
|
77146
|
+
* Gets or sets raw attributes on a node.
|
|
77147
|
+
*
|
|
77148
|
+
* @param {SVGElement} node
|
|
77149
|
+
* @param {Object} [attrs]
|
|
77150
|
+
* @param {String} [name]
|
|
77151
|
+
* @param {String} [value]
|
|
77152
|
+
*
|
|
77153
|
+
* @return {String}
|
|
77154
|
+
*/
|
|
77155
|
+
function attr$2(node, name, value) {
|
|
77156
|
+
if (typeof name === 'string') {
|
|
77157
|
+
if (value !== undefined) {
|
|
77158
|
+
setAttribute$1(node, name, value);
|
|
77159
|
+
} else {
|
|
77160
|
+
return getAttribute$1(node, name);
|
|
77161
|
+
}
|
|
77162
|
+
} else {
|
|
77163
|
+
setAttributes$1(node, name);
|
|
77164
|
+
}
|
|
77165
|
+
|
|
77166
|
+
return node;
|
|
77167
|
+
}
|
|
77168
|
+
|
|
77169
|
+
var ns$1 = {
|
|
77170
|
+
svg: 'http://www.w3.org/2000/svg'
|
|
77171
|
+
};
|
|
77172
|
+
|
|
77173
|
+
/**
|
|
77174
|
+
* DOM parsing utility
|
|
77175
|
+
*/
|
|
77176
|
+
|
|
77177
|
+
var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
|
|
77178
|
+
|
|
77179
|
+
function parse$3(svg) {
|
|
77180
|
+
|
|
77181
|
+
var unwrap = false;
|
|
77182
|
+
|
|
77183
|
+
// ensure we import a valid svg document
|
|
77184
|
+
if (svg.substring(0, 4) === '<svg') {
|
|
77185
|
+
if (svg.indexOf(ns$1.svg) === -1) {
|
|
77186
|
+
svg = SVG_START$1 + svg.substring(4);
|
|
77187
|
+
}
|
|
77188
|
+
} else {
|
|
77189
|
+
// namespace svg
|
|
77190
|
+
svg = SVG_START$1 + '>' + svg + '</svg>';
|
|
77191
|
+
unwrap = true;
|
|
77192
|
+
}
|
|
77193
|
+
|
|
77194
|
+
var parsed = parseDocument$1(svg);
|
|
77195
|
+
|
|
77196
|
+
if (!unwrap) {
|
|
77197
|
+
return parsed;
|
|
77198
|
+
}
|
|
77199
|
+
|
|
77200
|
+
var fragment = document.createDocumentFragment();
|
|
77201
|
+
|
|
77202
|
+
var parent = parsed.firstChild;
|
|
77203
|
+
|
|
77204
|
+
while (parent.firstChild) {
|
|
77205
|
+
fragment.appendChild(parent.firstChild);
|
|
77206
|
+
}
|
|
77207
|
+
|
|
77208
|
+
return fragment;
|
|
77209
|
+
}
|
|
77210
|
+
|
|
77211
|
+
function parseDocument$1(svg) {
|
|
77212
|
+
|
|
77213
|
+
var parser;
|
|
77214
|
+
|
|
77215
|
+
// parse
|
|
77216
|
+
parser = new DOMParser();
|
|
77217
|
+
parser.async = false;
|
|
77218
|
+
|
|
77219
|
+
return parser.parseFromString(svg, 'text/xml');
|
|
77220
|
+
}
|
|
77221
|
+
|
|
77222
|
+
/**
|
|
77223
|
+
* Create utility for SVG elements
|
|
77224
|
+
*/
|
|
77225
|
+
|
|
77226
|
+
|
|
77227
|
+
/**
|
|
77228
|
+
* Create a specific type from name or SVG markup.
|
|
77229
|
+
*
|
|
77230
|
+
* @param {String} name the name or markup of the element
|
|
77231
|
+
* @param {Object} [attrs] attributes to set on the element
|
|
77232
|
+
*
|
|
77233
|
+
* @returns {SVGElement}
|
|
77234
|
+
*/
|
|
77235
|
+
function create$2(name, attrs) {
|
|
77236
|
+
var element;
|
|
77237
|
+
|
|
77238
|
+
if (name.charAt(0) === '<') {
|
|
77239
|
+
element = parse$3(name).firstChild;
|
|
77240
|
+
element = document.importNode(element, true);
|
|
77241
|
+
} else {
|
|
77242
|
+
element = document.createElementNS(ns$1.svg, name);
|
|
77243
|
+
}
|
|
77244
|
+
|
|
77245
|
+
if (attrs) {
|
|
77246
|
+
attr$2(element, attrs);
|
|
77247
|
+
}
|
|
77248
|
+
|
|
77249
|
+
return element;
|
|
77250
|
+
}
|
|
76794
77251
|
|
|
76795
77252
|
/**
|
|
76796
|
-
*
|
|
76797
|
-
*
|
|
76798
|
-
* See {@link CustomRules} for the default implementation
|
|
76799
|
-
* of BPMN 2.0 modeling rules provided by bpmn-js.
|
|
76800
|
-
*
|
|
76801
|
-
* @param {EventBus} eventBus
|
|
77253
|
+
* Geometry helpers
|
|
76802
77254
|
*/
|
|
76803
|
-
class CustomRules extends BpmnRules {
|
|
76804
77255
|
|
|
76805
|
-
|
|
76806
|
-
|
|
76807
|
-
}
|
|
77256
|
+
// fake node used to instantiate svg geometry elements
|
|
77257
|
+
create$2('svg');
|
|
76808
77258
|
|
|
76809
|
-
|
|
76810
|
-
|
|
76811
|
-
|
|
76812
|
-
|
|
76813
|
-
context.shape,
|
|
76814
|
-
context.target,
|
|
76815
|
-
null,
|
|
76816
|
-
context.position);
|
|
76817
|
-
});
|
|
76818
|
-
}
|
|
77259
|
+
function getModelerTemplateIcon(element) {
|
|
77260
|
+
var modelerTemplateIcon = getBusinessObject(element).get('zeebe:modelerTemplateIcon');
|
|
77261
|
+
return modelerTemplateIcon;
|
|
77262
|
+
}
|
|
76819
77263
|
|
|
76820
|
-
|
|
76821
|
-
function isBoundaryEvent(element) {
|
|
76822
|
-
return !isLabel(element) && is$1(element, 'bpmn:BoundaryEvent');
|
|
76823
|
-
}
|
|
77264
|
+
var HIGH_PRIORITY$r = 1250;
|
|
76824
77265
|
|
|
76825
|
-
/**
|
|
76826
|
-
* In Zeebe we treat IntermediateCatchEvents as boundary events too,
|
|
76827
|
-
* this must be reflected in the rules.
|
|
76828
|
-
*/
|
|
76829
|
-
function isBoundaryCandidate(element) {
|
|
76830
|
-
return isBoundaryEvent(element) || (
|
|
76831
|
-
(
|
|
76832
|
-
is$1(element, 'bpmn:IntermediateCatchEvent') ||
|
|
76833
|
-
is$1(element, 'bpmn:IntermediateThrowEvent')
|
|
76834
|
-
) && !element.parent
|
|
76835
|
-
);
|
|
76836
|
-
}
|
|
76837
77266
|
|
|
76838
|
-
|
|
76839
|
-
|
|
76840
|
-
|
|
77267
|
+
function IconsRenderer(
|
|
77268
|
+
bpmnRenderer,
|
|
77269
|
+
eventBus
|
|
77270
|
+
) {
|
|
77271
|
+
this._bpmnRenderer = bpmnRenderer;
|
|
76841
77272
|
|
|
76842
|
-
|
|
76843
|
-
|
|
76844
|
-
is$1(element, 'bpmn:ReceiveTask') &&
|
|
76845
|
-
find(element.incoming, function(incoming) {
|
|
76846
|
-
return is$1(incoming.source, 'bpmn:EventBasedGateway');
|
|
76847
|
-
})
|
|
76848
|
-
);
|
|
76849
|
-
}
|
|
77273
|
+
BaseRenderer$1.call(this, eventBus, HIGH_PRIORITY$r);
|
|
77274
|
+
}
|
|
76850
77275
|
|
|
76851
|
-
|
|
76852
|
-
elements = [ elements ];
|
|
76853
|
-
}
|
|
77276
|
+
inherits_browser(IconsRenderer, BaseRenderer$1);
|
|
76854
77277
|
|
|
76855
|
-
|
|
76856
|
-
if (source) {
|
|
76857
|
-
return false;
|
|
76858
|
-
}
|
|
77278
|
+
IconsRenderer.prototype.canRender = function(element) {
|
|
76859
77279
|
|
|
76860
|
-
|
|
76861
|
-
|
|
76862
|
-
|
|
76863
|
-
}
|
|
77280
|
+
if (isLabel(element)) {
|
|
77281
|
+
return false;
|
|
77282
|
+
}
|
|
76864
77283
|
|
|
76865
|
-
|
|
77284
|
+
return (
|
|
77285
|
+
is$1(element, 'bpmn:Task') &&
|
|
77286
|
+
!!getModelerTemplateIcon(element)
|
|
77287
|
+
);
|
|
77288
|
+
};
|
|
76866
77289
|
|
|
76867
|
-
|
|
76868
|
-
if (isLabel(element)) {
|
|
76869
|
-
return false;
|
|
76870
|
-
}
|
|
77290
|
+
IconsRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
76871
77291
|
|
|
76872
|
-
|
|
76873
|
-
if (!isBoundaryCandidate(element)) {
|
|
76874
|
-
return false;
|
|
76875
|
-
}
|
|
77292
|
+
var renderer = this._bpmnRenderer.handlers['bpmn:Task'];
|
|
76876
77293
|
|
|
76877
|
-
|
|
76878
|
-
if (!target) {
|
|
76879
|
-
return true;
|
|
76880
|
-
}
|
|
77294
|
+
var gfx = renderer(parentGfx, element);
|
|
76881
77295
|
|
|
76882
|
-
|
|
76883
|
-
if (isEventSubProcess(target)) {
|
|
76884
|
-
return false;
|
|
76885
|
-
}
|
|
77296
|
+
var modelerTemplateIcon = getModelerTemplateIcon(element);
|
|
76886
77297
|
|
|
76887
|
-
|
|
76888
|
-
|
|
76889
|
-
|
|
76890
|
-
|
|
77298
|
+
var icon = create$2('image');
|
|
77299
|
+
attr$2(icon, {
|
|
77300
|
+
href: modelerTemplateIcon,
|
|
77301
|
+
x: 4,
|
|
77302
|
+
y: 4
|
|
77303
|
+
});
|
|
76891
77304
|
|
|
76892
|
-
|
|
76893
|
-
if (position && !getBoundaryAttachment(position, target)) {
|
|
76894
|
-
return false;
|
|
76895
|
-
}
|
|
77305
|
+
append$1(parentGfx, icon);
|
|
76896
77306
|
|
|
76897
|
-
|
|
76898
|
-
|
|
76899
|
-
return false;
|
|
76900
|
-
}
|
|
77307
|
+
return gfx;
|
|
77308
|
+
};
|
|
76901
77309
|
|
|
76902
|
-
|
|
76903
|
-
|
|
76904
|
-
|
|
77310
|
+
IconsRenderer.$inject = [
|
|
77311
|
+
'bpmnRenderer',
|
|
77312
|
+
'eventBus'
|
|
77313
|
+
];
|
|
76905
77314
|
|
|
76906
|
-
|
|
77315
|
+
var iconRendererModule = {
|
|
77316
|
+
__init__: [ 'elementTemplatesIconsRenderer' ],
|
|
77317
|
+
elementTemplatesIconsRenderer: [ 'type', IconsRenderer ]
|
|
77318
|
+
};
|
|
76907
77319
|
|
|
76908
|
-
var
|
|
76909
|
-
|
|
76910
|
-
bpmnRules: [ 'type', CustomRules ]
|
|
77320
|
+
var drilldownModule = {
|
|
77321
|
+
drilldownOverlayBehavior: [ 'value', null ],
|
|
76911
77322
|
};
|
|
76912
77323
|
|
|
76913
77324
|
var name$7 = "zeebe";
|
|
@@ -77274,118 +77685,13 @@
|
|
|
77274
77685
|
types: types$6
|
|
77275
77686
|
};
|
|
77276
77687
|
|
|
77277
|
-
|
|
77278
|
-
|
|
77279
|
-
|
|
77280
|
-
|
|
77281
|
-
var WILDCARD = '*';
|
|
77282
|
-
|
|
77283
|
-
const zeebeServiceTaskProperties = [ 'zeebe:TaskDefinition', 'zeebe:Subscription', 'zeebe:TaskHeaders','zeebe:LoopCharacteristics','zeebe:Input' ];
|
|
77284
|
-
|
|
77285
|
-
function ZeebeModdleExtension(eventBus) {
|
|
77286
|
-
|
|
77287
|
-
var self = this;
|
|
77288
|
-
|
|
77289
|
-
eventBus.on('moddleCopy.canCopyProperty', function(context) {
|
|
77290
|
-
var property = context.property,
|
|
77291
|
-
parent = context.parent;
|
|
77292
|
-
|
|
77293
|
-
return self.canCopyProperty(property, parent);
|
|
77294
|
-
});
|
|
77295
|
-
}
|
|
77296
|
-
|
|
77297
|
-
ZeebeModdleExtension.$inject = [ 'eventBus' ];
|
|
77298
|
-
|
|
77299
|
-
ZeebeModdleExtension.prototype.canCopyProperty = function(property, parent) {
|
|
77300
|
-
|
|
77301
|
-
// (1) check if property is allowed in parent
|
|
77302
|
-
if (isObject$1(property) && !isAllowedInParent(property, parent)) {
|
|
77303
|
-
return false;
|
|
77304
|
-
}
|
|
77305
|
-
|
|
77306
|
-
// (2) check for specific scenarios
|
|
77307
|
-
if (!this.canHostServiceTaskLikeProperties(property, parent)) {
|
|
77308
|
-
return false;
|
|
77309
|
-
}
|
|
77310
|
-
};
|
|
77311
|
-
|
|
77312
|
-
ZeebeModdleExtension.prototype.canHostServiceTaskLikeProperties = function(property, parent) {
|
|
77313
|
-
|
|
77314
|
-
if (isAllowedInZeebeServiceTask(property)) {
|
|
77315
|
-
|
|
77316
|
-
var serviceTaskLike = getParent$2(parent, 'bpmn:IntermediateThrowEvent') || getParent$2(parent, 'bpmn:EndEvent');
|
|
77317
|
-
|
|
77318
|
-
if (serviceTaskLike) {
|
|
77319
|
-
return isMessageEvent(serviceTaskLike);
|
|
77320
|
-
}
|
|
77321
|
-
}
|
|
77322
|
-
|
|
77323
|
-
return true;
|
|
77324
|
-
};
|
|
77325
|
-
|
|
77326
|
-
var extension = ZeebeModdleExtension;
|
|
77327
|
-
|
|
77328
|
-
// helpers //////////
|
|
77329
|
-
|
|
77330
|
-
function is$3(element, type) {
|
|
77331
|
-
return element && isFunction$1(element.$instanceOf) && element.$instanceOf(type);
|
|
77332
|
-
}
|
|
77333
|
-
|
|
77334
|
-
function getParent$2(element, type) {
|
|
77335
|
-
if (!type) {
|
|
77336
|
-
return element.$parent;
|
|
77337
|
-
}
|
|
77338
|
-
|
|
77339
|
-
if (is$3(element, type)) {
|
|
77340
|
-
return element;
|
|
77341
|
-
}
|
|
77342
|
-
|
|
77343
|
-
if (!element.$parent) {
|
|
77344
|
-
return;
|
|
77345
|
-
}
|
|
77346
|
-
|
|
77347
|
-
return getParent$2(element.$parent, type);
|
|
77348
|
-
}
|
|
77349
|
-
|
|
77350
|
-
function isAllowedInParent(property, parent) {
|
|
77351
|
-
|
|
77352
|
-
// (1) find property descriptor
|
|
77353
|
-
var descriptor = property.$type && property.$model.getTypeDescriptor(property.$type);
|
|
77354
|
-
|
|
77355
|
-
var allowedIn = descriptor && descriptor.meta && descriptor.meta.allowedIn;
|
|
77356
|
-
|
|
77357
|
-
if (!allowedIn || isWildcard(allowedIn)) {
|
|
77358
|
-
return true;
|
|
77359
|
-
}
|
|
77360
|
-
|
|
77361
|
-
// (2) check if property has parent of allowed type
|
|
77362
|
-
return some$1(allowedIn, function(type) {
|
|
77363
|
-
return getParent$2(parent, type);
|
|
77364
|
-
});
|
|
77365
|
-
}
|
|
77366
|
-
|
|
77367
|
-
function isWildcard(allowedIn) {
|
|
77368
|
-
return allowedIn.indexOf(WILDCARD) !== -1;
|
|
77369
|
-
}
|
|
77370
|
-
|
|
77371
|
-
function isMessageEvent(event) {
|
|
77372
|
-
const eventDefinitions = event.get('eventDefinitions');
|
|
77373
|
-
|
|
77374
|
-
return eventDefinitions.some(function(def) {
|
|
77375
|
-
return is$3(def, 'bpmn:MessageEventDefinition');
|
|
77376
|
-
});
|
|
77377
|
-
}
|
|
77378
|
-
|
|
77379
|
-
// check if property is allowed in ZeebeServiceTask but not for none events
|
|
77380
|
-
function isAllowedInZeebeServiceTask(property) {
|
|
77381
|
-
return zeebeServiceTaskProperties.some(function(propertyType) {
|
|
77382
|
-
return is$3(property, propertyType);
|
|
77383
|
-
});
|
|
77384
|
-
}
|
|
77688
|
+
const commonModules = [
|
|
77689
|
+
drilldownModule,
|
|
77690
|
+
iconRendererModule
|
|
77691
|
+
];
|
|
77385
77692
|
|
|
77386
|
-
|
|
77387
|
-
|
|
77388
|
-
zeebeModdleExtension: [ 'type', extension ]
|
|
77693
|
+
const commonModdleExtensions = {
|
|
77694
|
+
zeebe: zeebeModdle
|
|
77389
77695
|
};
|
|
77390
77696
|
|
|
77391
77697
|
/**
|
|
@@ -77397,7 +77703,7 @@
|
|
|
77397
77703
|
options = {
|
|
77398
77704
|
...options,
|
|
77399
77705
|
moddleExtensions: {
|
|
77400
|
-
|
|
77706
|
+
...commonModdleExtensions,
|
|
77401
77707
|
...options.moddleExtensions
|
|
77402
77708
|
},
|
|
77403
77709
|
propertiesPanel: {
|
|
@@ -77412,17 +77718,16 @@
|
|
|
77412
77718
|
inherits_browser(Modeler$2, Modeler$1);
|
|
77413
77719
|
|
|
77414
77720
|
Modeler$2.prototype._camundaCloudModules = [
|
|
77415
|
-
|
|
77721
|
+
...commonModules,
|
|
77722
|
+
behaviorsModule,
|
|
77416
77723
|
contextPadModule,
|
|
77417
77724
|
DisabledCollapsedSubprocessPopupProviderModule,
|
|
77418
|
-
drilldownModule,
|
|
77419
77725
|
paletteModule,
|
|
77420
77726
|
popupMenuModule,
|
|
77421
77727
|
rulesModule,
|
|
77422
77728
|
zeebePropertiesProviderModule,
|
|
77423
77729
|
index$1$1,
|
|
77424
|
-
lib
|
|
77425
|
-
iconRendererModule
|
|
77730
|
+
lib
|
|
77426
77731
|
];
|
|
77427
77732
|
|
|
77428
77733
|
Modeler$2.prototype._modules = [].concat(
|