We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如在label标签自定义在元素下方中的讨论,发现了另外一种可行的方法。
经查源码,在 ./node_modules/bpmn-js/lib/import/BpmnImporter.js 185行可知,
./node_modules/bpmn-js/lib/import/BpmnImporter.js
// line 185 // (optional) LABEL if (isLabelExternal(semantic) && semantic.name) { this.addLabel(semantic, element); }
而isLabelExternal定义在 ./node_modules/bpmn-js/lib/util/LabelUtil.js
./node_modules/bpmn-js/lib/util/LabelUtil.js
// 22 // Returns true if the given semantic has an external label // Params: // semantic: BpmnElement // Returns: // Boolean - true if has label export function isLabelExternal(semantic) { return is(semantic, 'bpmn:Event') || is(semantic, 'bpmn:Gateway') || is(semantic, 'bpmn:DataStoreReference') || is(semantic, 'bpmn:DataObjectReference') || is(semantic, 'bpmn:DataInput') || is(semantic, 'bpmn:DataOutput') || is(semantic, 'bpmn:SequenceFlow') || is(semantic, 'bpmn:MessageFlow') ; }
所以,event节点、gateway节点等标签在节点下方,而Task节点不是。
故,可以通过将我们的节点添加到isLabelExternal修改默认标签行为。
如果你有更好的办法,欢迎讨论。
The text was updated successfully, but these errors were encountered:
不错不错,好像还可以参考一下这里:https://juejin.cn/post/6983940380085452813
Sorry, something went wrong.
No branches or pull requests
如在label标签自定义在元素下方中的讨论,发现了另外一种可行的方法。
经查源码,在
./node_modules/bpmn-js/lib/import/BpmnImporter.js
185行可知,而isLabelExternal定义在
./node_modules/bpmn-js/lib/util/LabelUtil.js
所以,event节点、gateway节点等标签在节点下方,而Task节点不是。
故,可以通过将我们的节点添加到isLabelExternal修改默认标签行为。
如果你有更好的办法,欢迎讨论。
The text was updated successfully, but these errors were encountered: