camunda-bpmn-js 3.6.1 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/diagram-js.css +1 -9
- package/dist/assets/properties-panel.css +17 -2
- package/dist/base-modeler.development.js +22788 -21639
- package/dist/base-modeler.production.min.js +33 -35
- package/dist/base-navigated-viewer.development.js +1414 -989
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +1414 -989
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +22518 -21273
- package/dist/camunda-cloud-modeler.production.min.js +34 -36
- package/dist/camunda-cloud-navigated-viewer.development.js +1414 -989
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +1414 -989
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +22736 -21513
- package/dist/camunda-platform-modeler.production.min.js +34 -36
- package/dist/camunda-platform-navigated-viewer.development.js +1414 -989
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +1414 -989
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/package.json +7 -7
|
@@ -1784,6 +1784,7 @@
|
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
1786
|
var black = 'hsl(225, 10%, 15%)';
|
|
1787
|
+
var white = 'white';
|
|
1787
1788
|
|
|
1788
1789
|
// element utils //////////////////////
|
|
1789
1790
|
|
|
@@ -1831,39 +1832,42 @@
|
|
|
1831
1832
|
/**
|
|
1832
1833
|
* @param {Element} element
|
|
1833
1834
|
* @param {string} [defaultColor]
|
|
1835
|
+
* @param {string} [overrideColor]
|
|
1834
1836
|
*
|
|
1835
1837
|
* @return {string}
|
|
1836
1838
|
*/
|
|
1837
|
-
function getFillColor(element, defaultColor) {
|
|
1839
|
+
function getFillColor(element, defaultColor, overrideColor) {
|
|
1838
1840
|
var di = getDi(element);
|
|
1839
1841
|
|
|
1840
|
-
return di.get('color:background-color') || di.get('bioc:fill') || defaultColor ||
|
|
1842
|
+
return overrideColor || di.get('color:background-color') || di.get('bioc:fill') || defaultColor || white;
|
|
1841
1843
|
}
|
|
1842
1844
|
|
|
1843
1845
|
/**
|
|
1844
1846
|
* @param {Element} element
|
|
1845
1847
|
* @param {string} [defaultColor]
|
|
1848
|
+
* @param {string} [overrideColor]
|
|
1846
1849
|
*
|
|
1847
1850
|
* @return {string}
|
|
1848
1851
|
*/
|
|
1849
|
-
function getStrokeColor(element, defaultColor) {
|
|
1852
|
+
function getStrokeColor(element, defaultColor, overrideColor) {
|
|
1850
1853
|
var di = getDi(element);
|
|
1851
1854
|
|
|
1852
|
-
return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
|
|
1855
|
+
return overrideColor || di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
|
|
1853
1856
|
}
|
|
1854
1857
|
|
|
1855
1858
|
/**
|
|
1856
1859
|
* @param {Element} element
|
|
1857
1860
|
* @param {string} [defaultColor]
|
|
1858
1861
|
* @param {string} [defaultStrokeColor]
|
|
1862
|
+
* @param {string} [overrideColor]
|
|
1859
1863
|
*
|
|
1860
1864
|
* @return {string}
|
|
1861
1865
|
*/
|
|
1862
|
-
function getLabelColor(element, defaultColor, defaultStrokeColor) {
|
|
1866
|
+
function getLabelColor(element, defaultColor, defaultStrokeColor, overrideColor) {
|
|
1863
1867
|
var di = getDi(element),
|
|
1864
1868
|
label = di.get('label');
|
|
1865
1869
|
|
|
1866
|
-
return label && label.get('color:color') || defaultColor ||
|
|
1870
|
+
return overrideColor || (label && label.get('color:color')) || defaultColor ||
|
|
1867
1871
|
getStrokeColor(element, defaultStrokeColor);
|
|
1868
1872
|
}
|
|
1869
1873
|
|
|
@@ -1967,6 +1971,45 @@
|
|
|
1967
1971
|
return componentsToPath(rectPath);
|
|
1968
1972
|
}
|
|
1969
1973
|
|
|
1974
|
+
/**
|
|
1975
|
+
* Get width and height from element or overrides.
|
|
1976
|
+
*
|
|
1977
|
+
* @param {Dimensions|Rect|Shape} bounds
|
|
1978
|
+
* @param {Object} overrides
|
|
1979
|
+
*
|
|
1980
|
+
* @returns {Dimensions}
|
|
1981
|
+
*/
|
|
1982
|
+
function getBounds(bounds, overrides = {}) {
|
|
1983
|
+
return {
|
|
1984
|
+
width: getWidth(bounds, overrides),
|
|
1985
|
+
height: getHeight(bounds, overrides)
|
|
1986
|
+
};
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* Get width from element or overrides.
|
|
1991
|
+
*
|
|
1992
|
+
* @param {Dimensions|Rect|Shape} bounds
|
|
1993
|
+
* @param {Object} overrides
|
|
1994
|
+
*
|
|
1995
|
+
* @returns {number}
|
|
1996
|
+
*/
|
|
1997
|
+
function getWidth(bounds, overrides = {}) {
|
|
1998
|
+
return has$1(overrides, 'width') ? overrides.width : bounds.width;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* Get height from element or overrides.
|
|
2003
|
+
*
|
|
2004
|
+
* @param {Dimensions|Rect|Shape} bounds
|
|
2005
|
+
* @param {Object} overrides
|
|
2006
|
+
*
|
|
2007
|
+
* @returns {number}
|
|
2008
|
+
*/
|
|
2009
|
+
function getHeight(bounds, overrides = {}) {
|
|
2010
|
+
return has$1(overrides, 'height') ? overrides.height : bounds.height;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
1970
2013
|
function _mergeNamespaces$1(n, m) {
|
|
1971
2014
|
m.forEach(function (e) {
|
|
1972
2015
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -2730,15 +2773,16 @@
|
|
|
2730
2773
|
}
|
|
2731
2774
|
};
|
|
2732
2775
|
|
|
2733
|
-
var
|
|
2776
|
+
var rendererIds = new Ids();
|
|
2734
2777
|
|
|
2735
|
-
var
|
|
2736
|
-
|
|
2778
|
+
var ELEMENT_LABEL_DISTANCE = 10,
|
|
2779
|
+
INNER_OUTER_DIST = 3,
|
|
2780
|
+
PARTICIPANT_STROKE_WIDTH = 1.5,
|
|
2781
|
+
TASK_BORDER_RADIUS = 10;
|
|
2737
2782
|
|
|
2738
|
-
var
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
var ELEMENT_LABEL_DISTANCE = 10;
|
|
2783
|
+
var DEFAULT_OPACITY = 0.95,
|
|
2784
|
+
FULL_OPACITY = 1,
|
|
2785
|
+
LOW_OPACITY = 0.25;
|
|
2742
2786
|
|
|
2743
2787
|
/**
|
|
2744
2788
|
* @typedef { Partial<{
|
|
@@ -2746,6 +2790,13 @@
|
|
|
2746
2790
|
* defaultStrokeColor: string,
|
|
2747
2791
|
* defaultLabelColor: string
|
|
2748
2792
|
* }> } BpmnRendererConfig
|
|
2793
|
+
*
|
|
2794
|
+
* @typedef { Partial<{
|
|
2795
|
+
* fill: string,
|
|
2796
|
+
* stroke: string,
|
|
2797
|
+
* width: string,
|
|
2798
|
+
* height: string
|
|
2799
|
+
* }> } Attrs
|
|
2749
2800
|
*/
|
|
2750
2801
|
|
|
2751
2802
|
/**
|
|
@@ -2773,7 +2824,7 @@
|
|
|
2773
2824
|
defaultStrokeColor = config && config.defaultStrokeColor,
|
|
2774
2825
|
defaultLabelColor = config && config.defaultLabelColor;
|
|
2775
2826
|
|
|
2776
|
-
var rendererId =
|
|
2827
|
+
var rendererId = rendererIds.next();
|
|
2777
2828
|
|
|
2778
2829
|
var markers = {};
|
|
2779
2830
|
|
|
@@ -2869,7 +2920,7 @@
|
|
|
2869
2920
|
cy: 6,
|
|
2870
2921
|
r: 3.5,
|
|
2871
2922
|
...shapeStyle({
|
|
2872
|
-
fill
|
|
2923
|
+
fill,
|
|
2873
2924
|
stroke: stroke,
|
|
2874
2925
|
strokeWidth: 1,
|
|
2875
2926
|
|
|
@@ -2889,7 +2940,7 @@
|
|
|
2889
2940
|
var messageflowEnd = create$1('path', {
|
|
2890
2941
|
d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z',
|
|
2891
2942
|
...shapeStyle({
|
|
2892
|
-
fill
|
|
2943
|
+
fill,
|
|
2893
2944
|
stroke: stroke,
|
|
2894
2945
|
strokeWidth: 1,
|
|
2895
2946
|
|
|
@@ -2910,7 +2961,7 @@
|
|
|
2910
2961
|
d: 'M 11 5 L 1 10 L 11 15',
|
|
2911
2962
|
...lineStyle({
|
|
2912
2963
|
fill: 'none',
|
|
2913
|
-
stroke
|
|
2964
|
+
stroke,
|
|
2914
2965
|
strokeWidth: 1.5,
|
|
2915
2966
|
|
|
2916
2967
|
// fix for safari / chrome / firefox bug not correctly
|
|
@@ -2931,7 +2982,7 @@
|
|
|
2931
2982
|
d: 'M 1 5 L 11 10 L 1 15',
|
|
2932
2983
|
...lineStyle({
|
|
2933
2984
|
fill: 'none',
|
|
2934
|
-
stroke
|
|
2985
|
+
stroke,
|
|
2935
2986
|
strokeWidth: 1.5,
|
|
2936
2987
|
|
|
2937
2988
|
// fix for safari / chrome / firefox bug not correctly
|
|
@@ -2951,7 +3002,7 @@
|
|
|
2951
3002
|
var conditionalFlowMarker = create$1('path', {
|
|
2952
3003
|
d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z',
|
|
2953
3004
|
...shapeStyle({
|
|
2954
|
-
fill
|
|
3005
|
+
fill,
|
|
2955
3006
|
stroke: stroke
|
|
2956
3007
|
})
|
|
2957
3008
|
});
|
|
@@ -2979,7 +3030,7 @@
|
|
|
2979
3030
|
}
|
|
2980
3031
|
}
|
|
2981
3032
|
|
|
2982
|
-
function drawCircle(parentGfx, width, height, offset, attrs) {
|
|
3033
|
+
function drawCircle(parentGfx, width, height, offset, attrs = {}) {
|
|
2983
3034
|
|
|
2984
3035
|
if (isObject(offset)) {
|
|
2985
3036
|
attrs = offset;
|
|
@@ -2990,10 +3041,6 @@
|
|
|
2990
3041
|
|
|
2991
3042
|
attrs = shapeStyle(attrs);
|
|
2992
3043
|
|
|
2993
|
-
if (attrs.fill === 'none') {
|
|
2994
|
-
delete attrs.fillOpacity;
|
|
2995
|
-
}
|
|
2996
|
-
|
|
2997
3044
|
var cx = width / 2,
|
|
2998
3045
|
cy = height / 2;
|
|
2999
3046
|
|
|
@@ -3093,7 +3140,6 @@
|
|
|
3093
3140
|
}
|
|
3094
3141
|
|
|
3095
3142
|
function drawPath(parentGfx, d, attrs) {
|
|
3096
|
-
|
|
3097
3143
|
attrs = lineStyle(attrs);
|
|
3098
3144
|
|
|
3099
3145
|
var path = create$1('path', {
|
|
@@ -3115,171 +3161,13 @@
|
|
|
3115
3161
|
}
|
|
3116
3162
|
|
|
3117
3163
|
function as(type) {
|
|
3118
|
-
return function(parentGfx, element,
|
|
3119
|
-
return renderer(type)(parentGfx, element,
|
|
3120
|
-
};
|
|
3121
|
-
}
|
|
3122
|
-
|
|
3123
|
-
function renderEventContent(element, parentGfx) {
|
|
3124
|
-
|
|
3125
|
-
var event = getBusinessObject(element);
|
|
3126
|
-
var isThrowing = isThrowEvent(event);
|
|
3127
|
-
|
|
3128
|
-
if (event.eventDefinitions && event.eventDefinitions.length > 1) {
|
|
3129
|
-
if (event.parallelMultiple) {
|
|
3130
|
-
return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, isThrowing);
|
|
3131
|
-
}
|
|
3132
|
-
else {
|
|
3133
|
-
return renderer('bpmn:MultipleEventDefinition')(parentGfx, element, isThrowing);
|
|
3134
|
-
}
|
|
3135
|
-
}
|
|
3136
|
-
|
|
3137
|
-
if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
|
|
3138
|
-
return renderer('bpmn:MessageEventDefinition')(parentGfx, element, isThrowing);
|
|
3139
|
-
}
|
|
3140
|
-
|
|
3141
|
-
if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
|
|
3142
|
-
return renderer('bpmn:TimerEventDefinition')(parentGfx, element, isThrowing);
|
|
3143
|
-
}
|
|
3144
|
-
|
|
3145
|
-
if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
|
|
3146
|
-
return renderer('bpmn:ConditionalEventDefinition')(parentGfx, element);
|
|
3147
|
-
}
|
|
3148
|
-
|
|
3149
|
-
if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
|
|
3150
|
-
return renderer('bpmn:SignalEventDefinition')(parentGfx, element, isThrowing);
|
|
3151
|
-
}
|
|
3152
|
-
|
|
3153
|
-
if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
|
|
3154
|
-
return renderer('bpmn:EscalationEventDefinition')(parentGfx, element, isThrowing);
|
|
3155
|
-
}
|
|
3156
|
-
|
|
3157
|
-
if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
|
|
3158
|
-
return renderer('bpmn:LinkEventDefinition')(parentGfx, element, isThrowing);
|
|
3159
|
-
}
|
|
3160
|
-
|
|
3161
|
-
if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
|
|
3162
|
-
return renderer('bpmn:ErrorEventDefinition')(parentGfx, element, isThrowing);
|
|
3163
|
-
}
|
|
3164
|
-
|
|
3165
|
-
if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
|
|
3166
|
-
return renderer('bpmn:CancelEventDefinition')(parentGfx, element, isThrowing);
|
|
3167
|
-
}
|
|
3168
|
-
|
|
3169
|
-
if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
|
|
3170
|
-
return renderer('bpmn:CompensateEventDefinition')(parentGfx, element, isThrowing);
|
|
3171
|
-
}
|
|
3172
|
-
|
|
3173
|
-
if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
|
|
3174
|
-
return renderer('bpmn:TerminateEventDefinition')(parentGfx, element, isThrowing);
|
|
3175
|
-
}
|
|
3176
|
-
|
|
3177
|
-
return null;
|
|
3178
|
-
}
|
|
3179
|
-
|
|
3180
|
-
function renderLabel(parentGfx, label, options) {
|
|
3181
|
-
|
|
3182
|
-
options = assign$1({
|
|
3183
|
-
size: {
|
|
3184
|
-
width: 100
|
|
3185
|
-
}
|
|
3186
|
-
}, options);
|
|
3187
|
-
|
|
3188
|
-
var text = textRenderer.createText(label || '', options);
|
|
3189
|
-
|
|
3190
|
-
classes$1(text).add('djs-label');
|
|
3191
|
-
|
|
3192
|
-
append(parentGfx, text);
|
|
3193
|
-
|
|
3194
|
-
return text;
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
function renderEmbeddedLabel(parentGfx, element, align) {
|
|
3198
|
-
var semantic = getBusinessObject(element);
|
|
3199
|
-
|
|
3200
|
-
return renderLabel(parentGfx, semantic.name, {
|
|
3201
|
-
box: element,
|
|
3202
|
-
align: align,
|
|
3203
|
-
padding: 7,
|
|
3204
|
-
style: {
|
|
3205
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3206
|
-
}
|
|
3207
|
-
});
|
|
3208
|
-
}
|
|
3209
|
-
|
|
3210
|
-
function renderExternalLabel(parentGfx, element) {
|
|
3211
|
-
|
|
3212
|
-
var box = {
|
|
3213
|
-
width: 90,
|
|
3214
|
-
height: 30,
|
|
3215
|
-
x: element.width / 2 + element.x,
|
|
3216
|
-
y: element.height / 2 + element.y
|
|
3164
|
+
return function(parentGfx, element, attrs) {
|
|
3165
|
+
return renderer(type)(parentGfx, element, attrs);
|
|
3217
3166
|
};
|
|
3218
|
-
|
|
3219
|
-
return renderLabel(parentGfx, getLabel(element), {
|
|
3220
|
-
box: box,
|
|
3221
|
-
fitBox: true,
|
|
3222
|
-
style: assign$1(
|
|
3223
|
-
{},
|
|
3224
|
-
textRenderer.getExternalStyle(),
|
|
3225
|
-
{
|
|
3226
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3227
|
-
}
|
|
3228
|
-
)
|
|
3229
|
-
});
|
|
3230
|
-
}
|
|
3231
|
-
|
|
3232
|
-
function renderLaneLabel(parentGfx, text, element) {
|
|
3233
|
-
var textBox = renderLabel(parentGfx, text, {
|
|
3234
|
-
box: {
|
|
3235
|
-
height: 30,
|
|
3236
|
-
width: element.height
|
|
3237
|
-
},
|
|
3238
|
-
align: 'center-middle',
|
|
3239
|
-
style: {
|
|
3240
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3241
|
-
}
|
|
3242
|
-
});
|
|
3243
|
-
|
|
3244
|
-
var top = -1 * element.height;
|
|
3245
|
-
|
|
3246
|
-
transform(textBox, 0, -top, 270);
|
|
3247
3167
|
}
|
|
3248
3168
|
|
|
3249
|
-
var
|
|
3250
|
-
'bpmn:
|
|
3251
|
-
|
|
3252
|
-
if (!('fillOpacity' in attrs)) {
|
|
3253
|
-
attrs.fillOpacity = DEFAULT_FILL_OPACITY;
|
|
3254
|
-
}
|
|
3255
|
-
|
|
3256
|
-
return drawCircle(parentGfx, element.width, element.height, attrs);
|
|
3257
|
-
},
|
|
3258
|
-
'bpmn:StartEvent': function(parentGfx, element, options) {
|
|
3259
|
-
var attrs = {
|
|
3260
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3261
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3262
|
-
};
|
|
3263
|
-
|
|
3264
|
-
var semantic = getBusinessObject(element);
|
|
3265
|
-
|
|
3266
|
-
if (!semantic.isInterrupting) {
|
|
3267
|
-
attrs = {
|
|
3268
|
-
strokeDasharray: '6',
|
|
3269
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3270
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3271
|
-
};
|
|
3272
|
-
}
|
|
3273
|
-
|
|
3274
|
-
var circle = renderer('bpmn:Event')(parentGfx, element, attrs);
|
|
3275
|
-
|
|
3276
|
-
if (!options || options.renderIcon !== false) {
|
|
3277
|
-
renderEventContent(element, parentGfx);
|
|
3278
|
-
}
|
|
3279
|
-
|
|
3280
|
-
return circle;
|
|
3281
|
-
},
|
|
3282
|
-
'bpmn:MessageEventDefinition': function(parentGfx, element, isThrowing) {
|
|
3169
|
+
var eventIconRenderers = {
|
|
3170
|
+
'bpmn:MessageEventDefinition': function(parentGfx, element, attrs = {}, isThrowing) {
|
|
3283
3171
|
var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
|
|
3284
3172
|
xScaleFactor: 0.9,
|
|
3285
3173
|
yScaleFactor: 0.9,
|
|
@@ -3291,22 +3179,27 @@
|
|
|
3291
3179
|
}
|
|
3292
3180
|
});
|
|
3293
3181
|
|
|
3294
|
-
var fill = isThrowing
|
|
3295
|
-
|
|
3182
|
+
var fill = isThrowing
|
|
3183
|
+
? getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3184
|
+
: getFillColor(element, defaultFillColor, attrs.fill);
|
|
3185
|
+
|
|
3186
|
+
var stroke = isThrowing
|
|
3187
|
+
? getFillColor(element, defaultFillColor, attrs.fill)
|
|
3188
|
+
: getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3296
3189
|
|
|
3297
3190
|
var messagePath = drawPath(parentGfx, pathData, {
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3191
|
+
fill,
|
|
3192
|
+
stroke,
|
|
3193
|
+
strokeWidth: 1
|
|
3301
3194
|
});
|
|
3302
3195
|
|
|
3303
3196
|
return messagePath;
|
|
3304
3197
|
},
|
|
3305
|
-
'bpmn:TimerEventDefinition': function(parentGfx, element) {
|
|
3198
|
+
'bpmn:TimerEventDefinition': function(parentGfx, element, attrs = {}) {
|
|
3306
3199
|
var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, {
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3200
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3201
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3202
|
+
strokeWidth: 2
|
|
3310
3203
|
});
|
|
3311
3204
|
|
|
3312
3205
|
var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
|
|
@@ -3321,12 +3214,11 @@
|
|
|
3321
3214
|
});
|
|
3322
3215
|
|
|
3323
3216
|
drawPath(parentGfx, pathData, {
|
|
3324
|
-
|
|
3325
|
-
|
|
3217
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3218
|
+
strokeWidth: 2
|
|
3326
3219
|
});
|
|
3327
3220
|
|
|
3328
|
-
for (var i = 0;i < 12; i++) {
|
|
3329
|
-
|
|
3221
|
+
for (var i = 0; i < 12; i++) {
|
|
3330
3222
|
var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
|
|
3331
3223
|
xScaleFactor: 0.75,
|
|
3332
3224
|
yScaleFactor: 0.75,
|
|
@@ -3338,19 +3230,19 @@
|
|
|
3338
3230
|
}
|
|
3339
3231
|
});
|
|
3340
3232
|
|
|
3341
|
-
var width = element.width / 2
|
|
3342
|
-
|
|
3233
|
+
var width = element.width / 2,
|
|
3234
|
+
height = element.height / 2;
|
|
3343
3235
|
|
|
3344
3236
|
drawPath(parentGfx, linePathData, {
|
|
3345
3237
|
strokeWidth: 1,
|
|
3346
|
-
|
|
3347
|
-
|
|
3238
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3239
|
+
transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
|
|
3348
3240
|
});
|
|
3349
3241
|
}
|
|
3350
3242
|
|
|
3351
3243
|
return circle;
|
|
3352
3244
|
},
|
|
3353
|
-
'bpmn:EscalationEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3245
|
+
'bpmn:EscalationEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3354
3246
|
var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
|
|
3355
3247
|
xScaleFactor: 1,
|
|
3356
3248
|
yScaleFactor: 1,
|
|
@@ -3362,15 +3254,17 @@
|
|
|
3362
3254
|
}
|
|
3363
3255
|
});
|
|
3364
3256
|
|
|
3365
|
-
var fill = isThrowing
|
|
3257
|
+
var fill = isThrowing
|
|
3258
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3259
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3366
3260
|
|
|
3367
3261
|
return drawPath(parentGfx, pathData, {
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3262
|
+
fill,
|
|
3263
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3264
|
+
strokeWidth: 1
|
|
3371
3265
|
});
|
|
3372
3266
|
},
|
|
3373
|
-
'bpmn:ConditionalEventDefinition': function(parentGfx, event) {
|
|
3267
|
+
'bpmn:ConditionalEventDefinition': function(parentGfx, event, attrs = {}) {
|
|
3374
3268
|
var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
|
|
3375
3269
|
xScaleFactor: 1,
|
|
3376
3270
|
yScaleFactor: 1,
|
|
@@ -3383,11 +3277,12 @@
|
|
|
3383
3277
|
});
|
|
3384
3278
|
|
|
3385
3279
|
return drawPath(parentGfx, pathData, {
|
|
3386
|
-
|
|
3387
|
-
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
3280
|
+
fill: getFillColor(event, defaultFillColor, attrs.fill),
|
|
3281
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3282
|
+
strokeWidth: 1
|
|
3388
3283
|
});
|
|
3389
3284
|
},
|
|
3390
|
-
'bpmn:LinkEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3285
|
+
'bpmn:LinkEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3391
3286
|
var pathData = pathMap.getScaledPath('EVENT_LINK', {
|
|
3392
3287
|
xScaleFactor: 1,
|
|
3393
3288
|
yScaleFactor: 1,
|
|
@@ -3399,15 +3294,17 @@
|
|
|
3399
3294
|
}
|
|
3400
3295
|
});
|
|
3401
3296
|
|
|
3402
|
-
var fill = isThrowing
|
|
3297
|
+
var fill = isThrowing
|
|
3298
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3299
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3403
3300
|
|
|
3404
3301
|
return drawPath(parentGfx, pathData, {
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3302
|
+
fill,
|
|
3303
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3304
|
+
strokeWidth: 1
|
|
3408
3305
|
});
|
|
3409
3306
|
},
|
|
3410
|
-
'bpmn:ErrorEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3307
|
+
'bpmn:ErrorEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3411
3308
|
var pathData = pathMap.getScaledPath('EVENT_ERROR', {
|
|
3412
3309
|
xScaleFactor: 1.1,
|
|
3413
3310
|
yScaleFactor: 1.1,
|
|
@@ -3419,15 +3316,17 @@
|
|
|
3419
3316
|
}
|
|
3420
3317
|
});
|
|
3421
3318
|
|
|
3422
|
-
var fill = isThrowing
|
|
3319
|
+
var fill = isThrowing
|
|
3320
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3321
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3423
3322
|
|
|
3424
3323
|
return drawPath(parentGfx, pathData, {
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3324
|
+
fill,
|
|
3325
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3326
|
+
strokeWidth: 1
|
|
3428
3327
|
});
|
|
3429
3328
|
},
|
|
3430
|
-
'bpmn:CancelEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3329
|
+
'bpmn:CancelEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3431
3330
|
var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
|
|
3432
3331
|
xScaleFactor: 1.0,
|
|
3433
3332
|
yScaleFactor: 1.0,
|
|
@@ -3439,19 +3338,19 @@
|
|
|
3439
3338
|
}
|
|
3440
3339
|
});
|
|
3441
3340
|
|
|
3442
|
-
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
3341
|
+
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor, attrs.stroke) : 'none';
|
|
3443
3342
|
|
|
3444
3343
|
var path = drawPath(parentGfx, pathData, {
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3344
|
+
fill,
|
|
3345
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3346
|
+
strokeWidth: 1
|
|
3448
3347
|
});
|
|
3449
3348
|
|
|
3450
3349
|
rotate(path, 45);
|
|
3451
3350
|
|
|
3452
3351
|
return path;
|
|
3453
3352
|
},
|
|
3454
|
-
'bpmn:CompensateEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3353
|
+
'bpmn:CompensateEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3455
3354
|
var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
|
|
3456
3355
|
xScaleFactor: 1,
|
|
3457
3356
|
yScaleFactor: 1,
|
|
@@ -3463,15 +3362,17 @@
|
|
|
3463
3362
|
}
|
|
3464
3363
|
});
|
|
3465
3364
|
|
|
3466
|
-
var fill = isThrowing
|
|
3365
|
+
var fill = isThrowing
|
|
3366
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3367
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3467
3368
|
|
|
3468
3369
|
return drawPath(parentGfx, pathData, {
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3370
|
+
fill,
|
|
3371
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3372
|
+
strokeWidth: 1
|
|
3472
3373
|
});
|
|
3473
3374
|
},
|
|
3474
|
-
'bpmn:SignalEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3375
|
+
'bpmn:SignalEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3475
3376
|
var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
|
|
3476
3377
|
xScaleFactor: 0.9,
|
|
3477
3378
|
yScaleFactor: 0.9,
|
|
@@ -3483,15 +3384,17 @@
|
|
|
3483
3384
|
}
|
|
3484
3385
|
});
|
|
3485
3386
|
|
|
3486
|
-
var fill = isThrowing
|
|
3387
|
+
var fill = isThrowing
|
|
3388
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3389
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3487
3390
|
|
|
3488
3391
|
return drawPath(parentGfx, pathData, {
|
|
3489
3392
|
strokeWidth: 1,
|
|
3490
|
-
fill
|
|
3491
|
-
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
3393
|
+
fill,
|
|
3394
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3492
3395
|
});
|
|
3493
3396
|
},
|
|
3494
|
-
'bpmn:MultipleEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3397
|
+
'bpmn:MultipleEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3495
3398
|
var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
|
|
3496
3399
|
xScaleFactor: 1.1,
|
|
3497
3400
|
yScaleFactor: 1.1,
|
|
@@ -3503,14 +3406,16 @@
|
|
|
3503
3406
|
}
|
|
3504
3407
|
});
|
|
3505
3408
|
|
|
3506
|
-
var fill = isThrowing
|
|
3409
|
+
var fill = isThrowing
|
|
3410
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3411
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3507
3412
|
|
|
3508
3413
|
return drawPath(parentGfx, pathData, {
|
|
3509
|
-
|
|
3510
|
-
|
|
3414
|
+
fill,
|
|
3415
|
+
strokeWidth: 1
|
|
3511
3416
|
});
|
|
3512
3417
|
},
|
|
3513
|
-
'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event) {
|
|
3418
|
+
'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event, attrs = {}) {
|
|
3514
3419
|
var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
|
|
3515
3420
|
xScaleFactor: 1.2,
|
|
3516
3421
|
yScaleFactor: 1.2,
|
|
@@ -3523,445 +3428,640 @@
|
|
|
3523
3428
|
});
|
|
3524
3429
|
|
|
3525
3430
|
return drawPath(parentGfx, pathData, {
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3431
|
+
fill: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3432
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3433
|
+
strokeWidth: 1
|
|
3529
3434
|
});
|
|
3530
3435
|
},
|
|
3531
|
-
'bpmn:
|
|
3532
|
-
var circle = renderer('bpmn:Event')(parentGfx, element, {
|
|
3533
|
-
strokeWidth: 4,
|
|
3534
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3535
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3536
|
-
});
|
|
3537
|
-
|
|
3538
|
-
if (!options || options.renderIcon !== false) {
|
|
3539
|
-
renderEventContent(element, parentGfx);
|
|
3540
|
-
}
|
|
3541
|
-
|
|
3542
|
-
return circle;
|
|
3543
|
-
},
|
|
3544
|
-
'bpmn:TerminateEventDefinition': function(parentGfx, element) {
|
|
3436
|
+
'bpmn:TerminateEventDefinition': function(parentGfx, element, attrs = {}) {
|
|
3545
3437
|
var circle = drawCircle(parentGfx, element.width, element.height, 8, {
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3438
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3439
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3440
|
+
strokeWidth: 4
|
|
3549
3441
|
});
|
|
3550
3442
|
|
|
3551
3443
|
return circle;
|
|
3552
|
-
}
|
|
3553
|
-
|
|
3554
|
-
var outer = renderer('bpmn:Event')(parentGfx, element, {
|
|
3555
|
-
strokeWidth: 1.5,
|
|
3556
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3557
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3558
|
-
});
|
|
3444
|
+
}
|
|
3445
|
+
};
|
|
3559
3446
|
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
fill: getFillColor(element, 'none'),
|
|
3564
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3565
|
-
});
|
|
3447
|
+
function renderEventIcon(element, parentGfx, attrs = {}) {
|
|
3448
|
+
var semantic = getBusinessObject(element),
|
|
3449
|
+
isThrowing = isThrowEvent(semantic);
|
|
3566
3450
|
|
|
3567
|
-
|
|
3568
|
-
|
|
3451
|
+
if (semantic.get('eventDefinitions') && semantic.get('eventDefinitions').length > 1) {
|
|
3452
|
+
if (semantic.get('parallelMultiple')) {
|
|
3453
|
+
return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3569
3454
|
}
|
|
3455
|
+
else {
|
|
3456
|
+
return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3570
3459
|
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
|
|
3575
|
-
|
|
3576
|
-
'bpmn:Activity': function(parentGfx, element, attrs) {
|
|
3460
|
+
if (isTypedEvent(semantic, 'bpmn:MessageEventDefinition')) {
|
|
3461
|
+
return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3462
|
+
}
|
|
3577
3463
|
|
|
3578
|
-
|
|
3464
|
+
if (isTypedEvent(semantic, 'bpmn:TimerEventDefinition')) {
|
|
3465
|
+
return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3466
|
+
}
|
|
3579
3467
|
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3468
|
+
if (isTypedEvent(semantic, 'bpmn:ConditionalEventDefinition')) {
|
|
3469
|
+
return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3470
|
+
}
|
|
3583
3471
|
|
|
3584
|
-
|
|
3585
|
-
|
|
3472
|
+
if (isTypedEvent(semantic, 'bpmn:SignalEventDefinition')) {
|
|
3473
|
+
return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3474
|
+
}
|
|
3586
3475
|
|
|
3587
|
-
'bpmn:
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3591
|
-
};
|
|
3476
|
+
if (isTypedEvent(semantic, 'bpmn:EscalationEventDefinition')) {
|
|
3477
|
+
return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3478
|
+
}
|
|
3592
3479
|
|
|
3593
|
-
|
|
3480
|
+
if (isTypedEvent(semantic, 'bpmn:LinkEventDefinition')) {
|
|
3481
|
+
return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3482
|
+
}
|
|
3594
3483
|
|
|
3595
|
-
|
|
3596
|
-
|
|
3484
|
+
if (isTypedEvent(semantic, 'bpmn:ErrorEventDefinition')) {
|
|
3485
|
+
return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3486
|
+
}
|
|
3597
3487
|
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
3488
|
+
if (isTypedEvent(semantic, 'bpmn:CancelEventDefinition')) {
|
|
3489
|
+
return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3490
|
+
}
|
|
3602
3491
|
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
y: 18
|
|
3607
|
-
}
|
|
3608
|
-
});
|
|
3492
|
+
if (isTypedEvent(semantic, 'bpmn:CompensateEventDefinition')) {
|
|
3493
|
+
return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3494
|
+
}
|
|
3609
3495
|
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3614
|
-
});
|
|
3496
|
+
if (isTypedEvent(semantic, 'bpmn:TerminateEventDefinition')) {
|
|
3497
|
+
return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3498
|
+
}
|
|
3615
3499
|
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
x: 17.2,
|
|
3619
|
-
y: 18
|
|
3620
|
-
}
|
|
3621
|
-
});
|
|
3500
|
+
return null;
|
|
3501
|
+
}
|
|
3622
3502
|
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3503
|
+
var taskMarkerRenderers = {
|
|
3504
|
+
'ParticipantMultiplicityMarker': function(parentGfx, element, attrs = {}) {
|
|
3505
|
+
var width = getWidth(element, attrs),
|
|
3506
|
+
height = getHeight(element, attrs);
|
|
3627
3507
|
|
|
3628
|
-
var
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3508
|
+
var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {
|
|
3509
|
+
xScaleFactor: 1,
|
|
3510
|
+
yScaleFactor: 1,
|
|
3511
|
+
containerWidth: width,
|
|
3512
|
+
containerHeight: height,
|
|
3513
|
+
position: {
|
|
3514
|
+
mx: ((width / 2 - 6) / width),
|
|
3515
|
+
my: (height - 15) / height
|
|
3632
3516
|
}
|
|
3633
3517
|
});
|
|
3634
3518
|
|
|
3635
|
-
|
|
3636
|
-
strokeWidth:
|
|
3637
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3638
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3519
|
+
drawMarker('participant-multiplicity', parentGfx, markerPath, {
|
|
3520
|
+
strokeWidth: 2,
|
|
3521
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3522
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3639
3523
|
});
|
|
3640
|
-
|
|
3641
|
-
return task;
|
|
3642
3524
|
},
|
|
3643
|
-
'
|
|
3644
|
-
var
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
|
|
3650
|
-
abspos: {
|
|
3651
|
-
x: x,
|
|
3652
|
-
y: y
|
|
3653
|
-
}
|
|
3525
|
+
'SubProcessMarker': function(parentGfx, element, attrs = {}) {
|
|
3526
|
+
var markerRect = drawRect(parentGfx, 14, 14, 0, {
|
|
3527
|
+
strokeWidth: 1,
|
|
3528
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3529
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3654
3530
|
});
|
|
3655
3531
|
|
|
3656
|
-
|
|
3657
|
-
strokeWidth: 0.5,
|
|
3658
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3659
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3660
|
-
});
|
|
3532
|
+
translate$1(markerRect, element.width / 2 - 7.5, element.height - 20);
|
|
3661
3533
|
|
|
3662
|
-
var
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3534
|
+
var markerPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
|
|
3535
|
+
xScaleFactor: 1.5,
|
|
3536
|
+
yScaleFactor: 1.5,
|
|
3537
|
+
containerWidth: element.width,
|
|
3538
|
+
containerHeight: element.height,
|
|
3539
|
+
position: {
|
|
3540
|
+
mx: (element.width / 2 - 7.5) / element.width,
|
|
3541
|
+
my: (element.height - 20) / element.height
|
|
3666
3542
|
}
|
|
3667
3543
|
});
|
|
3668
3544
|
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3545
|
+
drawMarker('sub-process', parentGfx, markerPath, {
|
|
3546
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3547
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3673
3548
|
});
|
|
3549
|
+
},
|
|
3550
|
+
'ParallelMarker': function(parentGfx, element, attrs) {
|
|
3551
|
+
var width = getWidth(element, attrs),
|
|
3552
|
+
height = getHeight(element, attrs);
|
|
3674
3553
|
|
|
3675
|
-
var
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3554
|
+
var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {
|
|
3555
|
+
xScaleFactor: 1,
|
|
3556
|
+
yScaleFactor: 1,
|
|
3557
|
+
containerWidth: width,
|
|
3558
|
+
containerHeight: height,
|
|
3559
|
+
position: {
|
|
3560
|
+
mx: ((width / 2 + attrs.parallel) / width),
|
|
3561
|
+
my: (height - 20) / height
|
|
3679
3562
|
}
|
|
3680
3563
|
});
|
|
3681
3564
|
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3565
|
+
drawMarker('parallel', parentGfx, markerPath, {
|
|
3566
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3567
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3686
3568
|
});
|
|
3687
|
-
|
|
3688
|
-
return task;
|
|
3689
3569
|
},
|
|
3690
|
-
'
|
|
3691
|
-
var
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3570
|
+
'SequentialMarker': function(parentGfx, element, attrs) {
|
|
3571
|
+
var markerPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
|
|
3572
|
+
xScaleFactor: 1,
|
|
3573
|
+
yScaleFactor: 1,
|
|
3574
|
+
containerWidth: element.width,
|
|
3575
|
+
containerHeight: element.height,
|
|
3576
|
+
position: {
|
|
3577
|
+
mx: ((element.width / 2 + attrs.seq) / element.width),
|
|
3578
|
+
my: (element.height - 19) / element.height
|
|
3697
3579
|
}
|
|
3698
3580
|
});
|
|
3699
3581
|
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3582
|
+
drawMarker('sequential', parentGfx, markerPath, {
|
|
3583
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3584
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3704
3585
|
});
|
|
3705
|
-
|
|
3706
|
-
return task;
|
|
3707
3586
|
},
|
|
3708
|
-
'
|
|
3709
|
-
var
|
|
3710
|
-
|
|
3711
|
-
var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
3587
|
+
'CompensationMarker': function(parentGfx, element, attrs) {
|
|
3588
|
+
var markerMath = pathMap.getScaledPath('MARKER_COMPENSATION', {
|
|
3712
3589
|
xScaleFactor: 1,
|
|
3713
3590
|
yScaleFactor: 1,
|
|
3714
|
-
containerWidth:
|
|
3715
|
-
containerHeight:
|
|
3591
|
+
containerWidth: element.width,
|
|
3592
|
+
containerHeight: element.height,
|
|
3716
3593
|
position: {
|
|
3717
|
-
mx:
|
|
3718
|
-
my:
|
|
3594
|
+
mx: ((element.width / 2 + attrs.compensation) / element.width),
|
|
3595
|
+
my: (element.height - 13) / element.height
|
|
3719
3596
|
}
|
|
3720
3597
|
});
|
|
3721
3598
|
|
|
3722
|
-
|
|
3723
|
-
strokeWidth: 1,
|
|
3724
|
-
fill: getStrokeColor(element, defaultStrokeColor),
|
|
3725
|
-
stroke: getFillColor(element, defaultFillColor)
|
|
3726
|
-
});
|
|
3727
|
-
|
|
3728
|
-
return task;
|
|
3729
|
-
},
|
|
3730
|
-
'bpmn:ReceiveTask' : function(parentGfx, element) {
|
|
3731
|
-
var semantic = getBusinessObject(element);
|
|
3732
|
-
|
|
3733
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
3734
|
-
var pathData;
|
|
3735
|
-
|
|
3736
|
-
if (semantic.instantiate) {
|
|
3737
|
-
drawCircle(parentGfx, 28, 28, 20 * 0.22, { strokeWidth: 1 });
|
|
3738
|
-
|
|
3739
|
-
pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
|
|
3740
|
-
abspos: {
|
|
3741
|
-
x: 7.77,
|
|
3742
|
-
y: 9.52
|
|
3743
|
-
}
|
|
3744
|
-
});
|
|
3745
|
-
} else {
|
|
3746
|
-
|
|
3747
|
-
pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
3748
|
-
xScaleFactor: 0.9,
|
|
3749
|
-
yScaleFactor: 0.9,
|
|
3750
|
-
containerWidth: 21,
|
|
3751
|
-
containerHeight: 14,
|
|
3752
|
-
position: {
|
|
3753
|
-
mx: 0.3,
|
|
3754
|
-
my: 0.4
|
|
3755
|
-
}
|
|
3756
|
-
});
|
|
3757
|
-
}
|
|
3758
|
-
|
|
3759
|
-
/* receive path */ drawPath(parentGfx, pathData, {
|
|
3599
|
+
drawMarker('compensation', parentGfx, markerMath, {
|
|
3760
3600
|
strokeWidth: 1,
|
|
3761
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3762
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3601
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3602
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3763
3603
|
});
|
|
3764
|
-
|
|
3765
|
-
return task;
|
|
3766
3604
|
},
|
|
3767
|
-
'
|
|
3768
|
-
var
|
|
3605
|
+
'LoopMarker': function(parentGfx, element, attrs) {
|
|
3606
|
+
var width = getWidth(element, attrs),
|
|
3607
|
+
height = getHeight(element, attrs);
|
|
3769
3608
|
|
|
3770
|
-
var
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3609
|
+
var markerPath = pathMap.getScaledPath('MARKER_LOOP', {
|
|
3610
|
+
xScaleFactor: 1,
|
|
3611
|
+
yScaleFactor: 1,
|
|
3612
|
+
containerWidth: width,
|
|
3613
|
+
containerHeight: height,
|
|
3614
|
+
position: {
|
|
3615
|
+
mx: ((width / 2 + attrs.loop) / width),
|
|
3616
|
+
my: (height - 7) / height
|
|
3774
3617
|
}
|
|
3775
3618
|
});
|
|
3776
3619
|
|
|
3777
|
-
|
|
3778
|
-
strokeWidth: 1,
|
|
3779
|
-
|
|
3620
|
+
drawMarker('loop', parentGfx, markerPath, {
|
|
3621
|
+
strokeWidth: 1.5,
|
|
3622
|
+
fill: 'none',
|
|
3623
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3624
|
+
strokeMiterlimit: 0.5
|
|
3780
3625
|
});
|
|
3781
|
-
|
|
3782
|
-
return task;
|
|
3783
3626
|
},
|
|
3784
|
-
'
|
|
3785
|
-
var
|
|
3627
|
+
'AdhocMarker': function(parentGfx, element, attrs) {
|
|
3628
|
+
var width = getWidth(element, attrs),
|
|
3629
|
+
height = getHeight(element, attrs);
|
|
3786
3630
|
|
|
3787
|
-
var
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3631
|
+
var markerPath = pathMap.getScaledPath('MARKER_ADHOC', {
|
|
3632
|
+
xScaleFactor: 1,
|
|
3633
|
+
yScaleFactor: 1,
|
|
3634
|
+
containerWidth: width,
|
|
3635
|
+
containerHeight: height,
|
|
3636
|
+
position: {
|
|
3637
|
+
mx: ((width / 2 + attrs.adhoc) / width),
|
|
3638
|
+
my: (height - 15) / height
|
|
3791
3639
|
}
|
|
3792
3640
|
});
|
|
3793
3641
|
|
|
3794
|
-
|
|
3795
|
-
attr$1(businessHeaderPath, {
|
|
3642
|
+
drawMarker('adhoc', parentGfx, markerPath, {
|
|
3796
3643
|
strokeWidth: 1,
|
|
3797
|
-
fill:
|
|
3798
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3644
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3645
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3799
3646
|
});
|
|
3647
|
+
}
|
|
3648
|
+
};
|
|
3800
3649
|
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
y: 8
|
|
3805
|
-
}
|
|
3806
|
-
});
|
|
3650
|
+
function renderTaskMarker(type, parentGfx, element, attrs) {
|
|
3651
|
+
taskMarkerRenderers[ type ](parentGfx, element, attrs);
|
|
3652
|
+
}
|
|
3807
3653
|
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3654
|
+
function renderTaskMarkers(parentGfx, element, taskMarkers, attrs = {}) {
|
|
3655
|
+
attrs = {
|
|
3656
|
+
fill: attrs.fill,
|
|
3657
|
+
stroke: attrs.stroke,
|
|
3658
|
+
width: getWidth(element, attrs),
|
|
3659
|
+
height: getHeight(element, attrs)
|
|
3660
|
+
};
|
|
3813
3661
|
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3662
|
+
var semantic = getBusinessObject(element);
|
|
3663
|
+
|
|
3664
|
+
var subprocess = taskMarkers && taskMarkers.includes('SubProcessMarker');
|
|
3665
|
+
|
|
3666
|
+
if (subprocess) {
|
|
3817
3667
|
attrs = {
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3668
|
+
...attrs,
|
|
3669
|
+
seq: -21,
|
|
3670
|
+
parallel: -22,
|
|
3671
|
+
compensation: -42,
|
|
3672
|
+
loop: -18,
|
|
3673
|
+
adhoc: 10
|
|
3821
3674
|
};
|
|
3675
|
+
} else {
|
|
3676
|
+
attrs = {
|
|
3677
|
+
...attrs,
|
|
3678
|
+
seq: -5,
|
|
3679
|
+
parallel: -6,
|
|
3680
|
+
compensation: -27,
|
|
3681
|
+
loop: 0,
|
|
3682
|
+
adhoc: 10
|
|
3683
|
+
};
|
|
3684
|
+
}
|
|
3822
3685
|
|
|
3823
|
-
|
|
3686
|
+
forEach$1(taskMarkers, function(marker) {
|
|
3687
|
+
renderTaskMarker(marker, parentGfx, element, attrs);
|
|
3688
|
+
});
|
|
3824
3689
|
|
|
3825
|
-
|
|
3690
|
+
if (semantic.get('isForCompensation')) {
|
|
3691
|
+
renderTaskMarker('CompensationMarker', parentGfx, element, attrs);
|
|
3692
|
+
}
|
|
3826
3693
|
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3694
|
+
if (is$1(semantic, 'bpmn:AdHocSubProcess')) {
|
|
3695
|
+
renderTaskMarker('AdhocMarker', parentGfx, element, attrs);
|
|
3696
|
+
}
|
|
3697
|
+
|
|
3698
|
+
var loopCharacteristics = semantic.get('loopCharacteristics'),
|
|
3699
|
+
isSequential = loopCharacteristics && loopCharacteristics.get('isSequential');
|
|
3700
|
+
|
|
3701
|
+
if (loopCharacteristics) {
|
|
3702
|
+
|
|
3703
|
+
if (isSequential === undefined) {
|
|
3704
|
+
renderTaskMarker('LoopMarker', parentGfx, element, attrs);
|
|
3832
3705
|
}
|
|
3833
3706
|
|
|
3834
|
-
|
|
3707
|
+
if (isSequential === false) {
|
|
3708
|
+
renderTaskMarker('ParallelMarker', parentGfx, element, attrs);
|
|
3709
|
+
}
|
|
3835
3710
|
|
|
3836
|
-
if (
|
|
3837
|
-
|
|
3838
|
-
} else {
|
|
3839
|
-
attachTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ]);
|
|
3711
|
+
if (isSequential === true) {
|
|
3712
|
+
renderTaskMarker('SequentialMarker', parentGfx, element, attrs);
|
|
3840
3713
|
}
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3841
3716
|
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
var outer = renderer('bpmn:SubProcess')(parentGfx, element, { strokeWidth: 1.5 });
|
|
3717
|
+
function renderLabel(parentGfx, label, attrs = {}) {
|
|
3718
|
+
attrs = assign$1({
|
|
3719
|
+
size: {
|
|
3720
|
+
width: 100
|
|
3721
|
+
}
|
|
3722
|
+
}, attrs);
|
|
3849
3723
|
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3724
|
+
var text = textRenderer.createText(label || '', attrs);
|
|
3725
|
+
|
|
3726
|
+
classes$1(text).add('djs-label');
|
|
3727
|
+
|
|
3728
|
+
append(parentGfx, text);
|
|
3729
|
+
|
|
3730
|
+
return text;
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
function renderEmbeddedLabel(parentGfx, element, align, attrs = {}) {
|
|
3734
|
+
var semantic = getBusinessObject(element);
|
|
3735
|
+
|
|
3736
|
+
var box = getBounds({
|
|
3737
|
+
x: element.x,
|
|
3738
|
+
y: element.y,
|
|
3739
|
+
width: element.width,
|
|
3740
|
+
height: element.height
|
|
3741
|
+
}, attrs);
|
|
3742
|
+
|
|
3743
|
+
return renderLabel(parentGfx, semantic.name, {
|
|
3744
|
+
align,
|
|
3745
|
+
box,
|
|
3746
|
+
padding: 7,
|
|
3747
|
+
style: {
|
|
3748
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3749
|
+
}
|
|
3750
|
+
});
|
|
3751
|
+
}
|
|
3752
|
+
|
|
3753
|
+
function renderExternalLabel(parentGfx, element, attrs = {}) {
|
|
3754
|
+
var box = {
|
|
3755
|
+
width: 90,
|
|
3756
|
+
height: 30,
|
|
3757
|
+
x: element.width / 2 + element.x,
|
|
3758
|
+
y: element.height / 2 + element.y
|
|
3759
|
+
};
|
|
3760
|
+
|
|
3761
|
+
return renderLabel(parentGfx, getLabel(element), {
|
|
3762
|
+
box: box,
|
|
3763
|
+
fitBox: true,
|
|
3764
|
+
style: assign$1(
|
|
3765
|
+
{},
|
|
3766
|
+
textRenderer.getExternalStyle(),
|
|
3767
|
+
{
|
|
3768
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3769
|
+
}
|
|
3770
|
+
)
|
|
3771
|
+
});
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
function renderLaneLabel(parentGfx, text, element, attrs = {}) {
|
|
3775
|
+
var textBox = renderLabel(parentGfx, text, {
|
|
3776
|
+
box: {
|
|
3777
|
+
height: 30,
|
|
3778
|
+
width: getHeight(element, attrs),
|
|
3779
|
+
},
|
|
3780
|
+
align: 'center-middle',
|
|
3781
|
+
style: {
|
|
3782
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3783
|
+
}
|
|
3784
|
+
});
|
|
3785
|
+
|
|
3786
|
+
var top = -1 * getHeight(element, attrs);
|
|
3787
|
+
|
|
3788
|
+
transform(textBox, 0, -top, 270);
|
|
3789
|
+
}
|
|
3790
|
+
|
|
3791
|
+
function renderActivity(parentGfx, element, attrs = {}) {
|
|
3792
|
+
var {
|
|
3793
|
+
width,
|
|
3794
|
+
height
|
|
3795
|
+
} = getBounds(element, attrs);
|
|
3796
|
+
|
|
3797
|
+
return drawRect(parentGfx, width, height, TASK_BORDER_RADIUS, {
|
|
3798
|
+
...attrs,
|
|
3799
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3800
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3801
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3802
|
+
});
|
|
3803
|
+
}
|
|
3804
|
+
|
|
3805
|
+
function renderAssociation(parentGfx, element, attrs = {}) {
|
|
3806
|
+
var semantic = getBusinessObject(element);
|
|
3807
|
+
|
|
3808
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
3809
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3810
|
+
|
|
3811
|
+
if (semantic.get('associationDirection') === 'One' ||
|
|
3812
|
+
semantic.get('associationDirection') === 'Both') {
|
|
3813
|
+
attrs.markerEnd = marker('association-end', fill, stroke);
|
|
3814
|
+
}
|
|
3815
|
+
|
|
3816
|
+
if (semantic.get('associationDirection') === 'Both') {
|
|
3817
|
+
attrs.markerStart = marker('association-start', fill, stroke);
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
attrs = pickAttrs(attrs, [
|
|
3821
|
+
'markerStart',
|
|
3822
|
+
'markerEnd'
|
|
3823
|
+
]);
|
|
3824
|
+
|
|
3825
|
+
return drawConnectionSegments(parentGfx, element.waypoints, {
|
|
3826
|
+
...attrs,
|
|
3827
|
+
stroke,
|
|
3828
|
+
strokeDasharray: '0, 5'
|
|
3829
|
+
});
|
|
3830
|
+
}
|
|
3831
|
+
|
|
3832
|
+
function renderDataObject(parentGfx, element, attrs = {}) {
|
|
3833
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
3834
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3835
|
+
|
|
3836
|
+
var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
|
|
3837
|
+
xScaleFactor: 1,
|
|
3838
|
+
yScaleFactor: 1,
|
|
3839
|
+
containerWidth: element.width,
|
|
3840
|
+
containerHeight: element.height,
|
|
3841
|
+
position: {
|
|
3842
|
+
mx: 0.474,
|
|
3843
|
+
my: 0.296
|
|
3844
|
+
}
|
|
3845
|
+
});
|
|
3846
|
+
|
|
3847
|
+
var dataObject = drawPath(parentGfx, pathData, {
|
|
3848
|
+
fill,
|
|
3849
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3850
|
+
stroke
|
|
3851
|
+
});
|
|
3852
|
+
|
|
3853
|
+
var semantic = getBusinessObject(element);
|
|
3854
|
+
|
|
3855
|
+
if (isCollection(semantic)) {
|
|
3856
|
+
var collectionPathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
|
|
3857
|
+
xScaleFactor: 1,
|
|
3858
|
+
yScaleFactor: 1,
|
|
3859
|
+
containerWidth: element.width,
|
|
3860
|
+
containerHeight: element.height,
|
|
3861
|
+
position: {
|
|
3862
|
+
mx: 0.33,
|
|
3863
|
+
my: (element.height - 18) / element.height
|
|
3864
|
+
}
|
|
3853
3865
|
});
|
|
3854
3866
|
|
|
3855
|
-
|
|
3867
|
+
drawPath(parentGfx, collectionPathData, {
|
|
3868
|
+
strokeWidth: 2,
|
|
3869
|
+
fill,
|
|
3870
|
+
stroke
|
|
3871
|
+
});
|
|
3872
|
+
}
|
|
3856
3873
|
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3874
|
+
return dataObject;
|
|
3875
|
+
}
|
|
3876
|
+
|
|
3877
|
+
function renderEvent(parentGfx, element, attrs = {}) {
|
|
3878
|
+
return drawCircle(parentGfx, element.width, element.height, {
|
|
3879
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3880
|
+
...attrs,
|
|
3881
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3882
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3883
|
+
});
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3886
|
+
function renderGateway(parentGfx, element, attrs = {}) {
|
|
3887
|
+
return drawDiamond(parentGfx, element.width, element.height, {
|
|
3888
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3889
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3890
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3891
|
+
});
|
|
3892
|
+
}
|
|
3893
|
+
|
|
3894
|
+
function renderLane(parentGfx, element, attrs = {}) {
|
|
3895
|
+
var lane = drawRect(parentGfx, getWidth(element, attrs), getHeight(element, attrs), 0, {
|
|
3896
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3897
|
+
fillOpacity: attrs.fillOpacity || DEFAULT_OPACITY,
|
|
3898
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3899
|
+
strokeWidth: 1.5
|
|
3900
|
+
});
|
|
3901
|
+
|
|
3902
|
+
var semantic = getBusinessObject(element);
|
|
3903
|
+
|
|
3904
|
+
if (is$1(semantic, 'bpmn:Lane')) {
|
|
3905
|
+
var text = semantic.get('name');
|
|
3906
|
+
|
|
3907
|
+
renderLaneLabel(parentGfx, text, element, attrs);
|
|
3908
|
+
}
|
|
3909
|
+
|
|
3910
|
+
return lane;
|
|
3911
|
+
}
|
|
3912
|
+
|
|
3913
|
+
function renderSubProcess(parentGfx, element, attrs = {}) {
|
|
3914
|
+
var activity = renderActivity(parentGfx, element, attrs);
|
|
3915
|
+
|
|
3916
|
+
if (isEventSubProcess(element)) {
|
|
3917
|
+
attr$1(activity, {
|
|
3918
|
+
strokeDasharray: '0, 5.5',
|
|
3919
|
+
strokeWidth: 2.5
|
|
3862
3920
|
});
|
|
3863
|
-
}
|
|
3864
|
-
'bpmn:Participant': function(parentGfx, element) {
|
|
3921
|
+
}
|
|
3865
3922
|
|
|
3866
|
-
|
|
3923
|
+
var expanded = isExpanded(element);
|
|
3867
3924
|
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3925
|
+
renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle', attrs);
|
|
3926
|
+
|
|
3927
|
+
if (expanded) {
|
|
3928
|
+
renderTaskMarkers(parentGfx, element, undefined, attrs);
|
|
3929
|
+
} else {
|
|
3930
|
+
renderTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ], attrs);
|
|
3931
|
+
}
|
|
3874
3932
|
|
|
3875
|
-
|
|
3933
|
+
return activity;
|
|
3934
|
+
}
|
|
3876
3935
|
|
|
3877
|
-
|
|
3936
|
+
function renderTask(parentGfx, element, attrs = {}) {
|
|
3937
|
+
var activity = renderActivity(parentGfx, element, attrs);
|
|
3878
3938
|
|
|
3879
|
-
|
|
3880
|
-
drawLine(parentGfx, [
|
|
3881
|
-
{ x: 30, y: 0 },
|
|
3882
|
-
{ x: 30, y: element.height }
|
|
3883
|
-
], {
|
|
3884
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3885
|
-
strokeWidth
|
|
3886
|
-
});
|
|
3887
|
-
var text = getBusinessObject(element).name;
|
|
3888
|
-
renderLaneLabel(parentGfx, text, element);
|
|
3889
|
-
} else {
|
|
3939
|
+
renderEmbeddedLabel(parentGfx, element, 'center-middle', attrs);
|
|
3890
3940
|
|
|
3891
|
-
|
|
3892
|
-
var text2 = getBusinessObject(element).name;
|
|
3893
|
-
renderLabel(parentGfx, text2, {
|
|
3894
|
-
box: element, align: 'center-middle',
|
|
3895
|
-
style: {
|
|
3896
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3897
|
-
}
|
|
3898
|
-
});
|
|
3899
|
-
}
|
|
3941
|
+
renderTaskMarkers(parentGfx, element, undefined, attrs);
|
|
3900
3942
|
|
|
3901
|
-
|
|
3943
|
+
return activity;
|
|
3944
|
+
}
|
|
3902
3945
|
|
|
3903
|
-
|
|
3904
|
-
|
|
3946
|
+
var handlers = this.handlers = {
|
|
3947
|
+
'bpmn:AdHocSubProcess': function(parentGfx, element, attrs = {}) {
|
|
3948
|
+
if (isExpanded(element)) {
|
|
3949
|
+
attrs = pickAttrs(attrs, [
|
|
3950
|
+
'fill',
|
|
3951
|
+
'stroke',
|
|
3952
|
+
'width',
|
|
3953
|
+
'height'
|
|
3954
|
+
]);
|
|
3955
|
+
} else {
|
|
3956
|
+
attrs = pickAttrs(attrs, [
|
|
3957
|
+
'fill',
|
|
3958
|
+
'stroke'
|
|
3959
|
+
]);
|
|
3905
3960
|
}
|
|
3906
3961
|
|
|
3907
|
-
return
|
|
3962
|
+
return renderSubProcess(parentGfx, element, attrs);
|
|
3908
3963
|
},
|
|
3909
|
-
'bpmn:
|
|
3910
|
-
|
|
3911
|
-
fill
|
|
3912
|
-
|
|
3913
|
-
|
|
3964
|
+
'bpmn:Association': function(parentGfx, element, attrs = {}) {
|
|
3965
|
+
attrs = pickAttrs(attrs, [
|
|
3966
|
+
'fill',
|
|
3967
|
+
'stroke'
|
|
3968
|
+
]);
|
|
3969
|
+
|
|
3970
|
+
return renderAssociation(parentGfx, element, attrs);
|
|
3971
|
+
},
|
|
3972
|
+
'bpmn:BoundaryEvent': function(parentGfx, element, attrs = {}) {
|
|
3973
|
+
var { renderIcon = true } = attrs;
|
|
3974
|
+
|
|
3975
|
+
attrs = pickAttrs(attrs, [
|
|
3976
|
+
'fill',
|
|
3977
|
+
'stroke'
|
|
3978
|
+
]);
|
|
3979
|
+
|
|
3980
|
+
var semantic = getBusinessObject(element),
|
|
3981
|
+
cancelActivity = semantic.get('cancelActivity');
|
|
3982
|
+
|
|
3983
|
+
attrs = {
|
|
3914
3984
|
strokeWidth: 1.5,
|
|
3915
|
-
|
|
3916
|
-
|
|
3985
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3986
|
+
fillOpacity: FULL_OPACITY,
|
|
3987
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3988
|
+
};
|
|
3917
3989
|
|
|
3918
|
-
|
|
3990
|
+
if (!cancelActivity) {
|
|
3991
|
+
attrs.strokeDasharray = '6';
|
|
3992
|
+
}
|
|
3919
3993
|
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3994
|
+
var event = renderEvent(parentGfx, element, attrs);
|
|
3995
|
+
|
|
3996
|
+
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {
|
|
3997
|
+
...attrs,
|
|
3998
|
+
fill: 'none'
|
|
3999
|
+
});
|
|
4000
|
+
|
|
4001
|
+
if (renderIcon) {
|
|
4002
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
3923
4003
|
}
|
|
3924
4004
|
|
|
3925
|
-
return
|
|
4005
|
+
return event;
|
|
3926
4006
|
},
|
|
3927
|
-
'bpmn:
|
|
3928
|
-
|
|
4007
|
+
'bpmn:BusinessRuleTask': function(parentGfx, element, attrs = {}) {
|
|
4008
|
+
attrs = pickAttrs(attrs, [
|
|
4009
|
+
'fill',
|
|
4010
|
+
'stroke'
|
|
4011
|
+
]);
|
|
3929
4012
|
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
4013
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4014
|
+
|
|
4015
|
+
var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
|
|
4016
|
+
abspos: {
|
|
4017
|
+
x: 8,
|
|
4018
|
+
y: 8
|
|
4019
|
+
}
|
|
3935
4020
|
});
|
|
3936
4021
|
|
|
3937
|
-
|
|
3938
|
-
},
|
|
3939
|
-
'bpmn:ExclusiveGateway': function(parentGfx, element) {
|
|
3940
|
-
var diamond = renderer('bpmn:Gateway')(parentGfx, element);
|
|
4022
|
+
var businessPath = drawPath(parentGfx, headerData);
|
|
3941
4023
|
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
4024
|
+
attr$1(businessPath, {
|
|
4025
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4026
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4027
|
+
strokeWidth: 1
|
|
4028
|
+
});
|
|
4029
|
+
|
|
4030
|
+
var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
|
|
4031
|
+
abspos: {
|
|
4032
|
+
x: 8,
|
|
4033
|
+
y: 8
|
|
3950
4034
|
}
|
|
3951
4035
|
});
|
|
3952
4036
|
|
|
3953
|
-
|
|
3954
|
-
drawPath(parentGfx, pathData, {
|
|
3955
|
-
strokeWidth: 1,
|
|
3956
|
-
fill: getStrokeColor(element, defaultStrokeColor),
|
|
3957
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3958
|
-
});
|
|
3959
|
-
}
|
|
4037
|
+
var businessHeaderPath = drawPath(parentGfx, headerPathData);
|
|
3960
4038
|
|
|
3961
|
-
|
|
4039
|
+
attr$1(businessHeaderPath, {
|
|
4040
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4041
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4042
|
+
strokeWidth: 1
|
|
4043
|
+
});
|
|
4044
|
+
|
|
4045
|
+
return task;
|
|
4046
|
+
},
|
|
4047
|
+
'bpmn:CallActivity': function(parentGfx, element, attrs = {}) {
|
|
4048
|
+
attrs = pickAttrs(attrs, [
|
|
4049
|
+
'fill',
|
|
4050
|
+
'stroke'
|
|
4051
|
+
]);
|
|
4052
|
+
|
|
4053
|
+
return renderSubProcess(parentGfx, element, {
|
|
4054
|
+
strokeWidth: 5,
|
|
4055
|
+
...attrs
|
|
4056
|
+
});
|
|
3962
4057
|
},
|
|
3963
|
-
'bpmn:ComplexGateway': function(parentGfx, element) {
|
|
3964
|
-
|
|
4058
|
+
'bpmn:ComplexGateway': function(parentGfx, element, attrs = {}) {
|
|
4059
|
+
attrs = pickAttrs(attrs, [
|
|
4060
|
+
'fill',
|
|
4061
|
+
'stroke'
|
|
4062
|
+
]);
|
|
4063
|
+
|
|
4064
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
3965
4065
|
|
|
3966
4066
|
var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
|
|
3967
4067
|
xScaleFactor: 0.5,
|
|
@@ -3974,50 +4074,142 @@
|
|
|
3974
4074
|
}
|
|
3975
4075
|
});
|
|
3976
4076
|
|
|
3977
|
-
|
|
4077
|
+
drawPath(parentGfx, pathData, {
|
|
4078
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4079
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4080
|
+
strokeWidth: 1
|
|
4081
|
+
});
|
|
4082
|
+
|
|
4083
|
+
return gateway;
|
|
4084
|
+
},
|
|
4085
|
+
'bpmn:DataInput': function(parentGfx, element, attrs = {}) {
|
|
4086
|
+
attrs = pickAttrs(attrs, [
|
|
4087
|
+
'fill',
|
|
4088
|
+
'stroke'
|
|
4089
|
+
]);
|
|
4090
|
+
|
|
4091
|
+
var arrowPathData = pathMap.getRawPath('DATA_ARROW');
|
|
4092
|
+
|
|
4093
|
+
var dataObject = renderDataObject(parentGfx, element, attrs);
|
|
4094
|
+
|
|
4095
|
+
drawPath(parentGfx, arrowPathData, {
|
|
4096
|
+
fill: 'none',
|
|
4097
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4098
|
+
strokeWidth: 1
|
|
4099
|
+
});
|
|
4100
|
+
|
|
4101
|
+
return dataObject;
|
|
4102
|
+
},
|
|
4103
|
+
'bpmn:DataInputAssociation': function(parentGfx, element, attrs = {}) {
|
|
4104
|
+
attrs = pickAttrs(attrs, [
|
|
4105
|
+
'fill',
|
|
4106
|
+
'stroke'
|
|
4107
|
+
]);
|
|
4108
|
+
|
|
4109
|
+
return renderAssociation(parentGfx, element, {
|
|
4110
|
+
...attrs,
|
|
4111
|
+
markerEnd: marker('association-end', getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke))
|
|
4112
|
+
});
|
|
4113
|
+
},
|
|
4114
|
+
'bpmn:DataObject': function(parentGfx, element, attrs = {}) {
|
|
4115
|
+
attrs = pickAttrs(attrs, [
|
|
4116
|
+
'fill',
|
|
4117
|
+
'stroke'
|
|
4118
|
+
]);
|
|
4119
|
+
|
|
4120
|
+
return renderDataObject(parentGfx, element, attrs);
|
|
4121
|
+
},
|
|
4122
|
+
'bpmn:DataObjectReference': as('bpmn:DataObject'),
|
|
4123
|
+
'bpmn:DataOutput': function(parentGfx, element, attrs = {}) {
|
|
4124
|
+
attrs = pickAttrs(attrs, [
|
|
4125
|
+
'fill',
|
|
4126
|
+
'stroke'
|
|
4127
|
+
]);
|
|
4128
|
+
|
|
4129
|
+
var arrowPathData = pathMap.getRawPath('DATA_ARROW');
|
|
4130
|
+
|
|
4131
|
+
var dataObject = renderDataObject(parentGfx, element, attrs);
|
|
4132
|
+
|
|
4133
|
+
drawPath(parentGfx, arrowPathData, {
|
|
3978
4134
|
strokeWidth: 1,
|
|
3979
|
-
fill:
|
|
3980
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4135
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4136
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3981
4137
|
});
|
|
3982
4138
|
|
|
3983
|
-
return
|
|
4139
|
+
return dataObject;
|
|
3984
4140
|
},
|
|
3985
|
-
'bpmn:
|
|
3986
|
-
|
|
4141
|
+
'bpmn:DataOutputAssociation': function(parentGfx, element, attrs = {}) {
|
|
4142
|
+
attrs = pickAttrs(attrs, [
|
|
4143
|
+
'fill',
|
|
4144
|
+
'stroke'
|
|
4145
|
+
]);
|
|
3987
4146
|
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
4147
|
+
return renderAssociation(parentGfx, element, {
|
|
4148
|
+
...attrs,
|
|
4149
|
+
markerEnd: marker('association-end', getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke))
|
|
4150
|
+
});
|
|
4151
|
+
},
|
|
4152
|
+
'bpmn:DataStoreReference': function(parentGfx, element, attrs = {}) {
|
|
4153
|
+
attrs = pickAttrs(attrs, [
|
|
4154
|
+
'fill',
|
|
4155
|
+
'stroke'
|
|
4156
|
+
]);
|
|
4157
|
+
|
|
4158
|
+
var dataStorePath = pathMap.getScaledPath('DATA_STORE', {
|
|
4159
|
+
xScaleFactor: 1,
|
|
4160
|
+
yScaleFactor: 1,
|
|
3991
4161
|
containerWidth: element.width,
|
|
3992
4162
|
containerHeight: element.height,
|
|
3993
4163
|
position: {
|
|
3994
|
-
mx: 0
|
|
3995
|
-
my: 0.
|
|
4164
|
+
mx: 0,
|
|
4165
|
+
my: 0.133
|
|
3996
4166
|
}
|
|
3997
4167
|
});
|
|
3998
4168
|
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4169
|
+
return drawPath(parentGfx, dataStorePath, {
|
|
4170
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4171
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
4172
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4173
|
+
strokeWidth: 2
|
|
4003
4174
|
});
|
|
4175
|
+
},
|
|
4176
|
+
'bpmn:EndEvent': function(parentGfx, element, attrs = {}) {
|
|
4177
|
+
var { renderIcon = true } = attrs;
|
|
4004
4178
|
|
|
4005
|
-
|
|
4179
|
+
attrs = pickAttrs(attrs, [
|
|
4180
|
+
'fill',
|
|
4181
|
+
'stroke'
|
|
4182
|
+
]);
|
|
4183
|
+
|
|
4184
|
+
var event = renderEvent(parentGfx, element, {
|
|
4185
|
+
...attrs,
|
|
4186
|
+
strokeWidth: 4
|
|
4187
|
+
});
|
|
4188
|
+
|
|
4189
|
+
if (renderIcon) {
|
|
4190
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4193
|
+
return event;
|
|
4006
4194
|
},
|
|
4007
|
-
'bpmn:EventBasedGateway': function(parentGfx, element) {
|
|
4195
|
+
'bpmn:EventBasedGateway': function(parentGfx, element, attrs = {}) {
|
|
4196
|
+
attrs = pickAttrs(attrs, [
|
|
4197
|
+
'fill',
|
|
4198
|
+
'stroke'
|
|
4199
|
+
]);
|
|
4008
4200
|
|
|
4009
4201
|
var semantic = getBusinessObject(element);
|
|
4010
4202
|
|
|
4011
|
-
var diamond =
|
|
4203
|
+
var diamond = renderGateway(parentGfx, element, attrs);
|
|
4012
4204
|
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4205
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.20, {
|
|
4206
|
+
fill: getFillColor(element, 'none', attrs.fill),
|
|
4207
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4208
|
+
strokeWidth: 1
|
|
4017
4209
|
});
|
|
4018
4210
|
|
|
4019
|
-
var type = semantic.eventGatewayType
|
|
4020
|
-
|
|
4211
|
+
var type = semantic.get('eventGatewayType'),
|
|
4212
|
+
instantiate = !!semantic.get('instantiate');
|
|
4021
4213
|
|
|
4022
4214
|
function drawEvent() {
|
|
4023
4215
|
|
|
@@ -4032,18 +4224,17 @@
|
|
|
4032
4224
|
}
|
|
4033
4225
|
});
|
|
4034
4226
|
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4227
|
+
drawPath(parentGfx, pathData, {
|
|
4228
|
+
fill: 'none',
|
|
4229
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4230
|
+
strokeWidth: 2
|
|
4039
4231
|
});
|
|
4040
4232
|
}
|
|
4041
4233
|
|
|
4042
4234
|
if (type === 'Parallel') {
|
|
4043
|
-
|
|
4044
4235
|
var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
|
|
4045
4236
|
xScaleFactor: 0.4,
|
|
4046
|
-
yScaleFactor:0.4,
|
|
4237
|
+
yScaleFactor: 0.4,
|
|
4047
4238
|
containerWidth: element.width,
|
|
4048
4239
|
containerHeight: element.height,
|
|
4049
4240
|
position: {
|
|
@@ -4053,16 +4244,16 @@
|
|
|
4053
4244
|
});
|
|
4054
4245
|
|
|
4055
4246
|
drawPath(parentGfx, pathData, {
|
|
4056
|
-
|
|
4057
|
-
|
|
4247
|
+
fill: 'none',
|
|
4248
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4249
|
+
strokeWidth: 1
|
|
4058
4250
|
});
|
|
4059
4251
|
} else if (type === 'Exclusive') {
|
|
4060
|
-
|
|
4061
4252
|
if (!instantiate) {
|
|
4062
4253
|
drawCircle(parentGfx, element.width, element.height, element.height * 0.26, {
|
|
4063
|
-
strokeWidth: 1,
|
|
4064
4254
|
fill: 'none',
|
|
4065
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4255
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4256
|
+
strokeWidth: 1
|
|
4066
4257
|
});
|
|
4067
4258
|
}
|
|
4068
4259
|
|
|
@@ -4072,104 +4263,163 @@
|
|
|
4072
4263
|
|
|
4073
4264
|
return diamond;
|
|
4074
4265
|
},
|
|
4075
|
-
'bpmn:
|
|
4076
|
-
|
|
4077
|
-
fill
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
});
|
|
4081
|
-
},
|
|
4082
|
-
'bpmn:SequenceFlow': function(parentGfx, element) {
|
|
4083
|
-
var fill = getFillColor(element, defaultFillColor),
|
|
4084
|
-
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
4266
|
+
'bpmn:ExclusiveGateway': function(parentGfx, element, attrs = {}) {
|
|
4267
|
+
attrs = pickAttrs(attrs, [
|
|
4268
|
+
'fill',
|
|
4269
|
+
'stroke'
|
|
4270
|
+
]);
|
|
4085
4271
|
|
|
4086
|
-
var
|
|
4087
|
-
markerEnd: marker('sequenceflow-end', fill, stroke),
|
|
4088
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4089
|
-
});
|
|
4272
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
4090
4273
|
|
|
4091
|
-
var
|
|
4274
|
+
var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
|
|
4275
|
+
xScaleFactor: 0.4,
|
|
4276
|
+
yScaleFactor: 0.4,
|
|
4277
|
+
containerWidth: element.width,
|
|
4278
|
+
containerHeight: element.height,
|
|
4279
|
+
position: {
|
|
4280
|
+
mx: 0.32,
|
|
4281
|
+
my: 0.3
|
|
4282
|
+
}
|
|
4283
|
+
});
|
|
4092
4284
|
|
|
4093
|
-
var
|
|
4285
|
+
var di = getDi(element);
|
|
4094
4286
|
|
|
4095
|
-
if (
|
|
4096
|
-
|
|
4287
|
+
if (di.get('isMarkerVisible')) {
|
|
4288
|
+
drawPath(parentGfx, pathData, {
|
|
4289
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4290
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4291
|
+
strokeWidth: 1
|
|
4292
|
+
});
|
|
4293
|
+
}
|
|
4097
4294
|
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4295
|
+
return gateway;
|
|
4296
|
+
},
|
|
4297
|
+
'bpmn:Gateway': function(parentGfx, element, attrs = {}) {
|
|
4298
|
+
attrs = pickAttrs(attrs, [
|
|
4299
|
+
'fill',
|
|
4300
|
+
'stroke'
|
|
4301
|
+
]);
|
|
4104
4302
|
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4303
|
+
return renderGateway(parentGfx, element, attrs);
|
|
4304
|
+
},
|
|
4305
|
+
'bpmn:Group': function(parentGfx, element, attrs = {}) {
|
|
4306
|
+
attrs = pickAttrs(attrs, [
|
|
4307
|
+
'fill',
|
|
4308
|
+
'stroke',
|
|
4309
|
+
'width',
|
|
4310
|
+
'height'
|
|
4311
|
+
]);
|
|
4113
4312
|
|
|
4114
|
-
return
|
|
4313
|
+
return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
|
|
4314
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4315
|
+
strokeWidth: 1.5,
|
|
4316
|
+
strokeDasharray: '10, 6, 0, 6',
|
|
4317
|
+
fill: 'none',
|
|
4318
|
+
pointerEvents: 'none',
|
|
4319
|
+
width: getWidth(element, attrs),
|
|
4320
|
+
height: getHeight(element, attrs)
|
|
4321
|
+
});
|
|
4115
4322
|
},
|
|
4116
|
-
'bpmn:
|
|
4323
|
+
'bpmn:InclusiveGateway': function(parentGfx, element, attrs = {}) {
|
|
4324
|
+
attrs = pickAttrs(attrs, [
|
|
4325
|
+
'fill',
|
|
4326
|
+
'stroke'
|
|
4327
|
+
]);
|
|
4117
4328
|
|
|
4118
|
-
var
|
|
4329
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
4119
4330
|
|
|
4120
|
-
|
|
4121
|
-
|
|
4331
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.24, {
|
|
4332
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4333
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4334
|
+
strokeWidth: 2.5
|
|
4335
|
+
});
|
|
4122
4336
|
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
};
|
|
4337
|
+
return gateway;
|
|
4338
|
+
},
|
|
4339
|
+
'bpmn:IntermediateEvent': function(parentGfx, element, attrs = {}) {
|
|
4340
|
+
var { renderIcon = true } = attrs;
|
|
4128
4341
|
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4342
|
+
attrs = pickAttrs(attrs, [
|
|
4343
|
+
'fill',
|
|
4344
|
+
'stroke'
|
|
4345
|
+
]);
|
|
4133
4346
|
|
|
4134
|
-
|
|
4135
|
-
attrs
|
|
4347
|
+
var outer = renderEvent(parentGfx, element, {
|
|
4348
|
+
...attrs,
|
|
4349
|
+
strokeWidth: 1.5
|
|
4350
|
+
});
|
|
4351
|
+
|
|
4352
|
+
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {
|
|
4353
|
+
fill: 'none',
|
|
4354
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4355
|
+
strokeWidth: 1.5
|
|
4356
|
+
});
|
|
4357
|
+
|
|
4358
|
+
if (renderIcon) {
|
|
4359
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4136
4360
|
}
|
|
4137
4361
|
|
|
4138
|
-
return
|
|
4362
|
+
return outer;
|
|
4139
4363
|
},
|
|
4140
|
-
'bpmn:
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4364
|
+
'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
|
|
4365
|
+
'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
|
|
4366
|
+
'bpmn:Lane': function(parentGfx, element, attrs = {}) {
|
|
4367
|
+
attrs = pickAttrs(attrs, [
|
|
4368
|
+
'fill',
|
|
4369
|
+
'stroke',
|
|
4370
|
+
'width',
|
|
4371
|
+
'height'
|
|
4372
|
+
]);
|
|
4373
|
+
|
|
4374
|
+
return renderLane(parentGfx, element, {
|
|
4375
|
+
...attrs,
|
|
4376
|
+
fillOpacity: LOW_OPACITY
|
|
4146
4377
|
});
|
|
4147
4378
|
},
|
|
4148
|
-
'bpmn:
|
|
4149
|
-
|
|
4150
|
-
|
|
4379
|
+
'bpmn:ManualTask': function(parentGfx, element, attrs = {}) {
|
|
4380
|
+
attrs = pickAttrs(attrs, [
|
|
4381
|
+
'fill',
|
|
4382
|
+
'stroke'
|
|
4383
|
+
]);
|
|
4384
|
+
|
|
4385
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4386
|
+
|
|
4387
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
|
|
4388
|
+
abspos: {
|
|
4389
|
+
x: 17,
|
|
4390
|
+
y: 15
|
|
4391
|
+
}
|
|
4392
|
+
});
|
|
4151
4393
|
|
|
4152
|
-
|
|
4153
|
-
|
|
4394
|
+
drawPath(parentGfx, pathData, {
|
|
4395
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4396
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4397
|
+
strokeWidth: 0.5
|
|
4154
4398
|
});
|
|
4399
|
+
|
|
4400
|
+
return task;
|
|
4155
4401
|
},
|
|
4156
|
-
'bpmn:MessageFlow': function(parentGfx, element) {
|
|
4402
|
+
'bpmn:MessageFlow': function(parentGfx, element, attrs = {}) {
|
|
4403
|
+
attrs = pickAttrs(attrs, [
|
|
4404
|
+
'fill',
|
|
4405
|
+
'stroke'
|
|
4406
|
+
]);
|
|
4157
4407
|
|
|
4158
4408
|
var semantic = getBusinessObject(element),
|
|
4159
4409
|
di = getDi(element);
|
|
4160
4410
|
|
|
4161
|
-
var fill = getFillColor(element, defaultFillColor),
|
|
4162
|
-
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
4411
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
4412
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
4163
4413
|
|
|
4164
4414
|
var path = drawConnectionSegments(parentGfx, element.waypoints, {
|
|
4165
4415
|
markerEnd: marker('messageflow-end', fill, stroke),
|
|
4166
4416
|
markerStart: marker('messageflow-start', fill, stroke),
|
|
4417
|
+
stroke,
|
|
4167
4418
|
strokeDasharray: '10, 11',
|
|
4168
|
-
strokeWidth: 1.5
|
|
4169
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4419
|
+
strokeWidth: 1.5
|
|
4170
4420
|
});
|
|
4171
4421
|
|
|
4172
|
-
if (semantic.messageRef) {
|
|
4422
|
+
if (semantic.get('messageRef')) {
|
|
4173
4423
|
var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
|
|
4174
4424
|
|
|
4175
4425
|
var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
|
|
@@ -4179,24 +4429,28 @@
|
|
|
4179
4429
|
}
|
|
4180
4430
|
});
|
|
4181
4431
|
|
|
4182
|
-
var messageAttrs = {
|
|
4432
|
+
var messageAttrs = {
|
|
4433
|
+
strokeWidth: 1
|
|
4434
|
+
};
|
|
4183
4435
|
|
|
4184
|
-
if (di.messageVisibleKind === 'initiating') {
|
|
4185
|
-
messageAttrs.fill =
|
|
4186
|
-
messageAttrs.stroke =
|
|
4436
|
+
if (di.get('messageVisibleKind') === 'initiating') {
|
|
4437
|
+
messageAttrs.fill = fill;
|
|
4438
|
+
messageAttrs.stroke = stroke;
|
|
4187
4439
|
} else {
|
|
4188
|
-
messageAttrs.fill =
|
|
4189
|
-
messageAttrs.stroke =
|
|
4440
|
+
messageAttrs.fill = stroke;
|
|
4441
|
+
messageAttrs.stroke = fill;
|
|
4190
4442
|
}
|
|
4191
4443
|
|
|
4192
4444
|
var message = drawPath(parentGfx, markerPathData, messageAttrs);
|
|
4193
4445
|
|
|
4194
|
-
var
|
|
4195
|
-
|
|
4446
|
+
var messageRef = semantic.get('messageRef'),
|
|
4447
|
+
name = messageRef.get('name');
|
|
4448
|
+
|
|
4449
|
+
var label = renderLabel(parentGfx, name, {
|
|
4196
4450
|
align: 'center-top',
|
|
4197
4451
|
fitBox: true,
|
|
4198
4452
|
style: {
|
|
4199
|
-
fill:
|
|
4453
|
+
fill: stroke
|
|
4200
4454
|
}
|
|
4201
4455
|
});
|
|
4202
4456
|
|
|
@@ -4207,143 +4461,340 @@
|
|
|
4207
4461
|
translateY = midPoint.y + messageBounds.height / 2 + ELEMENT_LABEL_DISTANCE;
|
|
4208
4462
|
|
|
4209
4463
|
transform(label, translateX, translateY, 0);
|
|
4210
|
-
|
|
4211
4464
|
}
|
|
4212
4465
|
|
|
4213
4466
|
return path;
|
|
4214
4467
|
},
|
|
4215
|
-
'bpmn:
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4468
|
+
'bpmn:ParallelGateway': function(parentGfx, element, attrs = {}) {
|
|
4469
|
+
attrs = pickAttrs(attrs, [
|
|
4470
|
+
'fill',
|
|
4471
|
+
'stroke'
|
|
4472
|
+
]);
|
|
4473
|
+
|
|
4474
|
+
var diamond = renderGateway(parentGfx, element, attrs);
|
|
4475
|
+
|
|
4476
|
+
var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
|
|
4477
|
+
xScaleFactor: 0.6,
|
|
4478
|
+
yScaleFactor: 0.6,
|
|
4219
4479
|
containerWidth: element.width,
|
|
4220
4480
|
containerHeight: element.height,
|
|
4221
4481
|
position: {
|
|
4222
|
-
mx: 0.
|
|
4223
|
-
my: 0.
|
|
4482
|
+
mx: 0.46,
|
|
4483
|
+
my: 0.2
|
|
4224
4484
|
}
|
|
4225
4485
|
});
|
|
4226
4486
|
|
|
4227
|
-
|
|
4228
|
-
fill:
|
|
4229
|
-
|
|
4230
|
-
|
|
4487
|
+
drawPath(parentGfx, pathData, {
|
|
4488
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4489
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4490
|
+
strokeWidth: 1
|
|
4231
4491
|
});
|
|
4232
4492
|
|
|
4233
|
-
|
|
4493
|
+
return diamond;
|
|
4494
|
+
},
|
|
4495
|
+
'bpmn:Participant': function(parentGfx, element, attrs = {}) {
|
|
4496
|
+
attrs = pickAttrs(attrs, [
|
|
4497
|
+
'fill',
|
|
4498
|
+
'stroke',
|
|
4499
|
+
'width',
|
|
4500
|
+
'height'
|
|
4501
|
+
]);
|
|
4502
|
+
|
|
4503
|
+
var participant = renderLane(parentGfx, element, attrs);
|
|
4504
|
+
|
|
4505
|
+
var expandedParticipant = isExpanded(element);
|
|
4506
|
+
|
|
4507
|
+
var semantic = getBusinessObject(element),
|
|
4508
|
+
name = semantic.get('name');
|
|
4509
|
+
|
|
4510
|
+
if (expandedParticipant) {
|
|
4511
|
+
drawLine(parentGfx, [
|
|
4512
|
+
{
|
|
4513
|
+
x: 30,
|
|
4514
|
+
y: 0
|
|
4515
|
+
},
|
|
4516
|
+
{
|
|
4517
|
+
x: 30,
|
|
4518
|
+
y: getHeight(element, attrs)
|
|
4519
|
+
}
|
|
4520
|
+
], {
|
|
4521
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4522
|
+
strokeWidth: PARTICIPANT_STROKE_WIDTH
|
|
4523
|
+
});
|
|
4524
|
+
|
|
4525
|
+
renderLaneLabel(parentGfx, name, element, attrs);
|
|
4526
|
+
} else {
|
|
4527
|
+
renderLabel(parentGfx, name, {
|
|
4528
|
+
box: getBounds(element, attrs),
|
|
4529
|
+
align: 'center-middle',
|
|
4530
|
+
style: {
|
|
4531
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
4532
|
+
}
|
|
4533
|
+
});
|
|
4534
|
+
}
|
|
4234
4535
|
|
|
4235
|
-
if (
|
|
4236
|
-
|
|
4536
|
+
if (semantic.get('participantMultiplicity')) {
|
|
4537
|
+
renderTaskMarker('ParticipantMultiplicityMarker', parentGfx, element, attrs);
|
|
4237
4538
|
}
|
|
4238
4539
|
|
|
4239
|
-
return
|
|
4540
|
+
return participant;
|
|
4240
4541
|
},
|
|
4241
|
-
'bpmn:
|
|
4242
|
-
|
|
4542
|
+
'bpmn:ReceiveTask' : function(parentGfx, element, attrs = {}) {
|
|
4543
|
+
attrs = pickAttrs(attrs, [
|
|
4544
|
+
'fill',
|
|
4545
|
+
'stroke'
|
|
4546
|
+
]);
|
|
4243
4547
|
|
|
4244
|
-
var
|
|
4548
|
+
var semantic = getBusinessObject(element);
|
|
4549
|
+
|
|
4550
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4245
4551
|
|
|
4246
|
-
|
|
4247
|
-
|
|
4552
|
+
var pathData;
|
|
4553
|
+
|
|
4554
|
+
if (semantic.get('instantiate')) {
|
|
4555
|
+
drawCircle(parentGfx, 28, 28, 20 * 0.22, {
|
|
4556
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4557
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4558
|
+
strokeWidth: 1
|
|
4559
|
+
});
|
|
4560
|
+
|
|
4561
|
+
pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
|
|
4562
|
+
abspos: {
|
|
4563
|
+
x: 7.77,
|
|
4564
|
+
y: 9.52
|
|
4565
|
+
}
|
|
4566
|
+
});
|
|
4567
|
+
} else {
|
|
4568
|
+
pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
4569
|
+
xScaleFactor: 0.9,
|
|
4570
|
+
yScaleFactor: 0.9,
|
|
4571
|
+
containerWidth: 21,
|
|
4572
|
+
containerHeight: 14,
|
|
4573
|
+
position: {
|
|
4574
|
+
mx: 0.3,
|
|
4575
|
+
my: 0.4
|
|
4576
|
+
}
|
|
4577
|
+
});
|
|
4578
|
+
}
|
|
4248
4579
|
|
|
4249
|
-
|
|
4580
|
+
drawPath(parentGfx, pathData, {
|
|
4581
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4582
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4583
|
+
strokeWidth: 1
|
|
4584
|
+
});
|
|
4250
4585
|
|
|
4251
|
-
return
|
|
4586
|
+
return task;
|
|
4252
4587
|
},
|
|
4253
|
-
'bpmn:
|
|
4254
|
-
|
|
4588
|
+
'bpmn:ScriptTask': function(parentGfx, element, attrs = {}) {
|
|
4589
|
+
attrs = pickAttrs(attrs, [
|
|
4590
|
+
'fill',
|
|
4591
|
+
'stroke'
|
|
4592
|
+
]);
|
|
4255
4593
|
|
|
4256
|
-
|
|
4257
|
-
var elementObject = renderer('bpmn:DataObject')(parentGfx, element);
|
|
4594
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4258
4595
|
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4596
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
|
|
4597
|
+
abspos: {
|
|
4598
|
+
x: 15,
|
|
4599
|
+
y: 20
|
|
4600
|
+
}
|
|
4601
|
+
});
|
|
4602
|
+
|
|
4603
|
+
drawPath(parentGfx, pathData, {
|
|
4604
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4605
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4606
|
+
strokeWidth: 1
|
|
4262
4607
|
});
|
|
4263
4608
|
|
|
4264
|
-
return
|
|
4609
|
+
return task;
|
|
4265
4610
|
},
|
|
4266
|
-
'bpmn:
|
|
4267
|
-
|
|
4611
|
+
'bpmn:SendTask': function(parentGfx, element, attrs = {}) {
|
|
4612
|
+
attrs = pickAttrs(attrs, [
|
|
4613
|
+
'fill',
|
|
4614
|
+
'stroke'
|
|
4615
|
+
]);
|
|
4616
|
+
|
|
4617
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4618
|
+
|
|
4619
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
4268
4620
|
xScaleFactor: 1,
|
|
4269
4621
|
yScaleFactor: 1,
|
|
4270
|
-
containerWidth:
|
|
4271
|
-
containerHeight:
|
|
4622
|
+
containerWidth: 21,
|
|
4623
|
+
containerHeight: 14,
|
|
4272
4624
|
position: {
|
|
4273
|
-
mx: 0,
|
|
4274
|
-
my: 0.
|
|
4625
|
+
mx: 0.285,
|
|
4626
|
+
my: 0.357
|
|
4627
|
+
}
|
|
4628
|
+
});
|
|
4629
|
+
|
|
4630
|
+
drawPath(parentGfx, pathData, {
|
|
4631
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4632
|
+
stroke: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4633
|
+
strokeWidth: 1
|
|
4634
|
+
});
|
|
4635
|
+
|
|
4636
|
+
return task;
|
|
4637
|
+
},
|
|
4638
|
+
'bpmn:SequenceFlow': function(parentGfx, element, attrs = {}) {
|
|
4639
|
+
attrs = pickAttrs(attrs, [
|
|
4640
|
+
'fill',
|
|
4641
|
+
'stroke'
|
|
4642
|
+
]);
|
|
4643
|
+
|
|
4644
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
4645
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
4646
|
+
|
|
4647
|
+
var connection = drawConnectionSegments(parentGfx, element.waypoints, {
|
|
4648
|
+
markerEnd: marker('sequenceflow-end', fill, stroke),
|
|
4649
|
+
stroke
|
|
4650
|
+
});
|
|
4651
|
+
|
|
4652
|
+
var semantic = getBusinessObject(element);
|
|
4653
|
+
|
|
4654
|
+
var { source } = element;
|
|
4655
|
+
|
|
4656
|
+
if (source) {
|
|
4657
|
+
var sourceSemantic = getBusinessObject(source);
|
|
4658
|
+
|
|
4659
|
+
// conditional flow marker
|
|
4660
|
+
if (semantic.get('conditionExpression') && is$1(sourceSemantic, 'bpmn:Activity')) {
|
|
4661
|
+
attr$1(connection, {
|
|
4662
|
+
markerStart: marker('conditional-flow-marker', fill, stroke)
|
|
4663
|
+
});
|
|
4664
|
+
}
|
|
4665
|
+
|
|
4666
|
+
// default marker
|
|
4667
|
+
if (sourceSemantic.get('default') && (is$1(sourceSemantic, 'bpmn:Gateway') || is$1(sourceSemantic, 'bpmn:Activity')) &&
|
|
4668
|
+
sourceSemantic.get('default') === semantic) {
|
|
4669
|
+
attr$1(connection, {
|
|
4670
|
+
markerStart: marker('conditional-default-flow-marker', fill, stroke)
|
|
4671
|
+
});
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
|
|
4675
|
+
return connection;
|
|
4676
|
+
},
|
|
4677
|
+
'bpmn:ServiceTask': function(parentGfx, element, attrs = {}) {
|
|
4678
|
+
attrs = pickAttrs(attrs, [
|
|
4679
|
+
'fill',
|
|
4680
|
+
'stroke'
|
|
4681
|
+
]);
|
|
4682
|
+
|
|
4683
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4684
|
+
|
|
4685
|
+
drawCircle(parentGfx, 10, 10, {
|
|
4686
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4687
|
+
stroke: 'none',
|
|
4688
|
+
transform: 'translate(6, 6)'
|
|
4689
|
+
});
|
|
4690
|
+
|
|
4691
|
+
var pathDataService1 = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
|
|
4692
|
+
abspos: {
|
|
4693
|
+
x: 12,
|
|
4694
|
+
y: 18
|
|
4275
4695
|
}
|
|
4276
4696
|
});
|
|
4277
4697
|
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4698
|
+
drawPath(parentGfx, pathDataService1, {
|
|
4699
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4700
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4701
|
+
strokeWidth: 1
|
|
4283
4702
|
});
|
|
4284
4703
|
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4704
|
+
drawCircle(parentGfx, 10, 10, {
|
|
4705
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4706
|
+
stroke: 'none',
|
|
4707
|
+
transform: 'translate(11, 10)'
|
|
4708
|
+
});
|
|
4288
4709
|
|
|
4289
|
-
var
|
|
4290
|
-
|
|
4710
|
+
var pathDataService2 = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
|
|
4711
|
+
abspos: {
|
|
4712
|
+
x: 17,
|
|
4713
|
+
y: 22
|
|
4714
|
+
}
|
|
4715
|
+
});
|
|
4291
4716
|
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
};
|
|
4717
|
+
drawPath(parentGfx, pathDataService2, {
|
|
4718
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4719
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4720
|
+
strokeWidth: 1
|
|
4721
|
+
});
|
|
4297
4722
|
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4723
|
+
return task;
|
|
4724
|
+
},
|
|
4725
|
+
'bpmn:StartEvent': function(parentGfx, element, attrs = {}) {
|
|
4726
|
+
var { renderIcon = true } = attrs;
|
|
4301
4727
|
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
};
|
|
4728
|
+
attrs = pickAttrs(attrs, [
|
|
4729
|
+
'fill',
|
|
4730
|
+
'stroke'
|
|
4731
|
+
]);
|
|
4307
4732
|
|
|
4308
|
-
|
|
4309
|
-
var innerAttrs = {
|
|
4310
|
-
...attrs,
|
|
4311
|
-
fill: 'none'
|
|
4312
|
-
};
|
|
4733
|
+
var semantic = getBusinessObject(element);
|
|
4313
4734
|
|
|
4314
|
-
|
|
4735
|
+
if (!semantic.get('isInterrupting')) {
|
|
4736
|
+
attrs = {
|
|
4737
|
+
...attrs,
|
|
4738
|
+
strokeDasharray: '6'
|
|
4739
|
+
};
|
|
4740
|
+
}
|
|
4315
4741
|
|
|
4316
|
-
|
|
4742
|
+
var event = renderEvent(parentGfx, element, attrs);
|
|
4317
4743
|
|
|
4318
|
-
if (
|
|
4319
|
-
|
|
4744
|
+
if (renderIcon) {
|
|
4745
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4320
4746
|
}
|
|
4321
4747
|
|
|
4322
|
-
return
|
|
4748
|
+
return event;
|
|
4323
4749
|
},
|
|
4324
|
-
'bpmn:
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4750
|
+
'bpmn:SubProcess': function(parentGfx, element, attrs = {}) {
|
|
4751
|
+
if (isExpanded(element)) {
|
|
4752
|
+
attrs = pickAttrs(attrs, [
|
|
4753
|
+
'fill',
|
|
4754
|
+
'stroke',
|
|
4755
|
+
'width',
|
|
4756
|
+
'height'
|
|
4757
|
+
]);
|
|
4758
|
+
} else {
|
|
4759
|
+
attrs = pickAttrs(attrs, [
|
|
4760
|
+
'fill',
|
|
4761
|
+
'stroke'
|
|
4762
|
+
]);
|
|
4763
|
+
}
|
|
4764
|
+
|
|
4765
|
+
return renderSubProcess(parentGfx, element, attrs);
|
|
4332
4766
|
},
|
|
4333
|
-
'
|
|
4334
|
-
|
|
4767
|
+
'bpmn:Task': function(parentGfx, element, attrs = {}) {
|
|
4768
|
+
attrs = pickAttrs(attrs, [
|
|
4769
|
+
'fill',
|
|
4770
|
+
'stroke'
|
|
4771
|
+
]);
|
|
4772
|
+
|
|
4773
|
+
return renderTask(parentGfx, element, attrs);
|
|
4335
4774
|
},
|
|
4336
|
-
'bpmn:TextAnnotation': function(parentGfx, element) {
|
|
4337
|
-
|
|
4338
|
-
'fill'
|
|
4339
|
-
'stroke'
|
|
4775
|
+
'bpmn:TextAnnotation': function(parentGfx, element, attrs = {}) {
|
|
4776
|
+
attrs = pickAttrs(attrs, [
|
|
4777
|
+
'fill',
|
|
4778
|
+
'stroke',
|
|
4779
|
+
'width',
|
|
4780
|
+
'height'
|
|
4781
|
+
]);
|
|
4782
|
+
|
|
4783
|
+
var {
|
|
4784
|
+
width,
|
|
4785
|
+
height
|
|
4786
|
+
} = getBounds(element, attrs);
|
|
4787
|
+
|
|
4788
|
+
var textElement = drawRect(parentGfx, width, height, 0, 0, {
|
|
4789
|
+
fill: 'none',
|
|
4790
|
+
stroke: 'none'
|
|
4340
4791
|
});
|
|
4341
4792
|
|
|
4342
4793
|
var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
|
|
4343
4794
|
xScaleFactor: 1,
|
|
4344
4795
|
yScaleFactor: 1,
|
|
4345
|
-
containerWidth:
|
|
4346
|
-
containerHeight:
|
|
4796
|
+
containerWidth: width,
|
|
4797
|
+
containerHeight: height,
|
|
4347
4798
|
position: {
|
|
4348
4799
|
mx: 0.0,
|
|
4349
4800
|
my: 0.0
|
|
@@ -4351,232 +4802,121 @@
|
|
|
4351
4802
|
});
|
|
4352
4803
|
|
|
4353
4804
|
drawPath(parentGfx, textPathData, {
|
|
4354
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4805
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
4355
4806
|
});
|
|
4356
4807
|
|
|
4357
|
-
var
|
|
4808
|
+
var semantic = getBusinessObject(element),
|
|
4809
|
+
text = semantic.get('text') || '';
|
|
4810
|
+
|
|
4358
4811
|
renderLabel(parentGfx, text, {
|
|
4359
|
-
box: element,
|
|
4360
4812
|
align: 'left-top',
|
|
4813
|
+
box: getBounds(element, attrs),
|
|
4361
4814
|
padding: 7,
|
|
4362
4815
|
style: {
|
|
4363
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
4816
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
4364
4817
|
}
|
|
4365
4818
|
});
|
|
4366
4819
|
|
|
4367
4820
|
return textElement;
|
|
4368
4821
|
},
|
|
4369
|
-
'
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4822
|
+
'bpmn:Transaction': function(parentGfx, element, attrs = {}) {
|
|
4823
|
+
if (isExpanded(element)) {
|
|
4824
|
+
attrs = pickAttrs(attrs, [
|
|
4825
|
+
'fill',
|
|
4826
|
+
'stroke',
|
|
4827
|
+
'width',
|
|
4828
|
+
'height'
|
|
4829
|
+
]);
|
|
4830
|
+
} else {
|
|
4831
|
+
attrs = pickAttrs(attrs, [
|
|
4832
|
+
'fill',
|
|
4833
|
+
'stroke'
|
|
4834
|
+
]);
|
|
4835
|
+
}
|
|
4380
4836
|
|
|
4381
|
-
|
|
4382
|
-
strokeWidth:
|
|
4383
|
-
|
|
4384
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4837
|
+
var outer = renderSubProcess(parentGfx, element, {
|
|
4838
|
+
strokeWidth: 1.5,
|
|
4839
|
+
...attrs
|
|
4385
4840
|
});
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
strokeWidth: 1
|
|
4390
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4391
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4841
|
+
|
|
4842
|
+
var innerAttrs = styles.style([ 'no-fill', 'no-events' ], {
|
|
4843
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4844
|
+
strokeWidth: 1.5
|
|
4392
4845
|
});
|
|
4393
4846
|
|
|
4394
|
-
|
|
4395
|
-
// therefore fixed values can be used here
|
|
4396
|
-
translate$1(markerRect, element.width / 2 - 7.5, element.height - 20);
|
|
4847
|
+
var expanded = isExpanded(element);
|
|
4397
4848
|
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
containerWidth: element.width,
|
|
4402
|
-
containerHeight: element.height,
|
|
4403
|
-
position: {
|
|
4404
|
-
mx: (element.width / 2 - 7.5) / element.width,
|
|
4405
|
-
my: (element.height - 20) / element.height
|
|
4406
|
-
}
|
|
4407
|
-
});
|
|
4849
|
+
if (!expanded) {
|
|
4850
|
+
attrs = {};
|
|
4851
|
+
}
|
|
4408
4852
|
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
yScaleFactor: 1,
|
|
4418
|
-
containerWidth: element.width,
|
|
4419
|
-
containerHeight: element.height,
|
|
4420
|
-
position: {
|
|
4421
|
-
mx: ((element.width / 2 + position.parallel) / element.width),
|
|
4422
|
-
my: (element.height - 20) / element.height
|
|
4423
|
-
}
|
|
4424
|
-
});
|
|
4853
|
+
drawRect(
|
|
4854
|
+
parentGfx,
|
|
4855
|
+
getWidth(element, attrs),
|
|
4856
|
+
getHeight(element, attrs),
|
|
4857
|
+
TASK_BORDER_RADIUS - INNER_OUTER_DIST,
|
|
4858
|
+
INNER_OUTER_DIST,
|
|
4859
|
+
innerAttrs
|
|
4860
|
+
);
|
|
4425
4861
|
|
|
4426
|
-
|
|
4427
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4428
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4429
|
-
});
|
|
4862
|
+
return outer;
|
|
4430
4863
|
},
|
|
4431
|
-
'
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
containerHeight: element.height,
|
|
4437
|
-
position: {
|
|
4438
|
-
mx: ((element.width / 2 + position.seq) / element.width),
|
|
4439
|
-
my: (element.height - 19) / element.height
|
|
4440
|
-
}
|
|
4441
|
-
});
|
|
4864
|
+
'bpmn:UserTask': function(parentGfx, element, attrs = {}) {
|
|
4865
|
+
attrs = pickAttrs(attrs, [
|
|
4866
|
+
'fill',
|
|
4867
|
+
'stroke'
|
|
4868
|
+
]);
|
|
4442
4869
|
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
containerWidth: element.width,
|
|
4453
|
-
containerHeight: element.height,
|
|
4454
|
-
position: {
|
|
4455
|
-
mx: ((element.width / 2 + position.compensation) / element.width),
|
|
4456
|
-
my: (element.height - 13) / element.height
|
|
4870
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4871
|
+
|
|
4872
|
+
var x = 15;
|
|
4873
|
+
var y = 12;
|
|
4874
|
+
|
|
4875
|
+
var pathDataUser1 = pathMap.getScaledPath('TASK_TYPE_USER_1', {
|
|
4876
|
+
abspos: {
|
|
4877
|
+
x: x,
|
|
4878
|
+
y: y
|
|
4457
4879
|
}
|
|
4458
4880
|
});
|
|
4459
4881
|
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4882
|
+
drawPath(parentGfx, pathDataUser1, {
|
|
4883
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4884
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4885
|
+
strokeWidth: 0.5
|
|
4464
4886
|
});
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
containerWidth: element.width,
|
|
4471
|
-
containerHeight: element.height,
|
|
4472
|
-
position: {
|
|
4473
|
-
mx: ((element.width / 2 + position.loop) / element.width),
|
|
4474
|
-
my: (element.height - 7) / element.height
|
|
4887
|
+
|
|
4888
|
+
var pathDataUser2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
|
|
4889
|
+
abspos: {
|
|
4890
|
+
x: x,
|
|
4891
|
+
y: y
|
|
4475
4892
|
}
|
|
4476
4893
|
});
|
|
4477
4894
|
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
strokeMiterlimit: 0.5
|
|
4895
|
+
drawPath(parentGfx, pathDataUser2, {
|
|
4896
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4897
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4898
|
+
strokeWidth: 0.5
|
|
4483
4899
|
});
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
containerWidth: element.width,
|
|
4490
|
-
containerHeight: element.height,
|
|
4491
|
-
position: {
|
|
4492
|
-
mx: ((element.width / 2 + position.adhoc) / element.width),
|
|
4493
|
-
my: (element.height - 15) / element.height
|
|
4900
|
+
|
|
4901
|
+
var pathDataUser3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
|
|
4902
|
+
abspos: {
|
|
4903
|
+
x: x,
|
|
4904
|
+
y: y
|
|
4494
4905
|
}
|
|
4495
4906
|
});
|
|
4496
4907
|
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4908
|
+
drawPath(parentGfx, pathDataUser3, {
|
|
4909
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4910
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4911
|
+
strokeWidth: 0.5
|
|
4501
4912
|
});
|
|
4502
|
-
}
|
|
4503
|
-
};
|
|
4504
|
-
|
|
4505
|
-
function attachTaskMarkers(parentGfx, element, taskMarkers) {
|
|
4506
|
-
var obj = getBusinessObject(element);
|
|
4507
|
-
|
|
4508
|
-
var subprocess = taskMarkers && taskMarkers.indexOf('SubProcessMarker') !== -1;
|
|
4509
|
-
var position;
|
|
4510
|
-
|
|
4511
|
-
if (subprocess) {
|
|
4512
|
-
position = {
|
|
4513
|
-
seq: -21,
|
|
4514
|
-
parallel: -22,
|
|
4515
|
-
compensation: -42,
|
|
4516
|
-
loop: -18,
|
|
4517
|
-
adhoc: 10
|
|
4518
|
-
};
|
|
4519
|
-
} else {
|
|
4520
|
-
position = {
|
|
4521
|
-
seq: -3,
|
|
4522
|
-
parallel: -6,
|
|
4523
|
-
compensation: -27,
|
|
4524
|
-
loop: 0,
|
|
4525
|
-
adhoc: 10
|
|
4526
|
-
};
|
|
4527
|
-
}
|
|
4528
|
-
|
|
4529
|
-
forEach$1(taskMarkers, function(marker) {
|
|
4530
|
-
renderer(marker)(parentGfx, element, position);
|
|
4531
|
-
});
|
|
4532
|
-
|
|
4533
|
-
if (obj.isForCompensation) {
|
|
4534
|
-
renderer('CompensationMarker')(parentGfx, element, position);
|
|
4535
|
-
}
|
|
4536
|
-
|
|
4537
|
-
if (obj.$type === 'bpmn:AdHocSubProcess') {
|
|
4538
|
-
renderer('AdhocMarker')(parentGfx, element, position);
|
|
4539
|
-
}
|
|
4540
|
-
|
|
4541
|
-
var loopCharacteristics = obj.loopCharacteristics,
|
|
4542
|
-
isSequential = loopCharacteristics && loopCharacteristics.isSequential;
|
|
4543
|
-
|
|
4544
|
-
if (loopCharacteristics) {
|
|
4545
|
-
|
|
4546
|
-
if (isSequential === undefined) {
|
|
4547
|
-
renderer('LoopMarker')(parentGfx, element, position);
|
|
4548
|
-
}
|
|
4549
|
-
|
|
4550
|
-
if (isSequential === false) {
|
|
4551
|
-
renderer('ParallelMarker')(parentGfx, element, position);
|
|
4552
|
-
}
|
|
4553
4913
|
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4914
|
+
return task;
|
|
4915
|
+
},
|
|
4916
|
+
'label': function(parentGfx, element, attrs = {}) {
|
|
4917
|
+
return renderExternalLabel(parentGfx, element, attrs);
|
|
4557
4918
|
}
|
|
4558
|
-
}
|
|
4559
|
-
|
|
4560
|
-
function renderDataItemCollection(parentGfx, element) {
|
|
4561
|
-
|
|
4562
|
-
var yPosition = (element.height - 18) / element.height;
|
|
4563
|
-
|
|
4564
|
-
var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
|
|
4565
|
-
xScaleFactor: 1,
|
|
4566
|
-
yScaleFactor: 1,
|
|
4567
|
-
containerWidth: element.width,
|
|
4568
|
-
containerHeight: element.height,
|
|
4569
|
-
position: {
|
|
4570
|
-
mx: 0.33,
|
|
4571
|
-
my: yPosition
|
|
4572
|
-
}
|
|
4573
|
-
});
|
|
4574
|
-
|
|
4575
|
-
/* collection path */ drawPath(parentGfx, pathData, {
|
|
4576
|
-
strokeWidth: 2
|
|
4577
|
-
});
|
|
4578
|
-
}
|
|
4579
|
-
|
|
4919
|
+
};
|
|
4580
4920
|
|
|
4581
4921
|
// extension API, use at your own risk
|
|
4582
4922
|
this._drawPath = drawPath;
|
|
@@ -4611,15 +4951,16 @@
|
|
|
4611
4951
|
*
|
|
4612
4952
|
* @param {SVGElement} parentGfx
|
|
4613
4953
|
* @param {Element} element
|
|
4954
|
+
* @param {Attrs} [attrs]
|
|
4614
4955
|
*
|
|
4615
4956
|
* @return {SVGElement} mainGfx
|
|
4616
4957
|
*/
|
|
4617
|
-
BpmnRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
4618
|
-
var type = element
|
|
4619
|
-
|
|
4958
|
+
BpmnRenderer.prototype.drawShape = function(parentGfx, element, attrs = {}) {
|
|
4959
|
+
var { type } = element;
|
|
4960
|
+
|
|
4961
|
+
var handler = this._renderer(type);
|
|
4620
4962
|
|
|
4621
|
-
|
|
4622
|
-
return h(parentGfx, element);
|
|
4963
|
+
return handler(parentGfx, element, attrs);
|
|
4623
4964
|
};
|
|
4624
4965
|
|
|
4625
4966
|
/**
|
|
@@ -4627,15 +4968,16 @@
|
|
|
4627
4968
|
*
|
|
4628
4969
|
* @param {SVGElement} parentGfx
|
|
4629
4970
|
* @param {Element} element
|
|
4971
|
+
* @param {Attrs} [attrs]
|
|
4630
4972
|
*
|
|
4631
4973
|
* @return {SVGElement} mainGfx
|
|
4632
4974
|
*/
|
|
4633
|
-
BpmnRenderer.prototype.drawConnection = function(parentGfx, element) {
|
|
4634
|
-
var type = element
|
|
4635
|
-
var h = this._renderer(type);
|
|
4975
|
+
BpmnRenderer.prototype.drawConnection = function(parentGfx, element, attrs = {}) {
|
|
4976
|
+
var { type } = element;
|
|
4636
4977
|
|
|
4637
|
-
|
|
4638
|
-
|
|
4978
|
+
var handler = this._renderer(type);
|
|
4979
|
+
|
|
4980
|
+
return handler(parentGfx, element, attrs);
|
|
4639
4981
|
};
|
|
4640
4982
|
|
|
4641
4983
|
/**
|
|
@@ -4646,7 +4988,6 @@
|
|
|
4646
4988
|
* @return {string} path
|
|
4647
4989
|
*/
|
|
4648
4990
|
BpmnRenderer.prototype.getShapePath = function(element) {
|
|
4649
|
-
|
|
4650
4991
|
if (is$1(element, 'bpmn:Event')) {
|
|
4651
4992
|
return getCirclePath(element);
|
|
4652
4993
|
}
|
|
@@ -4662,6 +5003,24 @@
|
|
|
4662
5003
|
return getRectPath(element);
|
|
4663
5004
|
};
|
|
4664
5005
|
|
|
5006
|
+
/**
|
|
5007
|
+
* Pick attributes if they exist.
|
|
5008
|
+
*
|
|
5009
|
+
* @param {Object} attrs
|
|
5010
|
+
* @param {string[]} keys
|
|
5011
|
+
*
|
|
5012
|
+
* @returns {Object}
|
|
5013
|
+
*/
|
|
5014
|
+
function pickAttrs(attrs, keys = []) {
|
|
5015
|
+
return keys.reduce((pickedAttrs, key) => {
|
|
5016
|
+
if (attrs[ key ]) {
|
|
5017
|
+
pickedAttrs[ key ] = attrs[ key ];
|
|
5018
|
+
}
|
|
5019
|
+
|
|
5020
|
+
return pickedAttrs;
|
|
5021
|
+
}, {});
|
|
5022
|
+
}
|
|
5023
|
+
|
|
4665
5024
|
/**
|
|
4666
5025
|
* @typedef {import('../util/Types').Dimensions} Dimensions
|
|
4667
5026
|
*
|
|
@@ -6949,6 +7308,8 @@
|
|
|
6949
7308
|
|
|
6950
7309
|
var LOW_PRIORITY$2 = 500;
|
|
6951
7310
|
|
|
7311
|
+
var DEFAULT_PRIORITY$2 = 1000;
|
|
7312
|
+
|
|
6952
7313
|
/**
|
|
6953
7314
|
* @typedef {import('../../model/Types').Element} Element
|
|
6954
7315
|
*
|
|
@@ -6967,25 +7328,25 @@
|
|
|
6967
7328
|
*/
|
|
6968
7329
|
function Outline(eventBus, styles) {
|
|
6969
7330
|
|
|
6970
|
-
this.
|
|
7331
|
+
this._eventBus = eventBus;
|
|
7332
|
+
|
|
7333
|
+
this.offset = 5;
|
|
6971
7334
|
|
|
6972
7335
|
var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);
|
|
6973
7336
|
|
|
6974
7337
|
var self = this;
|
|
6975
7338
|
|
|
6976
|
-
function createOutline(gfx,
|
|
7339
|
+
function createOutline(gfx, element) {
|
|
6977
7340
|
var outline = create$1('rect');
|
|
6978
7341
|
|
|
6979
7342
|
attr$1(outline, assign$1({
|
|
6980
|
-
x:
|
|
6981
|
-
y:
|
|
7343
|
+
x: - self.offset,
|
|
7344
|
+
y: - self.offset,
|
|
6982
7345
|
rx: 4,
|
|
6983
|
-
width:
|
|
6984
|
-
height:
|
|
7346
|
+
width: element.width + self.offset * 2,
|
|
7347
|
+
height: element.height + self.offset * 2
|
|
6985
7348
|
}, OUTLINE_STYLE));
|
|
6986
7349
|
|
|
6987
|
-
append(gfx, outline);
|
|
6988
|
-
|
|
6989
7350
|
return outline;
|
|
6990
7351
|
}
|
|
6991
7352
|
|
|
@@ -6998,10 +7359,12 @@
|
|
|
6998
7359
|
var outline = query('.djs-outline', gfx);
|
|
6999
7360
|
|
|
7000
7361
|
if (!outline) {
|
|
7001
|
-
outline = createOutline(gfx);
|
|
7002
|
-
|
|
7362
|
+
outline = self.getOutline(element) || createOutline(gfx, element);
|
|
7363
|
+
append(gfx, outline);
|
|
7003
7364
|
|
|
7004
|
-
|
|
7365
|
+
} else {
|
|
7366
|
+
self.updateShapeOutline(outline, element);
|
|
7367
|
+
}
|
|
7005
7368
|
});
|
|
7006
7369
|
|
|
7007
7370
|
eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {
|
|
@@ -7011,7 +7374,8 @@
|
|
|
7011
7374
|
var outline = query('.djs-outline', gfx);
|
|
7012
7375
|
|
|
7013
7376
|
if (!outline) {
|
|
7014
|
-
outline = createOutline(gfx);
|
|
7377
|
+
outline = createOutline(gfx, element);
|
|
7378
|
+
append(gfx, outline);
|
|
7015
7379
|
}
|
|
7016
7380
|
|
|
7017
7381
|
self.updateConnectionOutline(outline, element);
|
|
@@ -7028,25 +7392,34 @@
|
|
|
7028
7392
|
*/
|
|
7029
7393
|
Outline.prototype.updateShapeOutline = function(outline, element) {
|
|
7030
7394
|
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
y: -this.offset,
|
|
7034
|
-
width: element.width + this.offset * 2,
|
|
7035
|
-
height: element.height + this.offset * 2
|
|
7036
|
-
});
|
|
7395
|
+
var updated = false;
|
|
7396
|
+
var providers = this._getProviders();
|
|
7037
7397
|
|
|
7038
|
-
|
|
7398
|
+
if (providers.length) {
|
|
7399
|
+
forEach$1(providers, function(provider) {
|
|
7400
|
+
updated = updated || provider.updateOutline(element, outline);
|
|
7401
|
+
});
|
|
7402
|
+
}
|
|
7039
7403
|
|
|
7404
|
+
if (!updated) {
|
|
7405
|
+
attr$1(outline, {
|
|
7406
|
+
x: -this.offset,
|
|
7407
|
+
y: -this.offset,
|
|
7408
|
+
width: element.width + this.offset * 2,
|
|
7409
|
+
height: element.height + this.offset * 2
|
|
7410
|
+
});
|
|
7411
|
+
}
|
|
7412
|
+
};
|
|
7040
7413
|
|
|
7041
7414
|
/**
|
|
7042
7415
|
* Updates the outline of a connection respecting the bounding box of
|
|
7043
7416
|
* the connection and an outline offset.
|
|
7417
|
+
* Register an outline provider with the given priority.
|
|
7044
7418
|
*
|
|
7045
7419
|
* @param {SVGElement} outline
|
|
7046
7420
|
* @param {Element} connection
|
|
7047
|
-
|
|
7421
|
+
**/
|
|
7048
7422
|
Outline.prototype.updateConnectionOutline = function(outline, connection) {
|
|
7049
|
-
|
|
7050
7423
|
var bbox = getBBox(connection);
|
|
7051
7424
|
|
|
7052
7425
|
attr$1(outline, {
|
|
@@ -7055,9 +7428,61 @@
|
|
|
7055
7428
|
width: bbox.width + this.offset * 2,
|
|
7056
7429
|
height: bbox.height + this.offset * 2
|
|
7057
7430
|
});
|
|
7431
|
+
};
|
|
7432
|
+
|
|
7433
|
+
/**
|
|
7434
|
+
* Register an outline provider with the given priority.
|
|
7435
|
+
*
|
|
7436
|
+
* @param {number} priority
|
|
7437
|
+
* @param {OutlineProvider} provider
|
|
7438
|
+
*/
|
|
7439
|
+
Outline.prototype.registerProvider = function(priority, provider) {
|
|
7440
|
+
if (!provider) {
|
|
7441
|
+
provider = priority;
|
|
7442
|
+
priority = DEFAULT_PRIORITY$2;
|
|
7443
|
+
}
|
|
7444
|
+
|
|
7445
|
+
this._eventBus.on('outline.getProviders', priority, function(event) {
|
|
7446
|
+
event.providers.push(provider);
|
|
7447
|
+
});
|
|
7448
|
+
};
|
|
7449
|
+
|
|
7450
|
+
/**
|
|
7451
|
+
* Returns the registered outline providers.
|
|
7452
|
+
*
|
|
7453
|
+
* @returns {OutlineProvider[]}
|
|
7454
|
+
*/
|
|
7455
|
+
Outline.prototype._getProviders = function() {
|
|
7456
|
+
var event = this._eventBus.createEvent({
|
|
7457
|
+
type: 'outline.getProviders',
|
|
7458
|
+
providers: []
|
|
7459
|
+
});
|
|
7058
7460
|
|
|
7461
|
+
this._eventBus.fire(event);
|
|
7462
|
+
|
|
7463
|
+
return event.providers;
|
|
7059
7464
|
};
|
|
7060
7465
|
|
|
7466
|
+
/**
|
|
7467
|
+
* Returns the outline for an element.
|
|
7468
|
+
*
|
|
7469
|
+
* @param {Element} element
|
|
7470
|
+
**/
|
|
7471
|
+
Outline.prototype.getOutline = function(element) {
|
|
7472
|
+
var outline;
|
|
7473
|
+
var providers = this._getProviders();
|
|
7474
|
+
|
|
7475
|
+
forEach$1(providers, function(provider) {
|
|
7476
|
+
|
|
7477
|
+
if (!isFunction(provider.getOutline)) {
|
|
7478
|
+
return;
|
|
7479
|
+
}
|
|
7480
|
+
|
|
7481
|
+
outline = outline || provider.getOutline(element);
|
|
7482
|
+
});
|
|
7483
|
+
|
|
7484
|
+
return outline;
|
|
7485
|
+
};
|
|
7061
7486
|
|
|
7062
7487
|
Outline.$inject = [ 'eventBus', 'styles', 'elementRegistry' ];
|
|
7063
7488
|
|