mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-22 23:08:49 +00:00
fix(rules): allow to create attachments
Related to https://github.com/camunda/camunda-modeler/issues/1462
This commit is contained in:
parent
2776cd8958
commit
6ed51fc036
@ -128,6 +128,10 @@ BpmnRules.prototype.init = function() {
|
||||
return canConnect(element.source, element.target, element);
|
||||
}
|
||||
|
||||
if (element.host) {
|
||||
return canAttach(element, element.host, null, position);
|
||||
}
|
||||
|
||||
return canCreate(element, target, null, position);
|
||||
});
|
||||
});
|
||||
|
@ -81,6 +81,36 @@ describe('features/modeling/rules - BpmnRules', function() {
|
||||
expectCanCreate([ task1, task2, sequenceFlow ], 'Process', false);
|
||||
}));
|
||||
|
||||
|
||||
it('create task and non-interrupting boundary event', inject(function(elementFactory) {
|
||||
|
||||
// given
|
||||
var task = elementFactory.createShape({ type: 'bpmn:Task' }),
|
||||
boundaryEvent = elementFactory.createShape({
|
||||
type: 'bpmn:BoundaryEvent',
|
||||
eventDefinitionType: 'bpmn:EscalationEventDefinition',
|
||||
cancelActivity: false,
|
||||
host: task
|
||||
});
|
||||
|
||||
// then
|
||||
expectCanCreate([ task, boundaryEvent ], 'Process', true);
|
||||
}));
|
||||
|
||||
|
||||
it('create task and interrupting boundary event', inject(function(elementFactory) {
|
||||
|
||||
// given
|
||||
var task = elementFactory.createShape({ type: 'bpmn:Task' }),
|
||||
boundaryEvent = elementFactory.createShape({
|
||||
type: 'bpmn:BoundaryEvent',
|
||||
eventDefinitionType: 'bpmn:EscalationEventDefinition',
|
||||
host: task
|
||||
});
|
||||
|
||||
// then
|
||||
expectCanCreate([ task, boundaryEvent ], 'Process', true);
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user