feat(modeling): ensure wrapping DataInput/Output in participant works
This commit is contained in:
parent
8c49cb679b
commit
fe9d4ff06d
|
@ -494,6 +494,10 @@ BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent,
|
||||||
|
|
||||||
if (is(businessObject, 'bpmn:DataInput') || is(businessObject, 'bpmn:DataOutput')) {
|
if (is(businessObject, 'bpmn:DataInput') || is(businessObject, 'bpmn:DataOutput')) {
|
||||||
|
|
||||||
|
if (is(newParent, 'bpmn:Participant') && 'processRef' in newParent) {
|
||||||
|
newParent = newParent.processRef;
|
||||||
|
}
|
||||||
|
|
||||||
// already in correct ioSpecification
|
// already in correct ioSpecification
|
||||||
if ('ioSpecification' in newParent && newParent.ioSpecification === businessObject.$parent) {
|
if ('ioSpecification' in newParent && newParent.ioSpecification === businessObject.$parent) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue