mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-13 02:24:31 +00:00
cd24b27768
* use bpmnFactory for cloning to ensure all relevant elements have actual IDs * don't copy dataAssociations, as they are visual elements that will be created during element re-connection NOTE: This fixes data input association not properly being wired during target replace, too. Closes #694, #693
38 lines
661 B
JavaScript
38 lines
661 B
JavaScript
'use strict';
|
|
|
|
var forEach = require('lodash/collection/forEach');
|
|
|
|
/**
|
|
* These are the properties that should be ignored when cloning elements.
|
|
*
|
|
* @type {Array}
|
|
*/
|
|
module.exports.IGNORED_PROPERTIES = [
|
|
'lanes',
|
|
'incoming',
|
|
'outgoing',
|
|
'artifacts',
|
|
'default',
|
|
'flowElements',
|
|
'dataInputAssociations',
|
|
'dataOutputAssociations'
|
|
];
|
|
|
|
|
|
function getProperties(descriptor, keepDefault) {
|
|
var properties = [];
|
|
|
|
forEach(descriptor.properties, function(property) {
|
|
|
|
if (keepDefault && property.default) {
|
|
return;
|
|
}
|
|
|
|
properties.push(property.ns.name);
|
|
});
|
|
|
|
return properties;
|
|
}
|
|
|
|
module.exports.getProperties = getProperties;
|