Skip to content

Commit

Permalink
fix(modeling): do not remove sequence flow condition on type change
Browse files Browse the repository at this point in the history
* do not remove sequence flow condition when changing type to intermediate catch

Closes #1199
  • Loading branch information
ssoorriiin authored and philippfromme committed Sep 27, 2019
1 parent 2e80209 commit b290078
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
15 changes: 11 additions & 4 deletions lib/features/modeling/BpmnUpdater.js
Expand Up @@ -19,6 +19,10 @@ import {
is
} from '../../util/ModelUtil';

import {
isAny
} from './util/ModelingUtil';

import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

/**
Expand Down Expand Up @@ -248,10 +252,13 @@ export default function BpmnUpdater(

// on reconnectEnd -> conditional flow
if (oldTarget && (businessObject.conditionExpression) &&
!(is(newTarget, 'bpmn:Activity') ||
is(newTarget, 'bpmn:EndEvent') ||
is(newTarget, 'bpmn:Gateway') ||
is(newTarget, 'bpmn:IntermediateThrowEvent'))) {
!isAny(newTarget, [
'bpmn:Activity',
'bpmn:EndEvent',
'bpmn:Gateway',
'bpmn:IntermediateThrowEvent',
'bpmn:IntermediateCatchEvent'
])) {
context.conditionExpression = businessObject.conditionExpression;
businessObject.conditionExpression = undefined;
}
Expand Down
3 changes: 2 additions & 1 deletion test/spec/features/popup-menu/ReplaceMenuProviderSpec.js
Expand Up @@ -1817,7 +1817,8 @@ describe('features/popup-menu - replace menu provider', function() {
[
'bpmn:Activity',
'bpmn:EndEvent',
'bpmn:IntermediateThrowEvent'
'bpmn:IntermediateThrowEvent',
'bpmn:IntermediateCatchEvent'
].forEach(function(type) {

it('should keep ConditionalFlow when changing target to ' + type,
Expand Down

0 comments on commit b290078

Please sign in to comment.