Skip to content

Commit

Permalink
feat: integrate camunda-bpmn-js-behaviors@1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Oct 19, 2023
1 parent b898ce7 commit a06e55c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
31 changes: 18 additions & 13 deletions src/provider/zeebe/properties/MessageProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ function SubscriptionCorrelationKey(props) {
const setValue = (value) => {
const commands = [];

const properties = {
correlationKey: value
};

const message = getMessage(element);

let extensionElements = message.get('extensionElements');
Expand All @@ -132,13 +136,13 @@ function SubscriptionCorrelationKey(props) {
});
}

// (2) ensure subscription
let subscription = getSubscription(element);

// (2a) add subscription with correlation key
if (!subscription) {
subscription = createElement(
'zeebe:Subscription',
{ },
properties,
extensionElements,
bpmnFactory
);
Expand All @@ -153,19 +157,20 @@ function SubscriptionCorrelationKey(props) {
}
}
});
}
} else {

// (3) update subscription correlation key
commands.push({
cmd: 'element.updateModdleProperties',
context: {
element,
moddleElement: subscription,
properties: { correlationKey: value }
}
});
// (2b) update existing subscription's correlation key
commands.push({
cmd: 'element.updateModdleProperties',
context: {
element,
properties,
moddleElement: subscription
}
});
}

// (4) commit all updates
// (3) commit all updates
commandStack.execute('properties-panel.multi-command-executor', commands);
};

Expand Down
5 changes: 4 additions & 1 deletion test/spec/provider/zeebe/MessageProps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import TooltipProvider from 'src/contextProvider/zeebe/TooltipProvider';

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

import BehaviorsModule from 'camunda-bpmn-js-behaviors/lib/camunda-cloud';

import {
getExtensionElementsList
} from 'src/utils/ExtensionElementsUtil';
Expand All @@ -50,7 +52,8 @@ describe('provider/zeebe - MessageProps', function() {
ModelingModule,
BpmnPropertiesPanel,
BpmnPropertiesProvider,
ZeebePropertiesProvider
ZeebePropertiesProvider,
BehaviorsModule
];

const moddleExtensions = {
Expand Down

0 comments on commit a06e55c

Please sign in to comment.