fix(modeling): allow only bpmn:FlowNode(s) to be dropped on flow
Closes #297
This commit is contained in:
parent
0a08433249
commit
749120c4e9
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue