ruoyi-vue-nocode/ruoyi-ui/ruoyi-bpmnjs/resources/properties-panel/helper/ElementHelper.js

24 lines
654 B
JavaScript
Raw Normal View History

2022-08-11 16:10:41 +08:00
'use strict';
var ElementHelper = {};
module.exports = ElementHelper;
/**
* Creates a new element and set the parent to it
*
* @method ElementHelper#createElement
*
* @param {String} elementType of the new element
* @param {Object} properties of the new element in key-value pairs
* @param {moddle.object} parent of the new element
* @param {BpmnFactory} factory which creates the new element
*
* @returns {djs.model.Base} element which is created
*/
ElementHelper.createElement = function(elementType, properties, parent, factory) {
var element = factory.create(elementType, properties);
element.$parent = parent;
return element;
};