Skip to content

Commit bb56a9f

Browse files
committed
feat: integrate [email protected]
1 parent 0dd63f4 commit bb56a9f

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/provider/zeebe/properties/MessageProps.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ function SubscriptionCorrelationKey(props) {
109109
const setValue = (value) => {
110110
const commands = [];
111111

112+
const properties = {
113+
correlationKey: value
114+
};
115+
112116
const message = getMessage(element);
113117

114118
let extensionElements = message.get('extensionElements');
@@ -132,13 +136,13 @@ function SubscriptionCorrelationKey(props) {
132136
});
133137
}
134138

135-
// (2) ensure subscription
136139
let subscription = getSubscription(element);
137140

141+
// (2a) add subscription with correlation key
138142
if (!subscription) {
139143
subscription = createElement(
140144
'zeebe:Subscription',
141-
{ },
145+
properties,
142146
extensionElements,
143147
bpmnFactory
144148
);
@@ -153,19 +157,20 @@ function SubscriptionCorrelationKey(props) {
153157
}
154158
}
155159
});
156-
}
160+
} else {
157161

158-
// (3) update subscription correlation key
159-
commands.push({
160-
cmd: 'element.updateModdleProperties',
161-
context: {
162-
element,
163-
moddleElement: subscription,
164-
properties: { correlationKey: value }
165-
}
166-
});
162+
// (2b) update existing subscription's correlation key
163+
commands.push({
164+
cmd: 'element.updateModdleProperties',
165+
context: {
166+
element,
167+
properties,
168+
moddleElement: subscription
169+
}
170+
});
171+
}
167172

168-
// (4) commit all updates
173+
// (3) commit all updates
169174
commandStack.execute('properties-panel.multi-command-executor', commands);
170175
};
171176

test/spec/provider/zeebe/MessageProps.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import TooltipProvider from 'src/contextProvider/zeebe/TooltipProvider';
3030

3131
import zeebeModdleExtensions from 'zeebe-bpmn-moddle/resources/zeebe';
3232

33+
import BehaviorsModule from 'camunda-bpmn-js-behaviors/lib/camunda-cloud';
34+
3335
import {
3436
getExtensionElementsList
3537
} from 'src/utils/ExtensionElementsUtil';
@@ -50,7 +52,8 @@ describe('provider/zeebe - MessageProps', function() {
5052
ModelingModule,
5153
BpmnPropertiesPanel,
5254
BpmnPropertiesProvider,
53-
ZeebePropertiesProvider
55+
ZeebePropertiesProvider,
56+
BehaviorsModule
5457
];
5558

5659
const moddleExtensions = {

0 commit comments

Comments
 (0)