Skip to content

Commit

Permalink
fix(draw): render colored BPMN group elements
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku authored and fake-join[bot] committed Nov 25, 2019
1 parent be8cdd2 commit 6527e7d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/draw/BpmnRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,7 @@ export default function BpmnRenderer(
'bpmn:Group': function(parentGfx, element) {

var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
stroke: getStrokeColor(element, defaultStrokeColor),
strokeWidth: 1,
strokeDasharray: '8,3,1,3',
fill: 'none',
Expand Down
19 changes: 19 additions & 0 deletions test/spec/draw/BpmnRenderer.group-colors.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions 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:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0" id="Definitions_1nek5tb" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.4.1">
<bpmn:process id="Process_12xkoyc" isExecutable="true">
<bpmn:group id="Group_08irt25" categoryValueRef="CategoryValue_16jt3xn" />
</bpmn:process>
<bpmn:category id="Category_1313spp">
<bpmn:categoryValue id="CategoryValue_16jt3xn" value="ASD" />
</bpmn:category>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_12xkoyc">
<bpmndi:BPMNShape id="Group_08irt25_di" bpmnElement="Group_08irt25" bioc:stroke="rgb(67, 160, 71)" bioc:fill="rgb(200, 230, 201)">
<dc:Bounds x="170" y="70" width="300" height="190" />
<bpmndi:BPMNLabel>
<dc:Bounds x="189" y="83" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
6 changes: 6 additions & 0 deletions test/spec/draw/BpmnRendererSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,18 @@ describe('draw - bpmn renderer', function() {

var xml = require('./BpmnRenderer.colors.bpmn');

var groupXML = require('./BpmnRenderer.group-colors.bpmn');

it('should render colors without warnings and errors', function(done) {
bootstrapViewer(xml).call(this, checkErrors(done));
});


it('should render group colors', function(done) {
bootstrapViewer(groupXML).call(this, checkErrors(done));
});


describe('default colors', function() {

var defaultFillColor = 'red',
Expand Down

0 comments on commit 6527e7d

Please sign in to comment.