前言
这一章节主要讲解的是关于bpmn.js
如何与后端交互,实现特定的线用特定的颜色
接口返回的数据
我们可以与后端协商,给每一个节点赋予一个id,我们就可以和id匹配赋予不同的class。
//customRenderer.less
.djs-connection {
.Activities.djs-visual {
path {
display: block !important;
stroke: #fdb039 !important;
stroke-dasharray: 8 !important; //间隔多少像素绘制一次 虚线
marker-end: url(#sequenceflow-arrow-activities) !important;
}
}
.unActivities.djs-visual {
path {
display: block !important;
stroke: #cccccc !important;
stroke-dasharray: 8 !important;
marker-end: url(#sequenceflow-arrow-normal) !important;
}
}
}
在http请求篇中,拿到的数据如下: