From b5dfa8a89c474ee61e430008d4e7f31c04577d9c Mon Sep 17 00:00:00 2001 From: "Tuan N. Truong" Date: Mon, 25 Feb 2019 11:47:56 -0500 Subject: [PATCH] Fix sequence flow bug --- .../nodes/sequenceFlow/sequenceFlow.vue | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/nodes/sequenceFlow/sequenceFlow.vue b/src/components/nodes/sequenceFlow/sequenceFlow.vue index 0ddfa02e4..435c73205 100644 --- a/src/components/nodes/sequenceFlow/sequenceFlow.vue +++ b/src/components/nodes/sequenceFlow/sequenceFlow.vue @@ -85,6 +85,20 @@ export default { renderConditionExpression() { return !this.node.definition.conditionExpression.body ? '' : this.node.definition.conditionExpression.body; }, + createLabel() { + if (typeof this.node.definition.conditionExpression === 'undefined') { + return; + } + + this.shape.labels([{ + attrs: { + text: { + text: this.renderConditionExpression(), + }, + }, + position: expressionPosition, + }]); + }, }, mounted() { this.shape = new joint.shapes.standard.Link({ @@ -92,15 +106,7 @@ export default { name: 'orthogonal', }, }); - - this.shape.labels([{ - attrs: { - text: { - text: this.renderConditionExpression(), - }, - }, - position: expressionPosition, - }]); + this.createLabel(); }, };