Skip to content

Commit

Permalink
test: verify support for zeebe:AdHoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jarekdanielak authored Jan 23, 2025
1 parent bcb591d commit 6efc3cd
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 10 deletions.
17 changes: 8 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"sinon": "^17.0.1",
"sinon-chai": "^3.7.0",
"webpack": "^5.74.0",
"zeebe-bpmn-moddle": "^1.7.0"
"zeebe-bpmn-moddle": "^1.9.0"
},
"peerDependencies": {
"bpmn-js": ">= 9",
Expand Down
32 changes: 32 additions & 0 deletions test/camunda-cloud/ZeebeAdHocBehaviorSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {
bootstrapCamundaCloudModeler,
inject
} from 'test/TestHelper';

import { getExtensionElementsList } from 'lib/util/ExtensionElementsUtil';

import { getBusinessObject } from 'bpmn-js/lib/util/ModelUtil';

import diagramXML from './zeebe-ad-hoc.bpmn';


describe('camunda-cloud/features/modeling - ZeebeAdHocBehaviorSpec', function() {

beforeEach(bootstrapCamundaCloudModeler(diagramXML));

it('should remove zeebe:AdHoc for non ad-hoc sub process', inject(function(bpmnReplace, elementRegistry) {

// given
const subprocess = elementRegistry.get('Adhoc_Subprocess');

// when
const result = bpmnReplace.replaceElement(subprocess, {
type: 'bpmn:SubProcess'
});

// then
const extensionElements = getExtensionElementsList(getBusinessObject(result));
expect(extensionElements).to.have.lengthOf(0);
}));

});
38 changes: 38 additions & 0 deletions test/camunda-cloud/zeebe-ad-hoc.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" id="simple" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.30.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL bpmn0.xsd">
<bpmn:process id="Process_1" isExecutable="false">
<bpmn:adHocSubProcess id="Adhoc_Subprocess">
<bpmn:extensionElements>
<zeebe:adHoc activeElementsCollection="=items" />
</bpmn:extensionElements>
<bpmn:task id="Activity_1u00137" />
<bpmn:task id="Activity_0b2gnz4" />
</bpmn:adHocSubProcess>
<bpmn:subProcess id="Subprocess">
<bpmn:task id="Activity_170vlk4" />
<bpmn:task id="Activity_15c5abi" />
</bpmn:subProcess>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNShape id="BPMNShape_1pgqyy7" bpmnElement="Adhoc_Subprocess" isExpanded="true">
<dc:Bounds x="510" y="80" width="350" height="200" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_0w1g1io" bpmnElement="Activity_1u00137">
<dc:Bounds x="545" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_0r2twic" bpmnElement="Activity_0b2gnz4">
<dc:Bounds x="695" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1bhia20_di" bpmnElement="Subprocess" isExpanded="true">
<dc:Bounds x="125" y="80" width="350" height="200" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_170vlk4_di" bpmnElement="Activity_170vlk4">
<dc:Bounds x="160" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_15c5abi_di" bpmnElement="Activity_15c5abi">
<dc:Bounds x="310" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

0 comments on commit 6efc3cd

Please sign in to comment.