Skip to content

Commit e831227

Browse files
nikkufake-join[bot]
authored andcommitted
fix(zeebe): correctly determine business rule task edited state
1 parent 41c466e commit e831227

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

src/provider/zeebe/properties/BusinessRuleImplementationProps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function getCalledDecision(element) {
136136
}
137137

138138
function isBusinessRuleImplementationEdited(element) {
139-
return getTaskDefinition(element);
139+
return getTaskDefinition(element) || getCalledDecision(element);
140140
}
141141

142142
function resetElement(element, commandStack) {

test/spec/provider/zeebe/BusinessRuleImplementationProps.spec.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ import zeebeModdleExtensions from 'zeebe-bpmn-moddle/resources/zeebe';
3434

3535
import diagramXML from './BusinessRuleImplementationProps.bpmn';
3636

37+
const GROUP_SELECTOR = '[data-group-id="group-businessRuleImplementation"]';
38+
const IMPLEMENTATION_SELECTOR = 'select[name=businessRuleImplementation]';
3739

38-
describe('provider/zeebe - TargetProps', function() {
40+
41+
describe('provider/zeebe - BusinessRuleImplementationProps', function() {
3942

4043
const testModules = [
4144
BpmnPropertiesPanel,
@@ -110,6 +113,9 @@ describe('provider/zeebe - TargetProps', function() {
110113
// then
111114
const implementation = getImplementationSelect(container);
112115
expect(implementation.value).to.equal('');
116+
117+
// and also
118+
return expectEdited(container, false);
113119
}));
114120

115121

@@ -126,6 +132,9 @@ describe('provider/zeebe - TargetProps', function() {
126132
// then
127133
const implementation = getImplementationSelect(container);
128134
expect(implementation.value).to.equal('dmn');
135+
136+
// and also
137+
return expectEdited(container, true);
129138
}));
130139

131140

@@ -142,6 +151,9 @@ describe('provider/zeebe - TargetProps', function() {
142151
// then
143152
const implementation = getImplementationSelect(container);
144153
expect(implementation.value).to.equal('jobWorker');
154+
155+
// and also
156+
return expectEdited(container, true);
145157
}));
146158

147159

@@ -334,7 +346,7 @@ describe('provider/zeebe - TargetProps', function() {
334346
// helper /////////////////
335347

336348
function getImplementationSelect(container) {
337-
return domQuery('select[name=businessRuleImplementation]', container);
349+
return domQuery(IMPLEMENTATION_SELECTOR, container);
338350
}
339351

340352
function getTaskDefinition(element) {
@@ -354,3 +366,20 @@ function getTaskHeaders(element) {
354366

355367
return getExtensionElementsList(businessObject, 'zeebe:TaskHeaders')[ 0 ];
356368
}
369+
370+
async function expectEdited(container, exists) {
371+
372+
await wait(50);
373+
374+
const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container);
375+
376+
if (exists) {
377+
expect(indicator).to.exist;
378+
} else {
379+
expect(indicator).not.to.exist;
380+
}
381+
}
382+
383+
function wait(ms) {
384+
return new Promise(resolve => setTimeout(resolve, ms));
385+
}

0 commit comments

Comments
 (0)