fix(rules): allow data associations to be moved

Closes #454
This commit is contained in:
Nico Rehwaldt 2016-01-21 15:15:21 +01:00 committed by pedesen
parent acf9013bcb
commit eddd90727f
3 changed files with 60 additions and 1 deletions

View File

@ -358,7 +358,7 @@ function canDrop(element, target, position) {
// drop flow elements onto flow element containers // drop flow elements onto flow element containers
// and participants // and participants
if (is(element, 'bpmn:FlowElement')) { if (is(element, 'bpmn:FlowElement') || is(element, 'bpmn:DataAssociation')) {
if (is(target, 'bpmn:FlowElementsContainer')) { if (is(target, 'bpmn:FlowElementsContainer')) {
return isExpanded(target) !== false; return isExpanded(target) !== false;
} }

View File

@ -0,0 +1,33 @@
<?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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="Process" isExecutable="false">
<bpmn:dataObjectReference id="DataObjectReference" dataObjectRef="DataObject" />
<bpmn:dataObject id="DataObject" />
<bpmn:task id="Task">
<bpmn:dataOutputAssociation id="DataAssociation">
<bpmn:targetRef>DataObjectReference</bpmn:targetRef>
</bpmn:dataOutputAssociation>
</bpmn:task>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process">
<bpmndi:BPMNShape id="DataObjectReference_di" bpmnElement="DataObjectReference">
<dc:Bounds x="201" y="184" width="36" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="174" y="234" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="DataAssociation_di" bpmnElement="DataAssociation">
<di:waypoint xsi:type="dc:Point" x="47" y="60" />
<di:waypoint xsi:type="dc:Point" x="112" y="184" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Task_di" bpmnElement="Task">
<dc:Bounds x="52" y="36" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="DataAssociation_di" bpmnElement="DataAssociation">
<di:waypoint xsi:type="dc:Point" x="137" y="116" />
<di:waypoint xsi:type="dc:Point" x="201" y="189" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

View File

@ -756,6 +756,32 @@ describe('features/modeling/rules - BpmnRules', function() {
}); });
describe('data association move', function() {
var testXML = require('./BpmnRules.dataAssociation.bpmn');
beforeEach(bootstrapModeler(testXML, { modules: testModules }));
it('mode selection including data association', inject(function(elementRegistry) {
// when
var elements = [
elementRegistry.get('Task'),
elementRegistry.get('DataAssociation'),
elementRegistry.get('DataObjectReference')
];
// then
expectCanMove(elements, 'Process', {
attach: false,
move: true
});
}));
});
describe('event move', function() { describe('event move', function() {
var testXML = require('../../../fixtures/bpmn/boundary-events.bpmn'); var testXML = require('../../../fixtures/bpmn/boundary-events.bpmn');