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');
|
return is(target, 'bpmn:Participant') || is(target, 'bpmn:Lane');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is(element, 'bpmn:BoundaryEvent')) {
|
// disallow dropping boundary events which cannot replace with intermediate event
|
||||||
return getBusinessObject(element).cancelActivity && (
|
if (is(element, 'bpmn:BoundaryEvent') && !isDroppableBoundaryEvent(element)) {
|
||||||
hasNoEventDefinition(element) || hasCommonBoundaryIntermediateEventDefinition(element)
|
return false;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// drop flow elements onto flow element containers
|
// drop flow elements onto flow element containers
|
||||||
|
@ -517,6 +516,12 @@ function canDrop(element, target, position) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isDroppableBoundaryEvent(event) {
|
||||||
|
return getBusinessObject(event).cancelActivity && (
|
||||||
|
hasNoEventDefinition(event) || hasCommonBoundaryIntermediateEventDefinition(event)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function canPaste(tree, target) {
|
function canPaste(tree, target) {
|
||||||
var topLevel = tree[0],
|
var topLevel = tree[0],
|
||||||
participants;
|
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…
Reference in New Issue