camunda-bpmn-js 0.12.1 → 0.13.0-alpha.2
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 +32 -0
- package/dist/assets/base-modeler.css +2 -1
- package/dist/assets/bpmn-js.css +113 -0
- package/dist/assets/camunda-platform-modeler.css +2 -1
- package/dist/assets/diagram-js.css +82 -78
- package/dist/assets/element-templates.css +75 -0
- package/dist/assets/properties-panel.css +115 -18
- package/dist/base-modeler.development.js +37213 -40850
- package/dist/base-modeler.production.min.js +8 -3
- package/dist/camunda-cloud-modeler.development.js +39107 -40889
- package/dist/camunda-cloud-modeler.production.min.js +8 -3
- package/dist/camunda-platform-modeler.development.js +50489 -54168
- package/dist/camunda-platform-modeler.production.min.js +8 -3
- package/lib/base/Modeler.js +5 -9
- package/lib/camunda-cloud/Modeler.js +16 -3
- package/lib/camunda-cloud/features/drilldown/index.js +3 -0
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +60 -57
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +3 -3
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +2 -2
- package/lib/camunda-cloud/features/modeling/behavior/RemoveAssignmentDefinitionBehavior.js +51 -0
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +60 -33
- package/lib/camunda-cloud/features/modeling/behavior/index.js +8 -5
- package/lib/camunda-cloud/helper/CalledElementHelper.js +5 -5
- package/lib/camunda-cloud/helper/ElementHelper.js +18 -0
- package/lib/camunda-cloud/helper/FormsHelper.js +8 -8
- package/lib/camunda-cloud/helper/InputOutputHelper.js +2 -6
- package/lib/camunda-cloud/helper/Utils.js +10 -0
- package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +22 -5
- package/lib/camunda-platform/Modeler.js +7 -3
- package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +23 -36
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +33 -21
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +14 -11
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +20 -30
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +15 -12
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +9 -8
- package/lib/camunda-platform/features/modeling/behavior/UserTaskGeneratedFormsBehavior.js +32 -33
- package/lib/util/ExtensionElementsUtil.js +59 -0
- package/package.json +10 -10
- package/styles/base-modeler.css +2 -1
- package/styles/camunda-platform-modeler.css +2 -1
- package/lib/camunda-cloud/features/properties-provider/ZeebePropertiesProvider.js +0 -201
- package/lib/camunda-cloud/features/properties-provider/index.js +0 -11
- package/lib/camunda-cloud/features/properties-provider/parts/CallActivityProps.js +0 -90
- package/lib/camunda-cloud/features/properties-provider/parts/ErrorProps.js +0 -13
- package/lib/camunda-cloud/features/properties-provider/parts/FormProps.js +0 -14
- package/lib/camunda-cloud/features/properties-provider/parts/HeadersProps.js +0 -52
- package/lib/camunda-cloud/features/properties-provider/parts/InputOutputProps.js +0 -8
- package/lib/camunda-cloud/features/properties-provider/parts/MessageProps.js +0 -51
- package/lib/camunda-cloud/features/properties-provider/parts/MultiInstanceProps.js +0 -25
- package/lib/camunda-cloud/features/properties-provider/parts/SequenceFlowProps.js +0 -149
- package/lib/camunda-cloud/features/properties-provider/parts/TaskDefinitionProps.js +0 -135
- package/lib/camunda-cloud/features/properties-provider/parts/TimerEventProps.js +0 -77
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/ElementReferenceExtensionElementProperty.js +0 -110
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/FormDefinition.js +0 -207
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/Headers.js +0 -208
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +0 -274
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutputParameter.js +0 -147
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/MultiInstanceLoopCharacteristics.js +0 -176
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/OutputParameterToggle.js +0 -97
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerDurationDefinition.js +0 -69
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerEventDefinition.js +0 -132
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
|
|
6
6
|
import { isAny } from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import { createElement } from './ElementHelper';
|
|
9
9
|
|
|
10
10
|
import { isZeebeServiceTask } from './ZeebeServiceTaskHelper';
|
|
11
11
|
|
|
@@ -133,10 +133,6 @@ export function areOutputParametersSupported(element) {
|
|
|
133
133
|
]);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
export function createElement(type, parent, factory, properties) {
|
|
137
|
-
return elementHelper.createElement(type, properties, parent, factory);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
136
|
export function createIoMapping(parent, bpmnFactory, properties) {
|
|
141
|
-
return createElement('zeebe:IoMapping', parent, bpmnFactory
|
|
137
|
+
return createElement('zeebe:IoMapping', properties, parent, bpmnFactory);
|
|
142
138
|
}
|
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getBusinessObject,
|
|
2
3
|
is
|
|
3
4
|
} from 'bpmn-js/lib/util/ModelUtil';
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import { forEach } from 'min-dash';
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
export function isZeebeServiceTask(element) {
|
|
9
10
|
if (!is(element, 'zeebe:ZeebeServiceTask')) return false;
|
|
10
11
|
|
|
11
12
|
if (is(element, 'bpmn:EndEvent') || is(element, 'bpmn:IntermediateThrowEvent')) {
|
|
12
|
-
return !!
|
|
13
|
+
return !!getMessageEventDefinition(element);
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
return true;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export function isMessageEndEvent(element) {
|
|
19
|
-
return is(element, 'bpmn:EndEvent') && !!
|
|
20
|
+
return is(element, 'bpmn:EndEvent') && !!getMessageEventDefinition(element);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export function isMessageThrowEvent(element) {
|
|
23
|
-
return is(element, 'bpmn:IntermediateThrowEvent') && !!
|
|
24
|
-
}
|
|
24
|
+
return is(element, 'bpmn:IntermediateThrowEvent') && !!getMessageEventDefinition(element);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getMessageEventDefinition(element) {
|
|
28
|
+
|
|
29
|
+
var bo = getBusinessObject(element),
|
|
30
|
+
eventDefinition = null;
|
|
31
|
+
|
|
32
|
+
if (bo.eventDefinitions) {
|
|
33
|
+
forEach(bo.eventDefinitions, function(event) {
|
|
34
|
+
if (is(event, 'bpmn:MessageEventDefinition')) {
|
|
35
|
+
eventDefinition = event;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return eventDefinition;
|
|
41
|
+
}
|
|
@@ -4,12 +4,15 @@ import BaseModeler from '../base/Modeler';
|
|
|
4
4
|
|
|
5
5
|
import modelingModule from './features/modeling';
|
|
6
6
|
|
|
7
|
-
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda';
|
|
8
|
-
|
|
9
7
|
import camundaModdle from 'camunda-bpmn-moddle/resources/camunda.json';
|
|
10
8
|
|
|
11
9
|
import camundaModdleExtension from 'camunda-bpmn-moddle/lib';
|
|
12
10
|
|
|
11
|
+
import {
|
|
12
|
+
CamundaPlatformPropertiesProviderModule,
|
|
13
|
+
ElementTemplatesPropertiesProviderModule
|
|
14
|
+
} from 'bpmn-js-properties-panel';
|
|
15
|
+
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
*
|
|
@@ -33,7 +36,8 @@ inherits(Modeler, BaseModeler);
|
|
|
33
36
|
Modeler.prototype._camundaPlatformModules = [
|
|
34
37
|
camundaModdleExtension,
|
|
35
38
|
modelingModule,
|
|
36
|
-
|
|
39
|
+
CamundaPlatformPropertiesProviderModule,
|
|
40
|
+
ElementTemplatesPropertiesProviderModule
|
|
37
41
|
];
|
|
38
42
|
|
|
39
43
|
Modeler.prototype._modules = [].concat(
|
package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
|
+
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
getBusinessObject,
|
|
3
5
|
is
|
|
4
6
|
} from 'bpmn-js/lib/util/ModelUtil';
|
|
5
7
|
|
|
6
|
-
import
|
|
8
|
+
import {
|
|
9
|
+
getExtensionElementsList,
|
|
10
|
+
removeExtensionElements
|
|
11
|
+
} from '../../../../util/ExtensionElementsUtil';
|
|
7
12
|
|
|
8
13
|
const HIGH_PRIORITY = 5000;
|
|
9
14
|
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
|
-
* Camunda BPMN specific camunda:ErrorEventDefinition
|
|
17
|
+
* Camunda BPMN specific behavior ensuring camunda:ErrorEventDefinition extension elements are removed
|
|
18
|
+
* if type of e.g. bpmn:ServiceTask is set to something other than external.
|
|
13
19
|
*/
|
|
14
20
|
export default class DeleteErrorEventDefinitionBehavior extends CommandInterceptor {
|
|
15
|
-
constructor(
|
|
21
|
+
constructor(commandStack, eventBus) {
|
|
16
22
|
super(eventBus);
|
|
17
23
|
|
|
18
|
-
/**
|
|
19
|
-
* Remove camunda:ErrorEventDefinitions on camunda:type set to external.
|
|
20
|
-
*/
|
|
21
24
|
this.postExecute([
|
|
22
25
|
'element.updateProperties',
|
|
23
|
-
'
|
|
26
|
+
'element.updateModdleProperties'
|
|
24
27
|
], HIGH_PRIORITY, function(context) {
|
|
25
28
|
const {
|
|
26
29
|
element,
|
|
27
|
-
|
|
30
|
+
moddleElement,
|
|
28
31
|
properties
|
|
29
32
|
} = context;
|
|
30
33
|
|
|
31
|
-
const businessObject = getBusinessObject(element)
|
|
32
|
-
extensionElements = businessObject.get('extensionElements');
|
|
34
|
+
const businessObject = moddleElement || getBusinessObject(element);
|
|
33
35
|
|
|
34
36
|
if (is(element, 'camunda:ExternalCapable')
|
|
35
|
-
&&
|
|
36
|
-
&&
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
&& is(businessObject, 'camunda:ExternalCapable')
|
|
38
|
+
&& properties[ 'camunda:type' ] !== 'external'
|
|
39
|
+
) {
|
|
40
|
+
const errorEventDefinitions = getExtensionElementsList(businessObject, 'camunda:ErrorEventDefinition');
|
|
41
|
+
|
|
42
|
+
if (errorEventDefinitions.length) {
|
|
43
|
+
removeExtensionElements(element, businessObject, errorEventDefinitions, commandStack);
|
|
44
|
+
}
|
|
43
45
|
}
|
|
44
46
|
}, true);
|
|
45
47
|
|
|
@@ -47,21 +49,6 @@ export default class DeleteErrorEventDefinitionBehavior extends CommandIntercept
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
DeleteErrorEventDefinitionBehavior.$inject = [
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// helpers //////////
|
|
56
|
-
|
|
57
|
-
function externalTypeChanged(oldProperties, updatesProperties) {
|
|
58
|
-
const {
|
|
59
|
-
'camunda:type': oldType
|
|
60
|
-
} = oldProperties;
|
|
61
|
-
|
|
62
|
-
const {
|
|
63
|
-
'camunda:type': newType
|
|
64
|
-
} = updatesProperties;
|
|
65
|
-
|
|
66
|
-
return oldType === 'external' && newType !== 'external';
|
|
67
|
-
}
|
|
52
|
+
'commandStack',
|
|
53
|
+
'eventBus'
|
|
54
|
+
];
|
|
@@ -5,37 +5,45 @@ import {
|
|
|
5
5
|
|
|
6
6
|
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
7
7
|
|
|
8
|
+
import {
|
|
9
|
+
getExtensionElementsList,
|
|
10
|
+
removeExtensionElements
|
|
11
|
+
} from '../../../../util/ExtensionElementsUtil';
|
|
12
|
+
|
|
8
13
|
const HIGH_PRIORITY = 5000;
|
|
9
14
|
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
|
-
* Camunda BPMN specific camunda:FailedJobRetryTimeCycle
|
|
17
|
+
* Camunda BPMN specific behavior ensuring camunda:FailedJobRetryTimeCycle is
|
|
18
|
+
* removed when both camunda:asyncAfter and camunda:asyncBefore set to false.
|
|
19
|
+
* Doesn't apply if element has bpmn:TimerEventDefinition.
|
|
13
20
|
*/
|
|
14
21
|
export default class DeleteRetryTimeCycleBehavior extends CommandInterceptor {
|
|
15
|
-
constructor(
|
|
22
|
+
constructor(commandStack, eventBus) {
|
|
16
23
|
super(eventBus);
|
|
17
24
|
|
|
18
|
-
/**
|
|
19
|
-
* Remove camunda:FailedJobRetryTimeCycle if camunda:asyncAfter or camunda:asyncBefore is set to false.
|
|
20
|
-
*/
|
|
21
25
|
this.postExecute([
|
|
22
26
|
'element.updateProperties',
|
|
23
|
-
'
|
|
27
|
+
'element.updateModdleProperties'
|
|
24
28
|
], HIGH_PRIORITY, function(context) {
|
|
25
29
|
const {
|
|
26
30
|
element,
|
|
27
|
-
|
|
31
|
+
moddleElement,
|
|
32
|
+
properties = {}
|
|
28
33
|
} = context;
|
|
29
34
|
|
|
30
|
-
const
|
|
31
|
-
|
|
35
|
+
const asyncAfter = properties[ 'camunda:asyncAfter' ],
|
|
36
|
+
asyncBefore = properties[ 'camunda:asyncBefore' ];
|
|
37
|
+
|
|
38
|
+
const businessObject = moddleElement || getBusinessObject(element);
|
|
39
|
+
|
|
40
|
+
const failedJobRetryTimeCycle = getFailedJobRetryTimeCycle(element);
|
|
32
41
|
|
|
33
42
|
if (
|
|
34
43
|
!is(element, 'camunda:AsyncCapable')
|
|
35
|
-
|| (
|
|
36
|
-
||
|
|
37
|
-
|| !
|
|
38
|
-
|| !extensionElements.get('values').find((value) => is(value, 'camunda:FailedJobRetryTimeCycle'))
|
|
44
|
+
|| !is(businessObject, 'camunda:AsyncCapable')
|
|
45
|
+
|| (asyncAfter !== false && asyncBefore !== false)
|
|
46
|
+
|| !failedJobRetryTimeCycle
|
|
39
47
|
|| getTimerEventDefinition(element)
|
|
40
48
|
|| isAsyncBefore(businessObject)
|
|
41
49
|
|| isAsyncAfter(businessObject)
|
|
@@ -43,19 +51,15 @@ export default class DeleteRetryTimeCycleBehavior extends CommandInterceptor {
|
|
|
43
51
|
return;
|
|
44
52
|
}
|
|
45
53
|
|
|
46
|
-
|
|
47
|
-
return !is(element, 'camunda:FailedJobRetryTimeCycle');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
modeling.updateModdleProperties(element, extensionElements, { values });
|
|
54
|
+
removeExtensionElements(element, businessObject, failedJobRetryTimeCycle, commandStack);
|
|
51
55
|
}, true);
|
|
52
56
|
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
DeleteRetryTimeCycleBehavior.$inject = [
|
|
57
|
-
'
|
|
58
|
-
'
|
|
61
|
+
'commandStack',
|
|
62
|
+
'eventBus'
|
|
59
63
|
];
|
|
60
64
|
|
|
61
65
|
|
|
@@ -69,6 +73,10 @@ function isAsyncAfter(businessObject) {
|
|
|
69
73
|
return !!businessObject.get('camunda:asyncAfter');
|
|
70
74
|
}
|
|
71
75
|
|
|
76
|
+
function getFailedJobRetryTimeCycle(element) {
|
|
77
|
+
return getExtensionElementsList(element, 'camunda:FailedJobRetryTimeCycle')[ 0 ];
|
|
78
|
+
}
|
|
79
|
+
|
|
72
80
|
function getTimerEventDefinition(element) {
|
|
73
81
|
return getEventDefinition(element, 'bpmn:TimerEventDefinition');
|
|
74
82
|
}
|
|
@@ -76,7 +84,11 @@ function getTimerEventDefinition(element) {
|
|
|
76
84
|
function getEventDefinition(element, type) {
|
|
77
85
|
const businessObject = getBusinessObject(element);
|
|
78
86
|
|
|
79
|
-
const eventDefinitions = businessObject.get('eventDefinitions')
|
|
87
|
+
const eventDefinitions = businessObject.get('eventDefinitions');
|
|
88
|
+
|
|
89
|
+
if (!eventDefinitions || !eventDefinitions.length) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
80
92
|
|
|
81
93
|
return eventDefinitions.find((eventDefinition) => {
|
|
82
94
|
return is(eventDefinition, type);
|
|
@@ -9,32 +9,35 @@ const HIGH_PRIORITY = 5000;
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Camunda BPMN specific camunda:exclusive
|
|
12
|
+
* Camunda BPMN specific behavior ensuring camunda:exclusive is set to true if
|
|
13
|
+
* camunda:asyncBefore or camunda:asyncAfter is set to false.
|
|
13
14
|
*/
|
|
14
15
|
export default class UpdateCamundaExclusiveBehavior extends CommandInterceptor {
|
|
15
16
|
constructor(eventBus) {
|
|
16
17
|
super(eventBus);
|
|
17
18
|
|
|
18
|
-
/**
|
|
19
|
-
* Set camunda:exclusive to true on camunda:asyncBefore or camunda:asyncAfter set to false.
|
|
20
|
-
*/
|
|
21
19
|
this.preExecute([
|
|
22
20
|
'element.updateProperties',
|
|
23
|
-
'
|
|
21
|
+
'element.updateModdleProperties',
|
|
24
22
|
], HIGH_PRIORITY, function(context) {
|
|
25
23
|
const {
|
|
26
24
|
element,
|
|
27
|
-
|
|
25
|
+
moddleElement,
|
|
26
|
+
properties = {}
|
|
28
27
|
} = context;
|
|
29
28
|
|
|
30
|
-
const businessObject = getBusinessObject(element);
|
|
29
|
+
const businessObject = moddleElement || getBusinessObject(element);
|
|
30
|
+
|
|
31
|
+
const asyncAfter = properties[ 'camunda:asyncAfter' ],
|
|
32
|
+
asyncBefore = properties[ 'camunda:asyncBefore' ];
|
|
31
33
|
|
|
32
34
|
if (!is(element, 'camunda:AsyncCapable')
|
|
33
|
-
|| (
|
|
35
|
+
|| !is(businessObject, 'camunda:AsyncCapable')
|
|
36
|
+
|| (asyncAfter !== false && asyncBefore !== false)
|
|
34
37
|
|| isExclusive(businessObject)
|
|
35
|
-
|| (isAsyncAfter(businessObject) &&
|
|
36
|
-
|| (isAsyncBefore(businessObject) &&
|
|
37
|
-
|| (
|
|
38
|
+
|| (isAsyncAfter(businessObject) && asyncAfter !== false)
|
|
39
|
+
|| (isAsyncBefore(businessObject) && asyncBefore !== false)
|
|
40
|
+
|| (asyncAfter === true || asyncBefore === true)
|
|
38
41
|
) {
|
|
39
42
|
return;
|
|
40
43
|
}
|
|
@@ -1,54 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getBusinessObject,
|
|
3
|
+
is
|
|
4
|
+
} from 'bpmn-js/lib/util/ModelUtil';
|
|
5
|
+
|
|
6
|
+
import { isInputOutputEmpty } from '../../../helper/InputOutputHelper';
|
|
2
7
|
|
|
3
8
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from '../../../helper/InputOutputHelper';
|
|
9
|
+
removeExtensionElements
|
|
10
|
+
} from '../../../../util/ExtensionElementsUtil';
|
|
7
11
|
|
|
8
12
|
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
9
13
|
|
|
14
|
+
const LOW_PRIORITY = 250;
|
|
15
|
+
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
|
-
* Camunda BPMN specific camunda:InputOutput
|
|
18
|
+
* Camunda BPMN specific behavior ensuring empty camunda:InputOutput is removed.
|
|
12
19
|
*/
|
|
13
20
|
export default class UpdateInputOutputBehavior extends CommandInterceptor {
|
|
14
|
-
constructor(
|
|
21
|
+
constructor(commandStack, eventBus) {
|
|
15
22
|
super(eventBus);
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
* Remove empty camunda:InputOutput on update.
|
|
19
|
-
*/
|
|
20
|
-
this.postExecute([
|
|
21
|
-
'element.updateProperties',
|
|
22
|
-
'element.updateModdleProperties',
|
|
23
|
-
'properties-panel.update-businessobject-list'
|
|
24
|
-
], function(context) {
|
|
24
|
+
this.postExecuted('element.updateModdleProperties', LOW_PRIORITY, function(context) {
|
|
25
25
|
const {
|
|
26
26
|
element,
|
|
27
|
-
|
|
28
|
-
propertyName
|
|
27
|
+
moddleElement
|
|
29
28
|
} = context;
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
inputOutput = getInputOutput(businessObject),
|
|
33
|
-
extensionElements = businessObject.get('extensionElements');
|
|
34
|
-
|
|
35
|
-
// do not remove newly added camunda:InputOutput
|
|
36
|
-
if (!oldProperties && propertyName === 'values') {
|
|
30
|
+
if (!is(moddleElement, 'camunda:InputOutput')) {
|
|
37
31
|
return;
|
|
38
32
|
}
|
|
39
33
|
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
return element !== inputOutput;
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
modeling.updateModdleProperties(element, extensionElements, { values });
|
|
34
|
+
if (isInputOutputEmpty(moddleElement)) {
|
|
35
|
+
removeExtensionElements(element, getBusinessObject(element), moddleElement, commandStack);
|
|
46
36
|
}
|
|
47
37
|
}, true);
|
|
48
38
|
}
|
|
49
39
|
}
|
|
50
40
|
|
|
51
41
|
UpdateInputOutputBehavior.$inject = [
|
|
52
|
-
'
|
|
53
|
-
'
|
|
42
|
+
'commandStack',
|
|
43
|
+
'eventBus'
|
|
54
44
|
];
|
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
getBusinessObject,
|
|
3
|
+
is
|
|
4
|
+
} from 'bpmn-js/lib/util/ModelUtil';
|
|
4
5
|
|
|
5
6
|
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
6
7
|
|
|
8
|
+
import { has } from 'min-dash';
|
|
9
|
+
|
|
7
10
|
const HIGH_PRIORITY = 5000;
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
|
-
* Camunda BPMN specific camunda:resultVariable behavior
|
|
14
|
+
* Camunda BPMN specific camunda:resultVariable behavior ensuring
|
|
15
|
+
* camunda:mapDecisionResult is removed when camunda:resultVariable is removed.
|
|
12
16
|
*/
|
|
13
17
|
export default class UpdateResultVariableBehavior extends CommandInterceptor {
|
|
14
18
|
constructor(eventBus) {
|
|
15
19
|
super(eventBus);
|
|
16
20
|
|
|
17
|
-
/**
|
|
18
|
-
* Remove camunda:mapDecisionResult on camunda:resultVariable removed.
|
|
19
|
-
*/
|
|
20
21
|
this.preExecute([
|
|
21
22
|
'element.updateProperties',
|
|
22
|
-
'
|
|
23
|
+
'element.updateModdleProperties'
|
|
23
24
|
], HIGH_PRIORITY, function(context) {
|
|
24
25
|
const {
|
|
25
26
|
element,
|
|
27
|
+
moddleElement,
|
|
26
28
|
properties
|
|
27
29
|
} = context;
|
|
28
30
|
|
|
31
|
+
const businessObject = moddleElement || getBusinessObject(element);
|
|
32
|
+
|
|
29
33
|
if (
|
|
30
34
|
is(element, 'camunda:DmnCapable')
|
|
35
|
+
&& is(businessObject, 'camunda:DmnCapable')
|
|
31
36
|
&& has(properties, 'camunda:resultVariable')
|
|
32
37
|
&& isEmpty(properties[ 'camunda:resultVariable' ])
|
|
33
38
|
) {
|
|
34
|
-
properties[ 'camunda:mapDecisionResult' ] =
|
|
39
|
+
properties[ 'camunda:mapDecisionResult' ] = undefined;
|
|
35
40
|
}
|
|
36
41
|
}, true);
|
|
37
42
|
|
|
@@ -42,10 +47,8 @@ UpdateResultVariableBehavior.$inject = [
|
|
|
42
47
|
'eventBus'
|
|
43
48
|
];
|
|
44
49
|
|
|
45
|
-
|
|
46
50
|
// helpers //////////
|
|
47
51
|
|
|
48
52
|
function isEmpty(value) {
|
|
49
53
|
return value == undefined || value === '';
|
|
50
|
-
}
|
|
51
|
-
|
|
54
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getBusinessObject } from 'bpmn-js/lib/util/ModelUtil';
|
|
2
|
+
|
|
1
3
|
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
2
4
|
|
|
3
5
|
import {
|
|
@@ -21,16 +23,15 @@ export default class UserTaskFormsBehavior extends CommandInterceptor {
|
|
|
21
23
|
*/
|
|
22
24
|
this.preExecute([
|
|
23
25
|
'element.updateProperties',
|
|
24
|
-
'element.updateModdleProperties'
|
|
25
|
-
'properties-panel.update-businessobject'
|
|
26
|
+
'element.updateModdleProperties'
|
|
26
27
|
], function(context) {
|
|
27
|
-
const {
|
|
28
|
+
const {
|
|
29
|
+
element,
|
|
30
|
+
moddleElement,
|
|
31
|
+
properties
|
|
32
|
+
} = context;
|
|
28
33
|
|
|
29
|
-
const businessObject = (
|
|
30
|
-
context.moddleElement ||
|
|
31
|
-
context.businessObject ||
|
|
32
|
-
context.element.businessObject
|
|
33
|
-
);
|
|
34
|
+
const businessObject = moddleElement || getBusinessObject(element);
|
|
34
35
|
|
|
35
36
|
if (has(properties, 'camunda:formKey')) {
|
|
36
37
|
Object.assign(properties, {
|
|
@@ -2,6 +2,8 @@ import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
|
2
2
|
|
|
3
3
|
import { getBusinessObject, is } from 'bpmn-js/lib/util/ModelUtil';
|
|
4
4
|
|
|
5
|
+
import { has } from 'min-dash';
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Camunda BPMN specific user task generated forms behavior.
|
|
@@ -14,19 +16,17 @@ export default class UserTaskFormsBehavior extends CommandInterceptor {
|
|
|
14
16
|
constructor(eventBus, modeling) {
|
|
15
17
|
super(eventBus);
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Remove camunda:FormField#values if camunda:FormField#type is changed to
|
|
21
|
+
* something other than enum.
|
|
22
|
+
*/
|
|
23
|
+
this.preExecute('element.updateModdleProperties', function(context) {
|
|
24
|
+
const {
|
|
23
25
|
moddleElement,
|
|
24
26
|
properties
|
|
25
27
|
} = context;
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!is(businessObject, 'camunda:FormField')) {
|
|
29
|
+
if (!is(moddleElement, 'camunda:FormField')) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -35,59 +35,58 @@ export default class UserTaskFormsBehavior extends CommandInterceptor {
|
|
|
35
35
|
}
|
|
36
36
|
}, true);
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
businessObject,
|
|
38
|
+
/**
|
|
39
|
+
* Update camunda:FormData#businessKey if camunda:FormField#id is changed.
|
|
40
|
+
*/
|
|
41
|
+
this.preExecute('element.updateModdleProperties', function(context) {
|
|
42
|
+
const {
|
|
44
43
|
element,
|
|
45
44
|
moddleElement,
|
|
46
45
|
properties
|
|
47
46
|
} = context;
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (!is(businessObject, 'camunda:FormField')) {
|
|
48
|
+
if (!is(moddleElement, 'camunda:FormField') || !has(properties, 'camunda:id')) {
|
|
52
49
|
return;
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
const formData = getFormData(element);
|
|
56
53
|
|
|
57
|
-
if (
|
|
54
|
+
if (isBusinessKey(moddleElement, formData)) {
|
|
58
55
|
modeling.updateModdleProperties(element, formData, {
|
|
59
56
|
'camunda:businessKey': properties[ 'camunda:id' ]
|
|
60
57
|
});
|
|
61
58
|
}
|
|
62
59
|
}, true);
|
|
63
60
|
|
|
64
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Remove camunda:FormData#businessKey if camunda:FormField is removed.
|
|
63
|
+
*/
|
|
64
|
+
this.postExecute('element.updateModdleProperties', function(context) {
|
|
65
65
|
const {
|
|
66
|
-
currentObject: businessObject,
|
|
67
66
|
element,
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
moddleElement,
|
|
68
|
+
properties
|
|
70
69
|
} = context;
|
|
71
70
|
|
|
72
|
-
if (!is(
|
|
73
|
-
|| propertyName !== 'fields'
|
|
74
|
-
|| !objectsToRemove.length) {
|
|
71
|
+
if (!is(moddleElement, 'camunda:FormData') || !has(properties, 'fields')) {
|
|
75
72
|
return;
|
|
76
73
|
}
|
|
77
74
|
|
|
78
|
-
const businessKey =
|
|
75
|
+
const businessKey = moddleElement.get('camunda:businessKey');
|
|
79
76
|
|
|
80
77
|
if (!businessKey) {
|
|
81
78
|
return;
|
|
82
79
|
}
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
modeling.updateModdleProperties(element, businessObject, {
|
|
87
|
-
'camunda:businessKey': undefined
|
|
88
|
-
});
|
|
89
|
-
}
|
|
81
|
+
const fieldWithBusinessKey = moddleElement.get('fields').find(field => {
|
|
82
|
+
return field.get('camunda:id') === businessKey;
|
|
90
83
|
});
|
|
84
|
+
|
|
85
|
+
if (!fieldWithBusinessKey) {
|
|
86
|
+
modeling.updateModdleProperties(element, moddleElement, {
|
|
87
|
+
'camunda:businessKey': undefined
|
|
88
|
+
});
|
|
89
|
+
}
|
|
91
90
|
}, true);
|
|
92
91
|
}
|
|
93
92
|
}
|