Skip to content

Commit

Permalink
feat(modeling): replace connection on reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Nov 14, 2019
1 parent 84c30f1 commit 0f7b8bc
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export default function ReplaceConnectionBehavior(eventBus, modeling, bpmnRules,
}, true);

this.preExecute([
'connection.reconnect',
'connection.reconnectStart',
'connection.reconnectEnd'
], replaceReconnectedConnection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,55 @@ describe('features/modeling - replace connection', 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
var task4Shape = element('Task_4');
Expand Down Expand Up @@ -116,26 +164,6 @@ describe('features/modeling - replace connection', function() {
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');
}));

});


Expand Down

0 comments on commit 0f7b8bc

Please sign in to comment.