feat(modeling): replace connection on reconnect
This commit is contained in:
parent
0ed0492641
commit
ca53ab56bb
|
@ -147,6 +147,7 @@ export default function ReplaceConnectionBehavior(eventBus, modeling, bpmnRules,
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
this.preExecute([
|
this.preExecute([
|
||||||
|
'connection.reconnect',
|
||||||
'connection.reconnectStart',
|
'connection.reconnectStart',
|
||||||
'connection.reconnectEnd'
|
'connection.reconnectEnd'
|
||||||
], replaceReconnectedConnection);
|
], replaceReconnectedConnection);
|
||||||
|
|
|
@ -69,7 +69,55 @@ describe('features/modeling - replace connection', function() {
|
||||||
|
|
||||||
describe('after reconnecting', function() {
|
describe('after reconnecting', function() {
|
||||||
|
|
||||||
it('sequence flow to another task', inject(function(elementRegistry, modeling) {
|
it('sequence flow from a participant', inject(function(modeling) {
|
||||||
|
|
||||||
|
// given
|
||||||
|
var participant2 = element('Participant_2'),
|
||||||
|
subProcess1 = element('SubProcess_1'),
|
||||||
|
connection = element('SequenceFlow_1');
|
||||||
|
|
||||||
|
var newWaypoints = [
|
||||||
|
{ x: participant2.x + 200, y: participant2.y },
|
||||||
|
{ x: subProcess1.x, y: subProcess1.y + 50 }
|
||||||
|
];
|
||||||
|
|
||||||
|
// when
|
||||||
|
modeling.reconnect(connection, participant2, connection.target, newWaypoints);
|
||||||
|
|
||||||
|
// then
|
||||||
|
expectConnected(participant2, subProcess1, 'bpmn:MessageFlow');
|
||||||
|
}));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
describe('after reconnecting start', function() {
|
||||||
|
|
||||||
|
it('sequence flow from a participant', inject(function(modeling) {
|
||||||
|
|
||||||
|
// given
|
||||||
|
var participant2 = element('Participant_2'),
|
||||||
|
subProcess1 = element('SubProcess_1'),
|
||||||
|
connection = element('SequenceFlow_1');
|
||||||
|
|
||||||
|
var newWaypoints = [
|
||||||
|
{ x: participant2.x + 200, y: participant2.y },
|
||||||
|
{ x: subProcess1.x, y: subProcess1.y + 50 }
|
||||||
|
];
|
||||||
|
|
||||||
|
// when
|
||||||
|
modeling.reconnectStart(connection, participant2, newWaypoints);
|
||||||
|
|
||||||
|
// then
|
||||||
|
expectConnected(participant2, subProcess1, 'bpmn:MessageFlow');
|
||||||
|
}));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
describe('after reconnecting end', function() {
|
||||||
|
|
||||||
|
it('sequence flow to another task', inject(function(modeling) {
|
||||||
|
|
||||||
// given
|
// given
|
||||||
var task4Shape = element('Task_4');
|
var task4Shape = element('Task_4');
|
||||||
|
@ -116,26 +164,6 @@ describe('features/modeling - replace connection', function() {
|
||||||
expectConnected(element('Task_2'), participant2, 'bpmn:MessageFlow');
|
expectConnected(element('Task_2'), participant2, 'bpmn:MessageFlow');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
it('sequence flow from a participant', inject(function(elementRegistry, modeling) {
|
|
||||||
|
|
||||||
// given
|
|
||||||
var participant2 = element('Participant_2'),
|
|
||||||
subProcess1 = element('SubProcess_1'),
|
|
||||||
connection = element('SequenceFlow_1');
|
|
||||||
|
|
||||||
var newWaypoints = [
|
|
||||||
{ x: participant2.x + 200, y: participant2.y },
|
|
||||||
{ x: subProcess1.x, y: subProcess1.y + 50 }
|
|
||||||
];
|
|
||||||
|
|
||||||
// when
|
|
||||||
modeling.reconnectStart(connection, participant2, newWaypoints);
|
|
||||||
|
|
||||||
// then
|
|
||||||
expectConnected(participant2, subProcess1, 'bpmn:MessageFlow');
|
|
||||||
}));
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue