I used Camunda Modeler to generate a diagram, which I then display in a webpage via bpmn-js-seed
, which seems to work fine.
My question is - how can I, if it is possible, style BPMN elements with a custom background color? For instance, say I have this in my code:
<bpmn:subProcess id="SubProcess_0zj28wh" name="hello">
<bpmn:incoming>SequenceFlow_104iphm</bpmn:incoming>
</bpmn:subProcess>
How could I make the subProcess rectangle to be, say, orange?
I’ve noticed that the bpmn-js
converts this code to SVG inline in the webpage:
<g class="djs-visual">
<rect fill="#ffffff" stroke="#000000" style="stroke-width: 2;" ry="10" rx="10" height="120" width="239" y="0" x="0"></rect>
<text class=" djs-label" style="font-family: Arial,sans-serif; font-size: 12px;">
<tspan y="19" x="106">hello</tspan>
</text>
</g>
… so the rect
has a fill
, but then the rect
has no id or class, so I could target it via CSS (and nowhere else in this code is there a mention of bpmn:subProcess
or SubProcess_0zj28wh
)
I looked a bit at yaoqiang-bpmn-editor
, which does support background colors of BPMN elements, and it uses something like this:
<startEvent id="_2" isInterrupting="true" name="Start Event" parallelMultiple="false">
<extensionElements>
<yaoqiang:style fillColor="#3333FF"/>
</extensionElements>
<outputSet/>
</startEvent>
… so it uses an extension to specify the background color, which is then ignored by both Camunda Modeler and bpmn-js
.
So can I - and how - style background colors, so they are visible in both Camunda Modeler and bpmn-js
?