fix(draw): render colored BPMN group elements

Related to https://github.com/camunda/camunda-modeler/issues/1598
This commit is contained in:
Nico Rehwaldt 2019-11-25 15:05:04 +01:00 committed by fake-join[bot]
parent be8cdd2d66
commit 6527e7d116
3 changed files with 26 additions and 0 deletions

View File

@ -1588,6 +1588,7 @@ export default function BpmnRenderer(
'bpmn:Group': function(parentGfx, element) { 'bpmn:Group': function(parentGfx, element) {
var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, { var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
stroke: getStrokeColor(element, defaultStrokeColor),
strokeWidth: 1, strokeWidth: 1,
strokeDasharray: '8,3,1,3', strokeDasharray: '8,3,1,3',
fill: 'none', fill: 'none',

View File

@ -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>

View File

@ -326,12 +326,18 @@ describe('draw - bpmn renderer', function() {
var xml = require('./BpmnRenderer.colors.bpmn'); var xml = require('./BpmnRenderer.colors.bpmn');
var groupXML = require('./BpmnRenderer.group-colors.bpmn');
it('should render colors without warnings and errors', function(done) { it('should render colors without warnings and errors', function(done) {
bootstrapViewer(xml).call(this, checkErrors(done)); bootstrapViewer(xml).call(this, checkErrors(done));
}); });
it('should render group colors', function(done) {
bootstrapViewer(groupXML).call(this, checkErrors(done));
});
describe('default colors', function() { describe('default colors', function() {
var defaultFillColor = 'red', var defaultFillColor = 'red',