From 8370886bc2ede1fd6911b8f756a978ce9b5481b2 Mon Sep 17 00:00:00 2001 From: jdotzki Date: Sat, 17 May 2014 10:54:56 +0200 Subject: [PATCH] feat(bpmnrenderer): add conditional flow markers See #29 --- lib/draw/BpmnRenderer.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index 1c31a448..c4ba9f53 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -125,6 +125,26 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { 'stroke-width': 1, 'stroke-dasharray': '1,0' })); + + addMarker('conditional-flow-marker', + paper + .path('M 0,0 7.089123,3.1832974 0.00383366,6.1129516 -7.0814464,3.1832966 z') + .attr({ + 'fill': 'white', + 'stroke': 'Black' + }) + .marker(0, 0, 15, 15, 0, 0) + .attr({ + markerUnits: 'strokeWidth', + markerWidth: 14.296, + markerHeight: 7.238, + orient: 'auto', + overflow: 'visible', + 'stroke-width': 1, + 'stroke-dasharray': '1,0', + 'refX': -8, + 'refY': 3.15 + })); } function drawCircle(p, width, height, offset) { @@ -1046,6 +1066,12 @@ function BpmnRenderer(events, styles, bpmnRegistry, pathMap) { 'bpmn:SequenceFlow': function(p, data) { var polyline = drawLine(p, data.waypoints); + if(!!bpmnRegistry.getSemantic(data.id).conditionExpression) { + polyline.attr({ + 'marker-start': marker('conditional-flow-marker') + }); + } + return polyline.attr({ 'marker-end': marker('sequenceflow-end') });