mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-11 17:44:12 +00:00
parent
e2aaf342f7
commit
f363356fcb
@ -76,8 +76,12 @@ function BpmnTreeWalker(handler) {
|
|||||||
var bpmnElement = di.bpmnElement;
|
var bpmnElement = di.bpmnElement;
|
||||||
|
|
||||||
if (bpmnElement) {
|
if (bpmnElement) {
|
||||||
diRefs.bind(bpmnElement, 'di');
|
if (bpmnElement.di) {
|
||||||
bpmnElement.di = di;
|
logError('multiple DI elements defined for ' + elementToString(bpmnElement), { element: bpmnElement });
|
||||||
|
} else {
|
||||||
|
diRefs.bind(bpmnElement, 'di');
|
||||||
|
bpmnElement.di = di;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
logError('no bpmnElement referenced in ' + elementToString(di), { element: di });
|
logError('no bpmnElement referenced in ' + elementToString(di), { element: di });
|
||||||
}
|
}
|
||||||
|
24
test/fixtures/bpmn/error/multiple-dis.bpmn
vendored
Normal file
24
test/fixtures/bpmn/error/multiple-dis.bpmn
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
|
||||||
|
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
|
||||||
|
id="gateway-testcase"
|
||||||
|
targetNamespace="http://bpmn.io/schema/bpmn">
|
||||||
|
<bpmn:process id="Process_1">
|
||||||
|
<bpmn:inclusiveGateway id="InclusiveGateway_1"/>
|
||||||
|
</bpmn:process>
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
||||||
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
|
||||||
|
<bpmndi:BPMNShape id="_BPMNShape_InclusiveGateway_2" bpmnElement="InclusiveGateway_1">
|
||||||
|
<dc:Bounds height="50.0" width="50.0" x="114.0" y="99.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<!-- second DI element for InclusiveGateway_1 -->
|
||||||
|
<bpmndi:BPMNShape id="_BPMNShape_InclusiveGateway_2" bpmnElement="InclusiveGateway_1">
|
||||||
|
<dc:Bounds height="50.0" width="50.0" x="114.0" y="129.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</bpmn:definitions>
|
@ -277,6 +277,23 @@ describe('import - importer', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
it('should import multiple dis', function(done) {
|
||||||
|
|
||||||
|
// given
|
||||||
|
var xml = fs.readFileSync('test/fixtures/bpmn/error/multiple-dis.bpmn', 'utf8');
|
||||||
|
|
||||||
|
// when
|
||||||
|
runImport(diagram, xml, function(err, warnings) {
|
||||||
|
|
||||||
|
expect(warnings.length).toBe(1);
|
||||||
|
expect(warnings[0].message).toBe('multiple DI elements defined for <bpmn:InclusiveGateway id="InclusiveGateway_1" />');
|
||||||
|
|
||||||
|
done(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should extend missing attribute with default value', function(done) {
|
it('should extend missing attribute with default value', function(done) {
|
||||||
|
|
||||||
// given
|
// given
|
||||||
|
Loading…
x
Reference in New Issue
Block a user