WIP
This commit is contained in:
parent
973ac6e35a
commit
71416249d5
|
@ -1,6 +1,6 @@
|
|||
import inherits from 'inherits';
|
||||
|
||||
import { forEach } from 'min-dash';
|
||||
import { forEach, reduce } from 'min-dash';
|
||||
|
||||
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
||||
|
||||
|
@ -30,10 +30,14 @@ export default function ReplaceElementBehaviour(
|
|||
target = context.parent,
|
||||
elements = context.elements;
|
||||
|
||||
var canReplace = bpmnRules.canReplace(elements, target);
|
||||
var elementReplacements = reduce(elements, function(replacements, element) {
|
||||
var canReplace = bpmnRules.canReplace([ element ], element.host || element.parent || target);
|
||||
|
||||
if (canReplace) {
|
||||
this.replaceElements(elements, canReplace.replacements);
|
||||
return canReplace ? replacements.concat(canReplace.replacements) : replacements;
|
||||
}, []);
|
||||
|
||||
if (elementReplacements.length) {
|
||||
this.replaceElements(elements, elementReplacements);
|
||||
}
|
||||
}, this);
|
||||
|
||||
|
|
Loading…
Reference in New Issue