feat(modeling): ensure wrapping DataInput/Output in participant works

This commit is contained in:
Nico Rehwaldt 2019-03-29 11:17:13 +01:00 committed by merge-me[bot]
parent 8c49cb679b
commit fe9d4ff06d
2 changed files with 25 additions and 0 deletions

View File

@ -494,6 +494,10 @@ BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent,
if (is(businessObject, 'bpmn:DataInput') || is(businessObject, 'bpmn:DataOutput')) {
if (is(newParent, 'bpmn:Participant') && 'processRef' in newParent) {
newParent = newParent.processRef;
}
// already in correct ioSpecification
if ('ioSpecification' in newParent && newParent.ioSpecification === businessObject.$parent) {
return;

View File

@ -152,6 +152,27 @@ describe('features/modeling - move elements', function() {
});
}));
it('should wrap in participant', inject(
function(elementRegistry, elementFactory, modeling, canvas) {
// given
var dataInput = elementRegistry.get('DataInput');
var dataOutput = elementRegistry.get('DataOutput');
var processShape = canvas.getRootElement(),
processBo = processShape.businessObject,
participantShape = elementFactory.createParticipantShape(true);
// when
modeling.createShape(participantShape, { x: 350, y: 200 }, processShape);
// then
expect(dataInput.businessObject.$parent).to.eql(processBo.ioSpecification);
expect(dataOutput.businessObject.$parent).to.eql(processBo.ioSpecification);
}
));
});