fix(modeling): allow only bpmn:FlowNode(s) to be dropped on flow

Closes #297
This commit is contained in:
Nico Rehwaldt 2015-06-09 11:04:05 +02:00
parent 0a08433249
commit 749120c4e9
2 changed files with 25 additions and 1 deletions

View File

@ -399,5 +399,5 @@ function canInsert(shape, flow) {
return (
is(flow, 'bpmn:SequenceFlow') ||
is(flow, 'bpmn:MessageFlow')
) && canDrop(shape, flow.parent);
) && is(shape, 'bpmn:FlowNode') && canDrop(shape, flow.parent);
}

View File

@ -137,6 +137,30 @@ describe('modeling/behavior - drop on connection', function(){
{ original: { x: 502, y: 299 }, x: 502, y: 299 }
]);
}));
});
describe('rules', function() {
it('should not insert participant', inject(function(rules, elementRegistry, elementFactory) {
// given
var participantShape = elementFactory.createShape({ type: 'bpmn:Participant' });
var sequenceFlow = elementRegistry.get('SequenceFlow');
var position = { x: 340, y: 120 }; // first bendpoint
// when
var canDrop = rules.allowed('shape.create', {
shape: participantShape,
parent: sequenceFlow,
position: position
});
// then
expect(canDrop).toBe(false);
}));
});