camunda-bpmn-js 0.11.5 → 0.12.0
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 +7 -0
- package/dist/assets/properties-panel.css +780 -0
- package/dist/camunda-cloud-modeler.development.js +546 -505
- package/dist/camunda-cloud-modeler.production.min.js +3 -3
- package/dist/camunda-platform-modeler.development.js +178 -270
- package/dist/camunda-platform-modeler.production.min.js +1 -1
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +112 -0
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +51 -55
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +56 -59
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +69 -127
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +76 -128
- package/lib/camunda-cloud/features/modeling/behavior/index.js +3 -0
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +21 -7
- package/lib/camunda-cloud/features/rules/BpmnRules.js +1 -1
- package/lib/camunda-cloud/helper/CalledElementHelper.js +43 -41
- package/lib/camunda-cloud/helper/FormsHelper.js +38 -50
- package/lib/camunda-cloud/helper/InputOutputHelper.js +92 -106
- package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +24 -47
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +39 -81
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +31 -65
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +42 -76
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +21 -26
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +16 -10
- package/lib/camunda-platform/helper/InputOutputHelper.js +29 -0
- package/package.json +2 -2
|
@@ -72069,78 +72069,183 @@
|
|
|
72069
72069
|
Modeler$1.prototype._extensionModules
|
|
72070
72070
|
);
|
|
72071
72071
|
|
|
72072
|
-
const HIGH_PRIORITY$l =
|
|
72072
|
+
const HIGH_PRIORITY$l = 5000;
|
|
72073
|
+
|
|
72073
72074
|
|
|
72074
72075
|
/**
|
|
72075
|
-
* BPMN
|
|
72076
|
+
* Zeebe BPMN behavior for ensuring that a BusinessRuleTask:
|
|
72077
|
+
* 1) Either has a taskDefinition ExtensionElement OR
|
|
72078
|
+
* 2) Or has a calledDecision ExtensionElement
|
|
72079
|
+
* 2.1) If it has a calledDecision ExtensionElement, it shall not have taskHeaders
|
|
72076
72080
|
*/
|
|
72077
|
-
|
|
72078
|
-
|
|
72081
|
+
class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
|
|
72082
|
+
constructor(eventBus, modeling) {
|
|
72083
|
+
super(eventBus);
|
|
72079
72084
|
|
|
72080
|
-
|
|
72085
|
+
/**
|
|
72086
|
+
* Remove zeebe:calledDecision when zeebe:taskDefinition is added
|
|
72087
|
+
*/
|
|
72088
|
+
this.postExecute([
|
|
72089
|
+
'properties-panel.update-businessobject-list',
|
|
72090
|
+
'element.updateModdleProperties'
|
|
72091
|
+
] , HIGH_PRIORITY$l, function(context) {
|
|
72092
|
+
const {
|
|
72093
|
+
element,
|
|
72094
|
+
currentObject,
|
|
72095
|
+
objectsToAdd,
|
|
72096
|
+
moddleElement,
|
|
72097
|
+
properties
|
|
72098
|
+
} = context;
|
|
72081
72099
|
|
|
72082
|
-
|
|
72083
|
-
|
|
72084
|
-
|
|
72085
|
-
*/
|
|
72086
|
-
this.preExecute('shape.create', HIGH_PRIORITY$l, function(context) {
|
|
72087
|
-
const {
|
|
72088
|
-
shape,
|
|
72089
|
-
host
|
|
72090
|
-
} = context;
|
|
72100
|
+
// (1) map properties from both commands
|
|
72101
|
+
const extensionElement = currentObject || moddleElement,
|
|
72102
|
+
newValues = objectsToAdd || (properties && properties.values);
|
|
72091
72103
|
|
|
72092
|
-
|
|
72104
|
+
// (2) check conditions and potentially update
|
|
72105
|
+
if (
|
|
72106
|
+
is$1(element, 'bpmn:BusinessRuleTask')
|
|
72107
|
+
&& extensionElement
|
|
72108
|
+
&& is$1(extensionElement, 'bpmn:ExtensionElements')
|
|
72109
|
+
&& extensionElement.get('values').some((ele) => is$1(ele, 'zeebe:CalledDecision'))
|
|
72110
|
+
&& newValues
|
|
72111
|
+
&& newValues.some((ele) => is$1(ele, 'zeebe:TaskDefinition'))
|
|
72112
|
+
) {
|
|
72113
|
+
removeCalledDecision(element, extensionElement, modeling);
|
|
72114
|
+
}
|
|
72115
|
+
}, true);
|
|
72093
72116
|
|
|
72094
|
-
|
|
72095
|
-
|
|
72096
|
-
|
|
72117
|
+
/**
|
|
72118
|
+
* Remove zeebe:taskDefinition and zeebe:taskHeaders when zeebe:calledDecision
|
|
72119
|
+
*/
|
|
72120
|
+
this.postExecute([
|
|
72121
|
+
'properties-panel.update-businessobject-list',
|
|
72122
|
+
'element.updateModdleProperties'
|
|
72123
|
+
] , HIGH_PRIORITY$l, function(context) {
|
|
72124
|
+
const {
|
|
72125
|
+
element,
|
|
72126
|
+
currentObject,
|
|
72127
|
+
objectsToAdd,
|
|
72128
|
+
moddleElement,
|
|
72129
|
+
properties
|
|
72130
|
+
} = context;
|
|
72097
72131
|
|
|
72098
|
-
|
|
72099
|
-
|
|
72100
|
-
|
|
72101
|
-
eventDefinitions;
|
|
72132
|
+
// (1) map properties from both commands
|
|
72133
|
+
const extensionElement = currentObject || moddleElement,
|
|
72134
|
+
newValues = objectsToAdd || (properties && properties.values);
|
|
72102
72135
|
|
|
72103
|
-
|
|
72104
|
-
|
|
72105
|
-
|
|
72136
|
+
// (2) check conditions and potentially update
|
|
72137
|
+
if (
|
|
72138
|
+
is$1(element, 'bpmn:BusinessRuleTask')
|
|
72139
|
+
&& extensionElement
|
|
72140
|
+
&& is$1(extensionElement, 'bpmn:ExtensionElements')
|
|
72141
|
+
&& extensionElement.get('values').some(
|
|
72142
|
+
(ele) => is$1(ele, 'zeebe:TaskDefinition') || is$1(ele, 'zeebe:TaskHeaders'))
|
|
72143
|
+
&& newValues
|
|
72144
|
+
&& newValues.some((ele) => is$1(ele, 'zeebe:CalledDecision'))
|
|
72145
|
+
) {
|
|
72146
|
+
removeTaskDefintionAndHeaders(element, extensionElement, modeling);
|
|
72147
|
+
}
|
|
72148
|
+
}, true);
|
|
72106
72149
|
|
|
72107
|
-
|
|
72150
|
+
}
|
|
72151
|
+
}
|
|
72108
72152
|
|
|
72109
|
-
|
|
72110
|
-
|
|
72111
|
-
|
|
72112
|
-
|
|
72153
|
+
CleanUpBusinessRuleTaskBehavior.$inject = [
|
|
72154
|
+
'eventBus',
|
|
72155
|
+
'modeling'
|
|
72156
|
+
];
|
|
72113
72157
|
|
|
72114
|
-
eventDefinitions = businessObject.eventDefinitions;
|
|
72115
72158
|
|
|
72116
|
-
|
|
72159
|
+
// helper ////////////////////
|
|
72117
72160
|
|
|
72118
|
-
|
|
72119
|
-
|
|
72120
|
-
|
|
72121
|
-
|
|
72161
|
+
function removeFromExtensionElements(element, extensionElements, modeling, filterFun) {
|
|
72162
|
+
const values = extensionElements.get('values').filter(filterFun);
|
|
72163
|
+
|
|
72164
|
+
modeling.updateModdleProperties(element, extensionElements, {
|
|
72165
|
+
values
|
|
72166
|
+
});
|
|
72167
|
+
}
|
|
72168
|
+
|
|
72169
|
+
function removeCalledDecision(element, extensionElements, modeling) {
|
|
72170
|
+
removeFromExtensionElements(element, extensionElements, modeling,
|
|
72171
|
+
(ele) => !is$1(ele, 'zeebe:CalledDecision'));
|
|
72172
|
+
}
|
|
72173
|
+
|
|
72174
|
+
function removeTaskDefintionAndHeaders(element, extensionElements, modeling) {
|
|
72175
|
+
removeFromExtensionElements(element, extensionElements, modeling,
|
|
72176
|
+
(ele) => !is$1(ele, 'zeebe:TaskDefinition') && !is$1(ele, 'zeebe:TaskHeaders'));
|
|
72177
|
+
}
|
|
72178
|
+
|
|
72179
|
+
const HIGH_PRIORITY$m = 5000;
|
|
72180
|
+
|
|
72181
|
+
|
|
72182
|
+
/**
|
|
72183
|
+
* Zeebe BPMN specific behavior for creating boundary events.
|
|
72184
|
+
*/
|
|
72185
|
+
class CreateZeebeBoundaryEventBehavior extends CommandInterceptor {
|
|
72186
|
+
constructor(bpmnFactory, elementFactory, eventBus) {
|
|
72187
|
+
super(eventBus);
|
|
72188
|
+
|
|
72189
|
+
/**
|
|
72190
|
+
* Replace intermediate catch event with boundary event when attaching it to a shape.
|
|
72191
|
+
*/
|
|
72192
|
+
this.preExecute('shape.create', HIGH_PRIORITY$m, function(context) {
|
|
72193
|
+
const {
|
|
72194
|
+
shape,
|
|
72195
|
+
host
|
|
72196
|
+
} = context;
|
|
72197
|
+
|
|
72198
|
+
const businessObject = getBusinessObject(shape);
|
|
72199
|
+
|
|
72200
|
+
let attrs = {
|
|
72201
|
+
cancelActivity: true
|
|
72202
|
+
};
|
|
72203
|
+
|
|
72204
|
+
let newBusinessObject,
|
|
72205
|
+
hostBusinessObject,
|
|
72206
|
+
boundaryEvent,
|
|
72207
|
+
eventDefinitions;
|
|
72208
|
+
|
|
72209
|
+
if (!host || !is$1(shape, 'bpmn:IntermediateCatchEvent')) {
|
|
72210
|
+
return;
|
|
72211
|
+
}
|
|
72212
|
+
|
|
72213
|
+
hostBusinessObject = getBusinessObject(host);
|
|
72214
|
+
|
|
72215
|
+
attrs = {
|
|
72216
|
+
...attrs,
|
|
72217
|
+
attachedToRef: hostBusinessObject
|
|
72218
|
+
};
|
|
72219
|
+
|
|
72220
|
+
eventDefinitions = businessObject.eventDefinitions;
|
|
72221
|
+
|
|
72222
|
+
newBusinessObject = bpmnFactory.create('bpmn:BoundaryEvent', attrs);
|
|
72122
72223
|
|
|
72123
|
-
if (eventDefinitions && eventDefinitions[0]) {
|
|
72124
72224
|
boundaryEvent = {
|
|
72125
|
-
|
|
72126
|
-
|
|
72225
|
+
type: 'bpmn:BoundaryEvent',
|
|
72226
|
+
businessObject: newBusinessObject,
|
|
72127
72227
|
};
|
|
72128
|
-
}
|
|
72129
72228
|
|
|
72130
|
-
|
|
72229
|
+
if (eventDefinitions && eventDefinitions[0]) {
|
|
72230
|
+
boundaryEvent = {
|
|
72231
|
+
...boundaryEvent,
|
|
72232
|
+
eventDefinitionType: eventDefinitions[0].$type
|
|
72233
|
+
};
|
|
72234
|
+
}
|
|
72235
|
+
|
|
72236
|
+
context.shape = elementFactory.createShape(boundaryEvent);
|
|
72131
72237
|
|
|
72132
|
-
|
|
72133
|
-
}
|
|
72238
|
+
}, true);
|
|
72134
72239
|
|
|
72240
|
+
}
|
|
72241
|
+
}
|
|
72135
72242
|
|
|
72136
72243
|
CreateZeebeBoundaryEventBehavior.$inject = [
|
|
72137
|
-
'
|
|
72244
|
+
'bpmnFactory',
|
|
72138
72245
|
'elementFactory',
|
|
72139
|
-
'
|
|
72246
|
+
'eventBus'
|
|
72140
72247
|
];
|
|
72141
72248
|
|
|
72142
|
-
inherits_browser(CreateZeebeBoundaryEventBehavior, CommandInterceptor);
|
|
72143
|
-
|
|
72144
72249
|
function isZeebeServiceTask(element) {
|
|
72145
72250
|
if (!is$1(element, 'zeebe:ZeebeServiceTask')) return false;
|
|
72146
72251
|
|
|
@@ -72151,6 +72256,113 @@
|
|
|
72151
72256
|
return true;
|
|
72152
72257
|
}
|
|
72153
72258
|
|
|
72259
|
+
/**
|
|
72260
|
+
* Get zeebe:IoMapping from an element.
|
|
72261
|
+
*
|
|
72262
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72263
|
+
*
|
|
72264
|
+
* @return {ModdleElement}
|
|
72265
|
+
*/
|
|
72266
|
+
function getIoMapping(element) {
|
|
72267
|
+
const businessObject = getBusinessObject(element);
|
|
72268
|
+
|
|
72269
|
+
const extensionElements = businessObject.get('extensionElements');
|
|
72270
|
+
|
|
72271
|
+
if (!extensionElements) {
|
|
72272
|
+
return;
|
|
72273
|
+
}
|
|
72274
|
+
|
|
72275
|
+
return extensionElements.get('values').find((value) => {
|
|
72276
|
+
return is$1(value, 'zeebe:IoMapping');
|
|
72277
|
+
});
|
|
72278
|
+
}
|
|
72279
|
+
|
|
72280
|
+
/**
|
|
72281
|
+
* Get zeebe:InputParameters from an element.
|
|
72282
|
+
*
|
|
72283
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72284
|
+
*
|
|
72285
|
+
* @return {Array<ModdleElement>}
|
|
72286
|
+
*/
|
|
72287
|
+
function getInputParameters(element) {
|
|
72288
|
+
const ioMapping = getIoMapping(element);
|
|
72289
|
+
|
|
72290
|
+
if (ioMapping) {
|
|
72291
|
+
return ioMapping.get('zeebe:inputParameters');
|
|
72292
|
+
}
|
|
72293
|
+
|
|
72294
|
+
return [];
|
|
72295
|
+
}
|
|
72296
|
+
|
|
72297
|
+
/**
|
|
72298
|
+
* Get zeebe:OutputParameters from an element.
|
|
72299
|
+
*
|
|
72300
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72301
|
+
*
|
|
72302
|
+
* @return {Array<ModdleElement>}
|
|
72303
|
+
*/
|
|
72304
|
+
function getOutputParameters(element) {
|
|
72305
|
+
const ioMapping = getIoMapping(element);
|
|
72306
|
+
|
|
72307
|
+
if (ioMapping) {
|
|
72308
|
+
return ioMapping.get('zeebe:outputParameters');
|
|
72309
|
+
}
|
|
72310
|
+
|
|
72311
|
+
return [];
|
|
72312
|
+
}
|
|
72313
|
+
|
|
72314
|
+
/**
|
|
72315
|
+
* Check whether element supports zeebe:Input or zeebe:Output.
|
|
72316
|
+
*
|
|
72317
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72318
|
+
*
|
|
72319
|
+
* @return {boolean}
|
|
72320
|
+
*/
|
|
72321
|
+
function isInputOutputSupported(element) {
|
|
72322
|
+
return areInputParametersSupported(element) || areOutputParametersSupported(element);
|
|
72323
|
+
}
|
|
72324
|
+
|
|
72325
|
+
/**
|
|
72326
|
+
* Check whether element supports zeebe:Input.
|
|
72327
|
+
*
|
|
72328
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72329
|
+
*
|
|
72330
|
+
* @return {boolean}
|
|
72331
|
+
*/
|
|
72332
|
+
function areInputParametersSupported(element) {
|
|
72333
|
+
return isAny(element, [
|
|
72334
|
+
'bpmn:CallActivity',
|
|
72335
|
+
'bpmn:SubProcess',
|
|
72336
|
+
'bpmn:UserTask'
|
|
72337
|
+
]) || isZeebeServiceTask(element);
|
|
72338
|
+
}
|
|
72339
|
+
|
|
72340
|
+
/**
|
|
72341
|
+
* Check whether element supports zeebe:Output.
|
|
72342
|
+
*
|
|
72343
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72344
|
+
*
|
|
72345
|
+
* @return {boolean}
|
|
72346
|
+
*/
|
|
72347
|
+
function areOutputParametersSupported(element) {
|
|
72348
|
+
return isAny(element, [
|
|
72349
|
+
'bpmn:CallActivity',
|
|
72350
|
+
'bpmn:Event',
|
|
72351
|
+
'bpmn:ReceiveTask',
|
|
72352
|
+
'bpmn:SubProcess',
|
|
72353
|
+
'bpmn:UserTask',
|
|
72354
|
+
'zeebe:ZeebeServiceTask'
|
|
72355
|
+
]);
|
|
72356
|
+
}
|
|
72357
|
+
|
|
72358
|
+
function createElement(type, parent, factory, properties) {
|
|
72359
|
+
return ElementHelper_1.createElement(type, properties, parent, factory);
|
|
72360
|
+
}
|
|
72361
|
+
|
|
72362
|
+
function createIoMapping(parent, bpmnFactory, properties) {
|
|
72363
|
+
return createElement('zeebe:IoMapping', parent, bpmnFactory, properties);
|
|
72364
|
+
}
|
|
72365
|
+
|
|
72154
72366
|
var is$g = require$$0.is;
|
|
72155
72367
|
|
|
72156
72368
|
var ExtensionElementsHelper = {};
|
|
@@ -72201,406 +72413,223 @@
|
|
|
72201
72413
|
|
|
72202
72414
|
var ExtensionElementsHelper_1 = ExtensionElementsHelper;
|
|
72203
72415
|
|
|
72204
|
-
function getElements(bo, type, prop) {
|
|
72205
|
-
const elems = ExtensionElementsHelper_1.getExtensionElements(bo, type);
|
|
72206
|
-
return !prop ? elems : (elems[0] || {})[prop] || [];
|
|
72207
|
-
}
|
|
72208
|
-
|
|
72209
|
-
function getParameters(element, prop) {
|
|
72210
|
-
const inputOutput = getInputOutput(element);
|
|
72211
|
-
return (inputOutput && inputOutput.get(prop)) || [];
|
|
72212
|
-
}
|
|
72213
|
-
|
|
72214
72416
|
/**
|
|
72215
|
-
|
|
72216
|
-
*
|
|
72217
|
-
* @param {djs.model.Base} element
|
|
72218
|
-
*
|
|
72219
|
-
* @return {ModdleElement} the inputOutput object
|
|
72220
|
-
*/
|
|
72221
|
-
function getInputOutput(element) {
|
|
72222
|
-
const bo = getBusinessObject(element);
|
|
72223
|
-
return (getElements(bo, 'zeebe:IoMapping') || [])[0];
|
|
72224
|
-
}
|
|
72225
|
-
|
|
72226
|
-
|
|
72227
|
-
/**
|
|
72228
|
-
* Return all input parameters existing in the business object, and
|
|
72229
|
-
* an empty array if none exist.
|
|
72230
|
-
*
|
|
72231
|
-
* @param {djs.model.Base} element
|
|
72232
|
-
*
|
|
72233
|
-
* @return {Array} a list of input parameter objects
|
|
72234
|
-
*/
|
|
72235
|
-
function getInputParameters(element) {
|
|
72236
|
-
return getParameters.apply(this, [ element, 'inputParameters' ]);
|
|
72237
|
-
}
|
|
72238
|
-
|
|
72239
|
-
/**
|
|
72240
|
-
* Return all output parameters existing in the business object, and
|
|
72241
|
-
* an empty array if none exist.
|
|
72242
|
-
*
|
|
72243
|
-
* @param {djs.model.Base} element
|
|
72244
|
-
*
|
|
72245
|
-
* @return {Array} a list of output parameter objects
|
|
72246
|
-
*/
|
|
72247
|
-
function getOutputParameters(element) {
|
|
72248
|
-
return getParameters.apply(this, [ element, 'outputParameters' ]);
|
|
72249
|
-
}
|
|
72250
|
-
|
|
72251
|
-
/**
|
|
72252
|
-
* Returns 'true' if the given element supports inputOutput
|
|
72253
|
-
*
|
|
72254
|
-
* @param {djs.model.Base} element
|
|
72255
|
-
*
|
|
72256
|
-
* @return {boolean} a boolean value
|
|
72257
|
-
*/
|
|
72258
|
-
function isInputOutputSupported(element) {
|
|
72259
|
-
return areOutputParametersSupported(element) || areInputParametersSupported(element);
|
|
72260
|
-
}
|
|
72261
|
-
|
|
72262
|
-
/**
|
|
72263
|
-
* Returns 'true' if the given element supports input parameters
|
|
72264
|
-
*
|
|
72265
|
-
* @param {djs.model.Base} element
|
|
72266
|
-
*
|
|
72267
|
-
* @return {boolean} a boolean value
|
|
72268
|
-
*/
|
|
72269
|
-
function areInputParametersSupported(element) {
|
|
72270
|
-
return isAny(element, [
|
|
72271
|
-
'bpmn:UserTask',
|
|
72272
|
-
'bpmn:SubProcess',
|
|
72273
|
-
'bpmn:CallActivity'
|
|
72274
|
-
]) || isZeebeServiceTask(element);
|
|
72275
|
-
}
|
|
72276
|
-
|
|
72277
|
-
/**
|
|
72278
|
-
* Returns 'true' if the given element supports output parameters
|
|
72279
|
-
*
|
|
72280
|
-
* @param {djs.model.Base} element
|
|
72281
|
-
*
|
|
72282
|
-
* @return {boolean} a boolean value
|
|
72283
|
-
*/
|
|
72284
|
-
function areOutputParametersSupported(element) {
|
|
72285
|
-
return isAny(element, [
|
|
72286
|
-
'zeebe:ZeebeServiceTask',
|
|
72287
|
-
'bpmn:UserTask',
|
|
72288
|
-
'bpmn:SubProcess',
|
|
72289
|
-
'bpmn:ReceiveTask',
|
|
72290
|
-
'bpmn:CallActivity',
|
|
72291
|
-
'bpmn:Event'
|
|
72292
|
-
]);
|
|
72293
|
-
}
|
|
72294
|
-
|
|
72295
|
-
function createElement(type, parent, factory, properties) {
|
|
72296
|
-
return ElementHelper_1.createElement(type, properties, parent, factory);
|
|
72297
|
-
}
|
|
72298
|
-
|
|
72299
|
-
function createIOMapping(parent, bpmnFactory, properties) {
|
|
72300
|
-
return createElement('zeebe:IoMapping', parent, bpmnFactory, properties);
|
|
72301
|
-
}
|
|
72302
|
-
|
|
72303
|
-
/**
|
|
72304
|
-
* Get getter function for IOMapping parameters according to provided property name
|
|
72417
|
+
* Get default value for zeebe:propagateAllChildVariables.
|
|
72305
72418
|
*
|
|
72306
|
-
* @param {
|
|
72419
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72307
72420
|
*
|
|
72308
|
-
* @returns {
|
|
72421
|
+
* @returns {boolean}
|
|
72309
72422
|
*/
|
|
72310
|
-
function
|
|
72311
|
-
if (
|
|
72312
|
-
return
|
|
72313
|
-
}
|
|
72314
|
-
|
|
72315
|
-
if (property == 'outputParameters') {
|
|
72316
|
-
return getOutputParameters;
|
|
72423
|
+
function getPropagateAllChildVariablesDefault(element) {
|
|
72424
|
+
if (!is$1(element, 'bpmn:CallActivity')) {
|
|
72425
|
+
return;
|
|
72317
72426
|
}
|
|
72318
|
-
}
|
|
72319
72427
|
|
|
72320
|
-
/**
|
|
72321
|
-
* Determine default value for propagateAllChildVariables attribute
|
|
72322
|
-
* @param {Object} element representing a bpmn:CallActivity
|
|
72323
|
-
*
|
|
72324
|
-
* @returns {boolean}
|
|
72325
|
-
*/
|
|
72326
|
-
function determinePropAllChildVariablesDefault(element) {
|
|
72327
72428
|
const outputParameters = getOutputParameters(element);
|
|
72328
72429
|
|
|
72329
72430
|
if (outputParameters) {
|
|
72330
|
-
return
|
|
72431
|
+
return !outputParameters.length;
|
|
72331
72432
|
}
|
|
72332
72433
|
}
|
|
72333
72434
|
|
|
72334
72435
|
/**
|
|
72335
|
-
|
|
72336
|
-
|
|
72337
|
-
|
|
72338
|
-
|
|
72339
|
-
|
|
72436
|
+
* Get zeebe:CalledElement of an element.
|
|
72437
|
+
*
|
|
72438
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72439
|
+
*
|
|
72440
|
+
* @returns {ModdleElement}
|
|
72441
|
+
*/
|
|
72340
72442
|
function getCalledElement(element) {
|
|
72341
72443
|
const calledElements = getCalledElements(element);
|
|
72342
|
-
|
|
72444
|
+
|
|
72445
|
+
return calledElements[ 0 ];
|
|
72343
72446
|
}
|
|
72344
72447
|
|
|
72345
72448
|
function getCalledElements(element) {
|
|
72346
|
-
const
|
|
72347
|
-
|
|
72348
|
-
return
|
|
72449
|
+
const businessObject = getBusinessObject(element);
|
|
72450
|
+
|
|
72451
|
+
return ExtensionElementsHelper_1.getExtensionElements(businessObject, 'zeebe:CalledElement');
|
|
72349
72452
|
}
|
|
72350
72453
|
|
|
72351
72454
|
/**
|
|
72352
|
-
|
|
72353
|
-
|
|
72354
|
-
|
|
72355
|
-
|
|
72356
|
-
|
|
72357
|
-
|
|
72455
|
+
* Check whether zeebe:propagateAllChildVariables is set on an element.
|
|
72456
|
+
* Fall back to default if zeebe:propagateAllChildVariables not set.
|
|
72457
|
+
*
|
|
72458
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72459
|
+
*
|
|
72460
|
+
* @returns {boolean}
|
|
72461
|
+
*/
|
|
72358
72462
|
function isPropagateAllChildVariables(element) {
|
|
72359
72463
|
if (!is$1(element, 'bpmn:CallActivity')) {
|
|
72360
|
-
return
|
|
72464
|
+
return;
|
|
72361
72465
|
}
|
|
72362
72466
|
|
|
72363
|
-
const
|
|
72364
|
-
calledElement = getCalledElement(
|
|
72467
|
+
const businessObject = getBusinessObject(element),
|
|
72468
|
+
calledElement = getCalledElement(businessObject);
|
|
72365
72469
|
|
|
72366
|
-
|
|
72367
|
-
calledElement.get('propagateAllChildVariables')
|
|
72368
|
-
|
|
72470
|
+
if (calledElement && has(calledElement, 'propagateAllChildVariables')) {
|
|
72471
|
+
return calledElement.get('propagateAllChildVariables');
|
|
72472
|
+
} else {
|
|
72473
|
+
return getPropagateAllChildVariablesDefault(element);
|
|
72474
|
+
}
|
|
72369
72475
|
}
|
|
72370
72476
|
|
|
72371
|
-
const HIGH_PRIORITY$
|
|
72477
|
+
const HIGH_PRIORITY$n = 5000;
|
|
72478
|
+
|
|
72372
72479
|
|
|
72373
72480
|
/**
|
|
72374
|
-
* BPMN specific
|
|
72481
|
+
* Zeebe BPMN specific behavior for creating call activities.
|
|
72375
72482
|
*/
|
|
72376
|
-
|
|
72377
|
-
|
|
72483
|
+
class CreateZeebeCallActivityBehavior extends CommandInterceptor {
|
|
72484
|
+
constructor(bpmnFactory, eventBus, modeling) {
|
|
72485
|
+
super(eventBus);
|
|
72378
72486
|
|
|
72379
|
-
|
|
72487
|
+
/**
|
|
72488
|
+
* Add zeebe:CalledElement extension element with zeebe:propagateAllChildVariables attribute = false
|
|
72489
|
+
* when creating bpmn:CallActivity.
|
|
72490
|
+
*/
|
|
72491
|
+
this.postExecuted('shape.create', HIGH_PRIORITY$n, function(context) {
|
|
72492
|
+
const { shape } = context;
|
|
72380
72493
|
|
|
72381
|
-
|
|
72382
|
-
|
|
72383
|
-
|
|
72384
|
-
* a bpmn:callActivity
|
|
72385
|
-
*/
|
|
72386
|
-
this.postExecuted('shape.create', HIGH_PRIORITY$m, function(context) {
|
|
72387
|
-
const {
|
|
72388
|
-
shape
|
|
72389
|
-
} = context;
|
|
72494
|
+
if (!is$1(shape, 'bpmn:CallActivity')) {
|
|
72495
|
+
return;
|
|
72496
|
+
}
|
|
72390
72497
|
|
|
72391
|
-
|
|
72392
|
-
return;
|
|
72393
|
-
}
|
|
72498
|
+
const businessObject = getBusinessObject(shape);
|
|
72394
72499
|
|
|
72395
|
-
|
|
72500
|
+
let calledElement = getCalledElement(businessObject);
|
|
72396
72501
|
|
|
72397
|
-
|
|
72398
|
-
|
|
72399
|
-
|
|
72502
|
+
if (!calledElement) {
|
|
72503
|
+
calledElement = bpmnFactory.create('zeebe:CalledElement', {
|
|
72504
|
+
propagateAllChildVariables: false
|
|
72505
|
+
});
|
|
72400
72506
|
|
|
72401
|
-
|
|
72402
|
-
let calledElement = getCalledElement(bo);
|
|
72507
|
+
let extensionElements = businessObject.get('extensionElements');
|
|
72403
72508
|
|
|
72404
|
-
|
|
72405
|
-
|
|
72406
|
-
calledElement.propagateAllChildVariables = false;
|
|
72509
|
+
if (!extensionElements) {
|
|
72510
|
+
extensionElements = ElementHelper_1.createElement('bpmn:ExtensionElements', { values: [] }, businessObject, bpmnFactory);
|
|
72407
72511
|
|
|
72408
|
-
|
|
72409
|
-
|
|
72410
|
-
);
|
|
72512
|
+
modeling.updateProperties(shape, { extensionElements });
|
|
72513
|
+
}
|
|
72411
72514
|
|
|
72412
|
-
|
|
72515
|
+
modeling.updateModdleProperties(shape, extensionElements, {
|
|
72516
|
+
values: [
|
|
72517
|
+
...(extensionElements.values || []),
|
|
72518
|
+
calledElement
|
|
72519
|
+
]
|
|
72520
|
+
});
|
|
72521
|
+
} else if (!has(calledElement, 'propagateAllChildVariables')) {
|
|
72413
72522
|
|
|
72414
|
-
|
|
72415
|
-
|
|
72416
|
-
|
|
72417
|
-
|
|
72523
|
+
// if zeebe:CalledElement exist set zeebe:propagateAllChildVariables to false
|
|
72524
|
+
modeling.updateModdleProperties(shape, calledElement, {
|
|
72525
|
+
propagateAllChildVariables: false
|
|
72526
|
+
});
|
|
72527
|
+
}
|
|
72528
|
+
}, true);
|
|
72418
72529
|
|
|
72419
|
-
}
|
|
72530
|
+
}
|
|
72420
72531
|
}
|
|
72421
72532
|
|
|
72422
|
-
|
|
72423
72533
|
CreateZeebeCallActivityBehavior.$inject = [
|
|
72534
|
+
'bpmnFactory',
|
|
72424
72535
|
'eventBus',
|
|
72425
|
-
'
|
|
72536
|
+
'modeling'
|
|
72426
72537
|
];
|
|
72427
72538
|
|
|
72428
|
-
|
|
72429
|
-
|
|
72430
|
-
const HIGH_PRIORITY$n = 15000;
|
|
72539
|
+
const HIGH_PRIORITY$o = 5000;
|
|
72431
72540
|
|
|
72432
72541
|
|
|
72433
72542
|
/**
|
|
72434
|
-
*
|
|
72435
|
-
* when there are outputParameters present or (2) to adding outputParameters when
|
|
72436
|
-
* propagateAllChildVariables is set to true.
|
|
72437
|
-
* It will ensure that the propagateAllChildVariables attribute on calledElement
|
|
72438
|
-
* extensionElements for callActivities is always consistent with outputParameter mappings
|
|
72543
|
+
* Zeebe BPMN behavior for updating zeebe:propagateAllChildVariables.
|
|
72439
72544
|
*/
|
|
72440
|
-
|
|
72441
|
-
|
|
72442
|
-
|
|
72443
|
-
CommandInterceptor.call(this, eventBus);
|
|
72444
|
-
|
|
72445
|
-
// Behavior when toggling propagateAllChildVariables /////////////////////////
|
|
72446
|
-
/**
|
|
72447
|
-
* remove outputParameters from zeebe:IoMapping when setting propgateAlLChildVariables
|
|
72448
|
-
* to true in the proeprties panel
|
|
72449
|
-
*/
|
|
72450
|
-
this.executed('properties-panel.update-businessobject' , HIGH_PRIORITY$n, function(context) {
|
|
72451
|
-
const {
|
|
72452
|
-
element,
|
|
72453
|
-
properties
|
|
72454
|
-
} = context;
|
|
72455
|
-
|
|
72456
|
-
// (1) Don't execute this behavior if we are not in a call activity or not
|
|
72457
|
-
// have properties to update or not update the propagateAllChildVariables
|
|
72458
|
-
// to false
|
|
72459
|
-
if (!is$1(element, 'bpmn:CallActivity') ||
|
|
72460
|
-
!properties ||
|
|
72461
|
-
!!properties.propagateAllChildVariables === false) {
|
|
72462
|
-
return;
|
|
72463
|
-
}
|
|
72464
|
-
|
|
72465
|
-
// (2) Check whether we have outputParameters
|
|
72466
|
-
const outputParameters = getOutputParameters(element),
|
|
72467
|
-
inputParameters = getInputParameters(element);
|
|
72468
|
-
|
|
72469
|
-
if (!outputParameters ||
|
|
72470
|
-
outputParameters.length === 0) {
|
|
72471
|
-
return;
|
|
72472
|
-
}
|
|
72473
|
-
|
|
72474
|
-
// (3) Store old outputParameters and remove them
|
|
72475
|
-
context.oldOutputParameters = outputParameters;
|
|
72476
|
-
|
|
72477
|
-
const inputOutput = getInputOutput(element);
|
|
72478
|
-
inputOutput.outputParameters = [];
|
|
72479
|
-
|
|
72480
|
-
// (4) if we also have no inputParameters, store IOMapping and remove it
|
|
72481
|
-
if (!inputParameters || inputParameters.length === 0) {
|
|
72482
|
-
const extensionElements = getBusinessObject(element).extensionElements;
|
|
72483
|
-
context.oldExtensionElements = extensionElements.values;
|
|
72484
|
-
|
|
72485
|
-
extensionElements.values = extensionElements.values.filter(ele => ele.$type !== 'zeebe:IoMapping');
|
|
72486
|
-
}
|
|
72487
|
-
}, true);
|
|
72488
|
-
|
|
72489
|
-
// Revert behavior when toggling propagateAllChildVariables //////////////////
|
|
72490
|
-
this.reverted('properties-panel.update-businessobject', HIGH_PRIORITY$n, function(context) {
|
|
72491
|
-
const {
|
|
72492
|
-
element,
|
|
72493
|
-
oldOutputParameters,
|
|
72494
|
-
oldExtensionElements
|
|
72495
|
-
} = context;
|
|
72496
|
-
|
|
72497
|
-
// (1) Only intercept the revert, if the behavior became active
|
|
72498
|
-
if (oldOutputParameters) {
|
|
72545
|
+
class UpdatePropagateAllChildVariablesBehavior extends CommandInterceptor {
|
|
72546
|
+
constructor(eventBus, modeling) {
|
|
72547
|
+
super(eventBus);
|
|
72499
72548
|
|
|
72500
|
-
|
|
72501
|
-
|
|
72502
|
-
|
|
72549
|
+
/**
|
|
72550
|
+
* Remove zeebe:OutputParameters when zeebe:propagateAllChildVariables is set to true.
|
|
72551
|
+
*/
|
|
72552
|
+
this.postExecute('properties-panel.update-businessobject' , HIGH_PRIORITY$o, function(context) {
|
|
72553
|
+
const {
|
|
72554
|
+
element,
|
|
72555
|
+
properties
|
|
72556
|
+
} = context;
|
|
72503
72557
|
|
|
72504
|
-
|
|
72558
|
+
if (
|
|
72559
|
+
!is$1(element, 'bpmn:CallActivity')
|
|
72560
|
+
|| !properties
|
|
72561
|
+
|| !!properties.propagateAllChildVariables === false
|
|
72562
|
+
) {
|
|
72563
|
+
return;
|
|
72505
72564
|
}
|
|
72506
72565
|
|
|
72507
|
-
|
|
72508
|
-
|
|
72509
|
-
inputOutput.outputParameters = oldOutputParameters;
|
|
72510
|
-
}
|
|
72511
|
-
}, true);
|
|
72512
|
-
|
|
72566
|
+
const inputParameters = getInputParameters(element),
|
|
72567
|
+
outputParameters = getOutputParameters(element);
|
|
72513
72568
|
|
|
72514
|
-
|
|
72515
|
-
|
|
72516
|
-
|
|
72517
|
-
*/
|
|
72518
|
-
this.executed('properties-panel.update-businessobject-list' , HIGH_PRIORITY$n, function(context) {
|
|
72519
|
-
const {
|
|
72520
|
-
element,
|
|
72521
|
-
objectsToAdd
|
|
72522
|
-
} = context;
|
|
72569
|
+
if (!outputParameters || !outputParameters.length) {
|
|
72570
|
+
return;
|
|
72571
|
+
}
|
|
72523
72572
|
|
|
72573
|
+
const ioMapping = getIoMapping(element);
|
|
72524
72574
|
|
|
72525
|
-
|
|
72526
|
-
|
|
72527
|
-
|
|
72528
|
-
!objectsToAdd ||
|
|
72529
|
-
objectsToAdd.length === 0 ||
|
|
72530
|
-
objectsToAdd.filter(obj => is$1(obj, 'zeebe:Output')).length === 0 ||
|
|
72531
|
-
isPropagateAllChildVariables(element) === false) {
|
|
72532
|
-
return;
|
|
72533
|
-
}
|
|
72575
|
+
modeling.updateModdleProperties(element, ioMapping, {
|
|
72576
|
+
'zeebe:outputParameters': []
|
|
72577
|
+
});
|
|
72534
72578
|
|
|
72535
|
-
|
|
72536
|
-
|
|
72537
|
-
|
|
72579
|
+
if (!inputParameters || !inputParameters.length) {
|
|
72580
|
+
const businessObject = getBusinessObject(element),
|
|
72581
|
+
extensionElements = businessObject.get('extensionElements');
|
|
72538
72582
|
|
|
72539
|
-
|
|
72583
|
+
const values = extensionElements.get('values').filter((element) => {
|
|
72584
|
+
return !is$1(element, 'zeebe:IoMapping');
|
|
72585
|
+
});
|
|
72540
72586
|
|
|
72541
|
-
|
|
72542
|
-
|
|
72587
|
+
modeling.updateModdleProperties(element, extensionElements, {
|
|
72588
|
+
values
|
|
72589
|
+
});
|
|
72590
|
+
}
|
|
72591
|
+
}, true);
|
|
72543
72592
|
|
|
72544
|
-
// Revert behavior when adding outputParmaeters ////////////////////////////////////
|
|
72545
|
-
this.reverted('properties-panel.update-businessobject-list' , HIGH_PRIORITY$n, function(context) {
|
|
72546
|
-
const {
|
|
72547
|
-
element,
|
|
72548
|
-
oldPropagateAllChildVariables
|
|
72549
|
-
} = context;
|
|
72550
72593
|
|
|
72551
|
-
|
|
72552
|
-
|
|
72553
|
-
|
|
72554
|
-
|
|
72594
|
+
/**
|
|
72595
|
+
* Set zeebe:propagateAllChildVariables to false on zeebe:Output added.
|
|
72596
|
+
*/
|
|
72597
|
+
this.postExecute('properties-panel.update-businessobject-list' , HIGH_PRIORITY$o, function(context) {
|
|
72598
|
+
const {
|
|
72599
|
+
currentObject,
|
|
72600
|
+
element,
|
|
72601
|
+
objectsToAdd,
|
|
72602
|
+
propertyName
|
|
72603
|
+
} = context;
|
|
72604
|
+
|
|
72605
|
+
if (!is$1(element, 'bpmn:CallActivity')
|
|
72606
|
+
|| !is$1(currentObject, 'zeebe:IoMapping')
|
|
72607
|
+
|| (propertyName !== 'outputParameters' && propertyName !== 'zeebe:outputParameters')
|
|
72608
|
+
|| !objectsToAdd
|
|
72609
|
+
|| !objectsToAdd.length
|
|
72610
|
+
|| !objectsToAdd.find((object) => is$1(object, 'zeebe:Output'))
|
|
72611
|
+
|| !isPropagateAllChildVariables(element)) {
|
|
72612
|
+
return;
|
|
72613
|
+
}
|
|
72555
72614
|
|
|
72556
|
-
|
|
72557
|
-
|
|
72558
|
-
}, true);
|
|
72615
|
+
const businessObject = getBusinessObject(element),
|
|
72616
|
+
calledElement = getCalledElement(businessObject);
|
|
72559
72617
|
|
|
72618
|
+
modeling.updateModdleProperties(element, calledElement, {
|
|
72619
|
+
'zeebe:propagateAllChildVariables': false
|
|
72620
|
+
});
|
|
72621
|
+
}, true);
|
|
72560
72622
|
|
|
72623
|
+
}
|
|
72561
72624
|
}
|
|
72562
72625
|
|
|
72563
|
-
|
|
72564
72626
|
UpdatePropagateAllChildVariablesBehavior.$inject = [
|
|
72565
|
-
'eventBus'
|
|
72627
|
+
'eventBus',
|
|
72628
|
+
'modeling'
|
|
72566
72629
|
];
|
|
72567
72630
|
|
|
72631
|
+
const USER_TASK_FORM_PREFIX = 'UserTaskForm_';
|
|
72568
72632
|
|
|
72569
|
-
inherits_browser(UpdatePropagateAllChildVariablesBehavior, CommandInterceptor);
|
|
72570
|
-
|
|
72571
|
-
const USER_TASK_FORM_PREFIX = 'userTaskForm_';
|
|
72572
|
-
|
|
72573
|
-
|
|
72574
|
-
function getUserTaskForm(element, parent) {
|
|
72575
|
-
|
|
72576
|
-
const rootElement = parent || getRootElement$1(element);
|
|
72577
|
-
|
|
72578
|
-
// (1) get form definition from user task
|
|
72579
|
-
const formDefinition = getFormDefinition(element);
|
|
72580
|
-
|
|
72581
|
-
if (!formDefinition) {
|
|
72582
|
-
return;
|
|
72583
|
-
}
|
|
72584
|
-
|
|
72585
|
-
const formKey = formDefinition.get('formKey');
|
|
72586
|
-
|
|
72587
|
-
// (2) retrieve user task form via form key
|
|
72588
|
-
const userTaskForm = findUserTaskForm(formKey, rootElement);
|
|
72589
|
-
|
|
72590
|
-
return userTaskForm;
|
|
72591
|
-
}
|
|
72592
|
-
|
|
72593
|
-
function getFormDefinition(element) {
|
|
72594
|
-
const businessObject = getBusinessObject(element);
|
|
72595
|
-
|
|
72596
|
-
const formDefinitions = ExtensionElementsHelper_1.getExtensionElements(businessObject, 'zeebe:FormDefinition');
|
|
72597
|
-
|
|
72598
|
-
return formDefinitions[0];
|
|
72599
|
-
}
|
|
72600
|
-
|
|
72601
|
-
function createFormKey(formId) {
|
|
72602
|
-
return 'camunda-forms:bpmn:' + formId;
|
|
72603
|
-
}
|
|
72604
72633
|
|
|
72605
72634
|
function createFormDefinition(properties, extensionElements, bpmnFactory) {
|
|
72606
72635
|
return ElementHelper_1.createElement(
|
|
@@ -72611,6 +72640,14 @@
|
|
|
72611
72640
|
);
|
|
72612
72641
|
}
|
|
72613
72642
|
|
|
72643
|
+
function createFormId() {
|
|
72644
|
+
return nextId_1(USER_TASK_FORM_PREFIX);
|
|
72645
|
+
}
|
|
72646
|
+
|
|
72647
|
+
function createFormKey(formId) {
|
|
72648
|
+
return `camunda-forms:bpmn:${ formId }`;
|
|
72649
|
+
}
|
|
72650
|
+
|
|
72614
72651
|
function createUserTaskForm(properties, extensionElements, bpmnFactory) {
|
|
72615
72652
|
return ElementHelper_1.createElement(
|
|
72616
72653
|
'zeebe:UserTaskForm',
|
|
@@ -72620,19 +72657,22 @@
|
|
|
72620
72657
|
);
|
|
72621
72658
|
}
|
|
72622
72659
|
|
|
72623
|
-
function
|
|
72624
|
-
|
|
72625
|
-
}
|
|
72660
|
+
function findUserTaskForm(formKey, rootElement) {
|
|
72661
|
+
const userTaskForms = ExtensionElementsHelper_1.getExtensionElements(rootElement, 'zeebe:UserTaskForm');
|
|
72626
72662
|
|
|
72663
|
+
return find(userTaskForms, function(userTaskForm) {
|
|
72664
|
+
const id = userTaskForm.get('zeebe:id');
|
|
72627
72665
|
|
|
72628
|
-
|
|
72666
|
+
return createFormKey(id) === formKey;
|
|
72667
|
+
});
|
|
72668
|
+
}
|
|
72629
72669
|
|
|
72630
|
-
function
|
|
72631
|
-
const
|
|
72670
|
+
function getFormDefinition(element) {
|
|
72671
|
+
const businessObject = getBusinessObject(element);
|
|
72632
72672
|
|
|
72633
|
-
|
|
72634
|
-
|
|
72635
|
-
|
|
72673
|
+
const formDefinitions = ExtensionElementsHelper_1.getExtensionElements(businessObject, 'zeebe:FormDefinition');
|
|
72674
|
+
|
|
72675
|
+
return formDefinitions[ 0 ];
|
|
72636
72676
|
}
|
|
72637
72677
|
|
|
72638
72678
|
function getRootElement$1(element) {
|
|
@@ -72646,162 +72686,125 @@
|
|
|
72646
72686
|
return parent;
|
|
72647
72687
|
}
|
|
72648
72688
|
|
|
72649
|
-
|
|
72650
|
-
|
|
72651
|
-
*/
|
|
72652
|
-
function FormDefinitionBehavior(
|
|
72653
|
-
eventBus, bpmnFactory) {
|
|
72654
|
-
|
|
72655
|
-
CommandInterceptor.call(this, eventBus);
|
|
72656
|
-
|
|
72657
|
-
/**
|
|
72658
|
-
* ensures a zeebe:userTaskForm is cleaned up when user task got removed
|
|
72659
|
-
*/
|
|
72660
|
-
this.executed('shape.delete', function(context) {
|
|
72661
|
-
const {
|
|
72662
|
-
shape,
|
|
72663
|
-
oldParent
|
|
72664
|
-
} = context;
|
|
72689
|
+
function getUserTaskForm(element, parent) {
|
|
72690
|
+
const rootElement = parent || getRootElement$1(element);
|
|
72665
72691
|
|
|
72666
|
-
|
|
72692
|
+
const formDefinition = getFormDefinition(element);
|
|
72667
72693
|
|
|
72668
|
-
|
|
72694
|
+
if (!formDefinition) {
|
|
72695
|
+
return;
|
|
72696
|
+
}
|
|
72669
72697
|
|
|
72670
|
-
|
|
72698
|
+
const formKey = formDefinition.get('zeebe:formKey');
|
|
72671
72699
|
|
|
72672
|
-
|
|
72673
|
-
|
|
72674
|
-
}
|
|
72700
|
+
return findUserTaskForm(formKey, rootElement);
|
|
72701
|
+
}
|
|
72675
72702
|
|
|
72676
|
-
|
|
72703
|
+
/**
|
|
72704
|
+
* Zeebe BPMN specific form definition behavior.
|
|
72705
|
+
*/
|
|
72706
|
+
class FormDefinitionBehavior extends CommandInterceptor {
|
|
72707
|
+
constructor(bpmnFactory, eventBus, modeling) {
|
|
72708
|
+
super(eventBus);
|
|
72677
72709
|
|
|
72678
|
-
|
|
72679
|
-
|
|
72710
|
+
/**
|
|
72711
|
+
* Remove zeebe:UserTaskForm on user task removed.
|
|
72712
|
+
*/
|
|
72713
|
+
this.postExecute('shape.delete', function(context) {
|
|
72714
|
+
const {
|
|
72715
|
+
oldParent,
|
|
72716
|
+
shape
|
|
72717
|
+
} = context;
|
|
72680
72718
|
|
|
72681
|
-
|
|
72682
|
-
const {
|
|
72683
|
-
removedUserTaskForm,
|
|
72684
|
-
oldParent
|
|
72685
|
-
} = context;
|
|
72719
|
+
const rootElement = getRootElement$2(oldParent);
|
|
72686
72720
|
|
|
72687
|
-
|
|
72721
|
+
const userTaskForm = getUserTaskForm(shape, rootElement);
|
|
72688
72722
|
|
|
72689
|
-
|
|
72723
|
+
if (!is$1(shape, 'bpmn:UserTask') || !userTaskForm) {
|
|
72724
|
+
return;
|
|
72725
|
+
}
|
|
72690
72726
|
|
|
72691
|
-
|
|
72692
|
-
return;
|
|
72693
|
-
}
|
|
72727
|
+
const rootExtensionElements = rootElement.get('extensionElements');
|
|
72694
72728
|
|
|
72695
|
-
|
|
72696
|
-
|
|
72729
|
+
const values = rootExtensionElements.get('values').filter((element) => {
|
|
72730
|
+
return element !== userTaskForm;
|
|
72731
|
+
});
|
|
72697
72732
|
|
|
72733
|
+
modeling.updateModdleProperties(shape, rootExtensionElements, { values });
|
|
72734
|
+
}, true);
|
|
72698
72735
|
|
|
72699
|
-
/**
|
|
72700
|
-
* create fresh new copied form definition + user task form
|
|
72701
|
-
*/
|
|
72702
|
-
this.executed('shape.create', function(context) {
|
|
72703
|
-
const {
|
|
72704
|
-
shape,
|
|
72705
|
-
} = context;
|
|
72706
72736
|
|
|
72707
|
-
|
|
72737
|
+
/**
|
|
72738
|
+
* Create new zeebe:FormDefinition and zeebe:UserTaskForm on user task created.
|
|
72739
|
+
*/
|
|
72740
|
+
this.postExecute('shape.create', function(context) {
|
|
72741
|
+
const { shape } = context;
|
|
72708
72742
|
|
|
72709
|
-
|
|
72710
|
-
return;
|
|
72711
|
-
}
|
|
72743
|
+
const oldFormDefinition = getFormDefinition(shape);
|
|
72712
72744
|
|
|
72713
|
-
|
|
72745
|
+
if (!is$1(shape, 'bpmn:UserTask') || !oldFormDefinition) {
|
|
72746
|
+
return;
|
|
72747
|
+
}
|
|
72714
72748
|
|
|
72715
|
-
|
|
72749
|
+
const oldUserTaskForm = getUserTaskForm(shape);
|
|
72716
72750
|
|
|
72717
|
-
|
|
72751
|
+
const rootElement = getRootElement$2(shape);
|
|
72718
72752
|
|
|
72719
|
-
|
|
72753
|
+
const businessObject = getBusinessObject(shape);
|
|
72720
72754
|
|
|
72721
|
-
|
|
72755
|
+
const extensionElements = businessObject.get('extensionElements');
|
|
72722
72756
|
|
|
72723
|
-
|
|
72724
|
-
if (!rootExtensionElements) {
|
|
72757
|
+
let rootExtensionElements = rootElement.get('extensionElements');
|
|
72725
72758
|
|
|
72726
|
-
|
|
72727
|
-
|
|
72728
|
-
{ values: [] },
|
|
72729
|
-
rootElement,
|
|
72730
|
-
bpmnFactory
|
|
72731
|
-
);
|
|
72759
|
+
// (1) ensure extension elements exists
|
|
72760
|
+
if (!rootExtensionElements) {
|
|
72761
|
+
rootExtensionElements = ElementHelper_1.createElement('bpmn:ExtensionElements', { values: [] }, rootElement, bpmnFactory);
|
|
72732
72762
|
|
|
72733
|
-
|
|
72734
|
-
|
|
72763
|
+
modeling.updateModdleProperties(shape, rootElement, { extensionElements: rootExtensionElements });
|
|
72764
|
+
}
|
|
72735
72765
|
|
|
72736
|
-
|
|
72737
|
-
|
|
72766
|
+
// (2) remove existing form definition
|
|
72767
|
+
let values = extensionElements.get('values').filter((element) => {
|
|
72768
|
+
return element !== oldFormDefinition;
|
|
72769
|
+
});
|
|
72738
72770
|
|
|
72739
|
-
|
|
72771
|
+
// (3) create new form definition
|
|
72772
|
+
const formId = createFormId();
|
|
72740
72773
|
|
|
72741
|
-
|
|
72774
|
+
const newFormDefinition = createFormDefinition({ formKey: createFormKey(formId) }, extensionElements, bpmnFactory);
|
|
72742
72775
|
|
|
72743
|
-
|
|
72744
|
-
|
|
72745
|
-
|
|
72746
|
-
|
|
72747
|
-
},
|
|
72748
|
-
extensionElements,
|
|
72749
|
-
bpmnFactory
|
|
72750
|
-
);
|
|
72776
|
+
values = [
|
|
72777
|
+
...values,
|
|
72778
|
+
newFormDefinition
|
|
72779
|
+
];
|
|
72751
72780
|
|
|
72752
|
-
|
|
72781
|
+
modeling.updateModdleProperties(shape, extensionElements, {
|
|
72782
|
+
values
|
|
72783
|
+
});
|
|
72753
72784
|
|
|
72754
|
-
|
|
72755
|
-
|
|
72756
|
-
{
|
|
72785
|
+
// (4) create new user task form
|
|
72786
|
+
const userTaskForm = createUserTaskForm({
|
|
72757
72787
|
id: formId,
|
|
72758
72788
|
body: oldUserTaskForm ? oldUserTaskForm.get('body') : ''
|
|
72759
|
-
},
|
|
72760
|
-
rootExtensionElements,
|
|
72761
|
-
bpmnFactory
|
|
72762
|
-
);
|
|
72763
|
-
|
|
72764
|
-
add$1(rootExtensionElements.get('values'), userTaskForm);
|
|
72765
|
-
}, true);
|
|
72766
|
-
|
|
72767
|
-
this.revert('shape.create', function(context) {
|
|
72768
|
-
const {
|
|
72769
|
-
shape,
|
|
72770
|
-
oldFormDefinition
|
|
72771
|
-
} = context;
|
|
72772
|
-
|
|
72773
|
-
const businessObject = getBusinessObject(shape);
|
|
72774
|
-
|
|
72775
|
-
const extensionElements = businessObject.get('extensionElements');
|
|
72776
|
-
|
|
72777
|
-
const formDefinition = getFormDefinition(shape);
|
|
72778
|
-
|
|
72779
|
-
const userTaskForm = getUserTaskForm(shape);
|
|
72780
|
-
|
|
72781
|
-
const rootElement = getRootElement$2(shape);
|
|
72789
|
+
}, rootExtensionElements, bpmnFactory);
|
|
72782
72790
|
|
|
72783
|
-
|
|
72784
|
-
|
|
72785
|
-
|
|
72786
|
-
|
|
72787
|
-
|
|
72788
|
-
|
|
72789
|
-
|
|
72790
|
-
remove$2(extensionElements.get('values'), formDefinition);
|
|
72791
|
-
add$1(extensionElements.get('values'), oldFormDefinition);
|
|
72792
|
-
|
|
72793
|
-
remove$2(rootExtensionElements.get('values'), userTaskForm);
|
|
72794
|
-
}, true);
|
|
72791
|
+
modeling.updateModdleProperties(shape, rootExtensionElements, {
|
|
72792
|
+
values: [
|
|
72793
|
+
...(rootExtensionElements.get('values') || []),
|
|
72794
|
+
userTaskForm
|
|
72795
|
+
]
|
|
72796
|
+
});
|
|
72797
|
+
}, true);
|
|
72795
72798
|
|
|
72799
|
+
}
|
|
72796
72800
|
}
|
|
72797
72801
|
|
|
72798
72802
|
FormDefinitionBehavior.$inject = [
|
|
72803
|
+
'bpmnFactory',
|
|
72799
72804
|
'eventBus',
|
|
72800
|
-
'
|
|
72805
|
+
'modeling'
|
|
72801
72806
|
];
|
|
72802
72807
|
|
|
72803
|
-
inherits_browser(FormDefinitionBehavior, CommandInterceptor);
|
|
72804
|
-
|
|
72805
72808
|
|
|
72806
72809
|
// helpers //////////////
|
|
72807
72810
|
|
|
@@ -72818,11 +72821,13 @@
|
|
|
72818
72821
|
|
|
72819
72822
|
var zeebeModelingBehaviors = {
|
|
72820
72823
|
__init__: [
|
|
72824
|
+
'cleanUpBusinessRuleTaskBehavior',
|
|
72821
72825
|
'createZeebeBoundaryEventBehavior',
|
|
72822
72826
|
'createZeebeCallActivityBehavior',
|
|
72823
72827
|
'updatePropagateAllChildVariablesBehavior',
|
|
72824
72828
|
'formDefinitionBehavior'
|
|
72825
72829
|
],
|
|
72830
|
+
cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
|
|
72826
72831
|
createZeebeBoundaryEventBehavior: [ 'type', CreateZeebeBoundaryEventBehavior ],
|
|
72827
72832
|
createZeebeCallActivityBehavior: [ 'type', CreateZeebeCallActivityBehavior ],
|
|
72828
72833
|
updatePropagateAllChildVariablesBehavior: [ 'type', UpdatePropagateAllChildVariablesBehavior ],
|
|
@@ -73051,7 +73056,7 @@
|
|
|
73051
73056
|
zeebeReplaceMenuProvider: [ 'type', ReplaceMenuProvider$1 ]
|
|
73052
73057
|
};
|
|
73053
73058
|
|
|
73054
|
-
const HIGH_PRIORITY$
|
|
73059
|
+
const HIGH_PRIORITY$p = 5000;
|
|
73055
73060
|
|
|
73056
73061
|
/**
|
|
73057
73062
|
* Zeebe rule provider that allows to create boundary events with catch events
|
|
@@ -73069,7 +73074,7 @@
|
|
|
73069
73074
|
|
|
73070
73075
|
init() {
|
|
73071
73076
|
super.init();
|
|
73072
|
-
this.addRule('shape.attach', HIGH_PRIORITY$
|
|
73077
|
+
this.addRule('shape.attach', HIGH_PRIORITY$p,(context) => {
|
|
73073
73078
|
return this.canAttach(
|
|
73074
73079
|
context.shape,
|
|
73075
73080
|
context.target,
|
|
@@ -73497,12 +73502,12 @@
|
|
|
73497
73502
|
}
|
|
73498
73503
|
|
|
73499
73504
|
// Get the IOMapping
|
|
73500
|
-
let inputOutput =
|
|
73505
|
+
let inputOutput = getIoMapping(element);
|
|
73501
73506
|
|
|
73502
73507
|
if (!inputOutput) {
|
|
73503
73508
|
const parent = extensionElements;
|
|
73504
73509
|
|
|
73505
|
-
inputOutput =
|
|
73510
|
+
inputOutput = createIoMapping(parent, bpmnFactory, {
|
|
73506
73511
|
inputParameters: [],
|
|
73507
73512
|
outputParameters: []
|
|
73508
73513
|
});
|
|
@@ -73557,7 +73562,7 @@
|
|
|
73557
73562
|
function getIOMappingEntries(element, bpmnFactory, translate, options) {
|
|
73558
73563
|
|
|
73559
73564
|
// Get the IOMapping and determine whether we are dealing with input or output parameters
|
|
73560
|
-
const inputOutput =
|
|
73565
|
+
const inputOutput = getIoMapping(element),
|
|
73561
73566
|
params = determineParamGetFunc(options.prop)(element, false);
|
|
73562
73567
|
|
|
73563
73568
|
if (!params.length) {
|
|
@@ -73626,6 +73631,19 @@
|
|
|
73626
73631
|
}
|
|
73627
73632
|
}
|
|
73628
73633
|
|
|
73634
|
+
|
|
73635
|
+
// helpers //////////
|
|
73636
|
+
|
|
73637
|
+
function determineParamGetFunc(property) {
|
|
73638
|
+
if (property == 'inputParameters') {
|
|
73639
|
+
return getInputParameters;
|
|
73640
|
+
}
|
|
73641
|
+
|
|
73642
|
+
if (property == 'outputParameters') {
|
|
73643
|
+
return getOutputParameters;
|
|
73644
|
+
}
|
|
73645
|
+
}
|
|
73646
|
+
|
|
73629
73647
|
function inputOutput$1(group, element, bpmnFactory, translate, options) {
|
|
73630
73648
|
|
|
73631
73649
|
const inputOutputEntry = inputOutput(element, bpmnFactory, translate, options);
|
|
@@ -75417,6 +75435,29 @@
|
|
|
75417
75435
|
isAttr: true
|
|
75418
75436
|
}
|
|
75419
75437
|
]
|
|
75438
|
+
},
|
|
75439
|
+
{
|
|
75440
|
+
name: "CalledDecision",
|
|
75441
|
+
superClass: [
|
|
75442
|
+
"Element"
|
|
75443
|
+
],
|
|
75444
|
+
meta: {
|
|
75445
|
+
allowedIn: [
|
|
75446
|
+
"bpmn:BusinessRuleTask"
|
|
75447
|
+
]
|
|
75448
|
+
},
|
|
75449
|
+
properties: [
|
|
75450
|
+
{
|
|
75451
|
+
name: "decisionId",
|
|
75452
|
+
type: "String",
|
|
75453
|
+
isAttr: true
|
|
75454
|
+
},
|
|
75455
|
+
{
|
|
75456
|
+
name: "resultVariable",
|
|
75457
|
+
type: "String",
|
|
75458
|
+
isAttr: true
|
|
75459
|
+
}
|
|
75460
|
+
]
|
|
75420
75461
|
}
|
|
75421
75462
|
];
|
|
75422
75463
|
var zeebeModdle = {
|