//创建coustomProperties.josn文件
{ "name": "hlself", "uri": "https://hlself", "prefix": "flowable", "xml": { "tagAlias": "lowerCase" }, "types": [ { "name": "ExecutionListener",//首字母必须大写否则无法读取自定义节点 "superClass": [ "Element" ], "properties": [ { "name": "class", "type": "String", "isAttr": "true" }, { "name": "event", "type": "String", "isAttr": "true" }, { "name": "values", "type": "executionListenerProp", "isMany": true } ] } ] }
//引入自定义节点文件
import coustomEleProperties from "./coustomProperties.json"
//流程初始化加载进去
moddleExtensions: { //camunda右边工具栏 // camunda: camundaModdleDescriptor coustomEleProperties } })
//
const modeling = this.bpmnModeler.get('modeling'); const moddle = this.bpmnModeler.get('moddle'); var that = this; console.log(that.shape) //xml新增流转条件节点 const propItem = moddle.create("flowable:executionListener", { calss: this.zxdata, event: this.zxtype }); var extensionElements = moddle.create('bpmn:ExtensionElements', { values: [] }); extensionElements.values.push(propItem) modeling.updateProperties(that.shape, { extensionElements: extensionElements });
- THE END -
最后修改:2022年3月26日
非特殊说明,本博所有文章均为博主原创。
如若转载,请注明出处:https://www.95app.top/bpmnjs%e5%88%9b%e5%bb%ba%e5%ad%90%e5%85%83%e7%b4%a0/