mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-22 13:48:16 +00:00
fix(bpmn-rules): allow to drop Boundary Events only on containers
Closes https://github.com/bpmn-io/bpmn-js/issues/1095
This commit is contained in:
parent
6aa0e5c95b
commit
890e466161
@ -479,10 +479,9 @@ function canDrop(element, target, position) {
|
||||
return is(target, 'bpmn:Participant') || is(target, 'bpmn:Lane');
|
||||
}
|
||||
|
||||
if (is(element, 'bpmn:BoundaryEvent')) {
|
||||
return getBusinessObject(element).cancelActivity && (
|
||||
hasNoEventDefinition(element) || hasCommonBoundaryIntermediateEventDefinition(element)
|
||||
);
|
||||
// disallow dropping boundary events which cannot replace with intermediate event
|
||||
if (is(element, 'bpmn:BoundaryEvent') && !isDroppableBoundaryEvent(element)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// drop flow elements onto flow element containers
|
||||
@ -517,6 +516,12 @@ function canDrop(element, target, position) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isDroppableBoundaryEvent(event) {
|
||||
return getBusinessObject(event).cancelActivity && (
|
||||
hasNoEventDefinition(event) || hasCommonBoundaryIntermediateEventDefinition(event)
|
||||
);
|
||||
}
|
||||
|
||||
function canPaste(tree, target) {
|
||||
var topLevel = tree[0],
|
||||
participants;
|
||||
|
@ -470,6 +470,10 @@ describe('features/modeling/rules - BpmnRules', function() {
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
it('drop BoundaryEvent -> Task', function() {
|
||||
expectCanDrop('BoundaryEvent_on_SubProcess', 'Task_in_OtherProcess', false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user