I have 2 modelers, modelerA and modelerB. I have a list of IDs that only exist in modelerB’s elementRegistry. I want to copy these elements to modelerA
I have an array resB
that contains all the ids I want to copy to modelerA.
I’m doing this:
resB.forEach(function (element) {
el = elementRegistryB.get(element);
if (el.type === 'bpmn:SequenceFlow') {
modeling.createConnection(el.source, el.target, {
type: 'bpmn:SequenceFlow',
waypoints: el.waypoints,
businessObject: el.businessObject
}, el.parent);
}
try {
modeling.createShape(el, {
type: el.type,
x: el.x,
y: el.y,
width: el.width,
height: el.height,
businessObject: el.businessObject
}, el.parent);
} catch (e) {
modeling.create
}
});
elementRegistryB
is the registry of modelerB, where I’m copying from.
modeling
refers to modelerA, the target modeler I’m copying elements to.
I’m using these two graphs:
ModelA
ModelB
So I want to add the right hand side element called “Asignación de Suministros” and its connections.
What I get is this:
and, if I manually move Asignacion de Suministros, this:
Any help is much appreciated.