Skip to content

[Bug Report]: 自定义节点导出后再导入渲染报错TypeError: Cannot read properties of undefined (reading 'anchors') #2120

@kenputon1

Description

@kenputon1

发生了什么?

自定义节点已添加 class FolderNodeModel extends RectNodeModel {
setAttributes() {
this.width = 90;
this.height = 50;
this.fontSize = 12;

}

}
lf.register({
type: 'FolderModel',
view: RectNode,
model: FolderNodeModel,
});导出内容为
<bpmn:definitions id="Definitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://logic-flow.org" exporter="logicflow" exporterVersion="1.2.10">
<bpmn:process isExecutable="true" id="Process">

bpmn:outgoingFlow_6a07189</bpmn:outgoing>


bpmn:incomingFlow_6a07189</bpmn:incoming>

<bpmn:sequenceFlow id="Flow_6a07189" sourceRef="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528" targetRef="6cd67c4d-8277-430a-87de-411d81274bce" isDefaultFlow="false" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process">
<bpmndi:BPMNEdge id="Flow_6a07189_di" bpmnElement="Flow_6a07189">
<di:waypoint x="355" y="100" />
<di:waypoint x="535" y="100" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528_di" bpmnElement="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528">
<dc:Bounds x="260" y="60" width="100" height="80" />
bpmndi:BPMNLabel
<dc:Bounds x="290" y="93" width="40" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="6cd67c4d-8277-430a-87de-411d81274bce_di" bpmnElement="6cd67c4d-8277-430a-87de-411d81274bce">
<dc:Bounds x="530" y="60" width="100" height="80" />
bpmndi:BPMNLabel
<dc:Bounds x="560" y="93" width="40" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
再次从后台加载render时报错
TypeError: Cannot read properties of undefined (reading 'anchors')
at Yu (chunk-6EA72NV3.js?v=cfcef300:10671:21)
at model.value (chunk-6EA72NV3.js?v=cfcef300:10860:30)
at model.value (chunk-6EA72NV3.js?v=cfcef300:10914:29)
at Ot (chunk-6EA72NV3.js?v=cfcef300:856:25)
at model.n2 (chunk-6EA72NV3.js?v=cfcef300:849:22)
at model.value (chunk-6EA72NV3.js?v=cfcef300:10829:147)
at model.value (chunk-6EA72NV3.js?v=cfcef300:11298:74)
at new t2 (chunk-6EA72NV3.js?v=cfcef300:10819:1019)
at model. (chunk-6EA72NV3.js?v=cfcef300:11249:28)
at new i2 (chunk-6EA72NV3.js?v=cfcef300:11295:39)

logicflow/core版本

1.2.27

logicflow/extension版本

1.2.27

logicflow/engine版本

No response

浏览器&环境

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions