camunda-bpmn-js 4.0.0-0 → 4.0.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 +7 -19
- package/dist/assets/properties-panel.css +57 -23
- package/dist/base-modeler.development.js +65569 -62864
- package/dist/base-modeler.production.min.js +52 -53
- package/dist/base-navigated-viewer.development.js +1694 -1145
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +1692 -1147
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +52572 -39963
- package/dist/camunda-cloud-modeler.production.min.js +61 -61
- package/dist/camunda-cloud-navigated-viewer.development.js +1694 -1145
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +1692 -1147
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +45585 -42832
- package/dist/camunda-platform-modeler.production.min.js +52 -53
- package/dist/camunda-platform-navigated-viewer.development.js +1694 -1145
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +1692 -1147
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/lib/camunda-cloud/Modeler.js +0 -3
- package/package.json +33 -33
- package/lib/camunda-cloud/features/rules/BpmnRules.d.ts +0 -32
- package/lib/camunda-cloud/features/rules/BpmnRules.js +0 -161
- package/lib/camunda-cloud/features/rules/index.d.ts +0 -6
- package/lib/camunda-cloud/features/rules/index.js +0 -6
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @template T
|
|
13
13
|
*
|
|
14
|
-
* @param {T[][]} arr
|
|
14
|
+
* @param {T[][] | T[] | null} [arr]
|
|
15
15
|
*
|
|
16
16
|
* @return {T[]}
|
|
17
17
|
*/
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
return obj !== undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function isNil(obj) {
|
|
31
|
+
return obj == null;
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
function isArray$2(obj) {
|
|
31
35
|
return nativeToString$1.call(obj) === '[object Array]';
|
|
32
36
|
}
|
|
@@ -475,6 +479,58 @@
|
|
|
475
479
|
return Object.assign(target, ...others);
|
|
476
480
|
}
|
|
477
481
|
|
|
482
|
+
/**
|
|
483
|
+
* Sets a nested property of a given object to the specified value.
|
|
484
|
+
*
|
|
485
|
+
* This mutates the object and returns it.
|
|
486
|
+
*
|
|
487
|
+
* @template T
|
|
488
|
+
*
|
|
489
|
+
* @param {T} target The target of the set operation.
|
|
490
|
+
* @param {(string|number)[]} path The path to the nested value.
|
|
491
|
+
* @param {any} value The value to set.
|
|
492
|
+
*
|
|
493
|
+
* @return {T}
|
|
494
|
+
*/
|
|
495
|
+
function set$1(target, path, value) {
|
|
496
|
+
|
|
497
|
+
let currentTarget = target;
|
|
498
|
+
|
|
499
|
+
forEach$1(path, function(key, idx) {
|
|
500
|
+
|
|
501
|
+
if (typeof key !== 'number' && typeof key !== 'string') {
|
|
502
|
+
throw new Error('illegal key type: ' + typeof key + '. Key should be of type number or string.');
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (key === 'constructor') {
|
|
506
|
+
throw new Error('illegal key: constructor');
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (key === '__proto__') {
|
|
510
|
+
throw new Error('illegal key: __proto__');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
let nextKey = path[idx + 1];
|
|
514
|
+
let nextTarget = currentTarget[key];
|
|
515
|
+
|
|
516
|
+
if (isDefined(nextKey) && isNil(nextTarget)) {
|
|
517
|
+
nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
if (isUndefined$2(nextKey)) {
|
|
521
|
+
if (isUndefined$2(value)) {
|
|
522
|
+
delete currentTarget[key];
|
|
523
|
+
} else {
|
|
524
|
+
currentTarget[key] = value;
|
|
525
|
+
}
|
|
526
|
+
} else {
|
|
527
|
+
currentTarget = nextTarget;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
return target;
|
|
532
|
+
}
|
|
533
|
+
|
|
478
534
|
/**
|
|
479
535
|
* Pick properties from the given target.
|
|
480
536
|
*
|
|
@@ -713,6 +769,26 @@
|
|
|
713
769
|
return true;
|
|
714
770
|
}
|
|
715
771
|
|
|
772
|
+
/**
|
|
773
|
+
* @param {Element} element
|
|
774
|
+
*
|
|
775
|
+
* @return {boolean}
|
|
776
|
+
*/
|
|
777
|
+
function isHorizontal(element) {
|
|
778
|
+
|
|
779
|
+
if (!is$1(element, 'bpmn:Participant') && !is$1(element, 'bpmn:Lane')) {
|
|
780
|
+
return undefined;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
var isHorizontal = getDi(element).isHorizontal;
|
|
784
|
+
|
|
785
|
+
if (isHorizontal === undefined) {
|
|
786
|
+
return true;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
return isHorizontal;
|
|
790
|
+
}
|
|
791
|
+
|
|
716
792
|
/**
|
|
717
793
|
* @param {Element} element
|
|
718
794
|
*
|
|
@@ -1784,6 +1860,7 @@
|
|
|
1784
1860
|
}
|
|
1785
1861
|
|
|
1786
1862
|
var black = 'hsl(225, 10%, 15%)';
|
|
1863
|
+
var white = 'white';
|
|
1787
1864
|
|
|
1788
1865
|
// element utils //////////////////////
|
|
1789
1866
|
|
|
@@ -1831,39 +1908,42 @@
|
|
|
1831
1908
|
/**
|
|
1832
1909
|
* @param {Element} element
|
|
1833
1910
|
* @param {string} [defaultColor]
|
|
1911
|
+
* @param {string} [overrideColor]
|
|
1834
1912
|
*
|
|
1835
1913
|
* @return {string}
|
|
1836
1914
|
*/
|
|
1837
|
-
function getFillColor(element, defaultColor) {
|
|
1915
|
+
function getFillColor(element, defaultColor, overrideColor) {
|
|
1838
1916
|
var di = getDi(element);
|
|
1839
1917
|
|
|
1840
|
-
return di.get('color:background-color') || di.get('bioc:fill') || defaultColor ||
|
|
1918
|
+
return overrideColor || di.get('color:background-color') || di.get('bioc:fill') || defaultColor || white;
|
|
1841
1919
|
}
|
|
1842
1920
|
|
|
1843
1921
|
/**
|
|
1844
1922
|
* @param {Element} element
|
|
1845
1923
|
* @param {string} [defaultColor]
|
|
1924
|
+
* @param {string} [overrideColor]
|
|
1846
1925
|
*
|
|
1847
1926
|
* @return {string}
|
|
1848
1927
|
*/
|
|
1849
|
-
function getStrokeColor(element, defaultColor) {
|
|
1928
|
+
function getStrokeColor(element, defaultColor, overrideColor) {
|
|
1850
1929
|
var di = getDi(element);
|
|
1851
1930
|
|
|
1852
|
-
return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
|
|
1931
|
+
return overrideColor || di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
|
|
1853
1932
|
}
|
|
1854
1933
|
|
|
1855
1934
|
/**
|
|
1856
1935
|
* @param {Element} element
|
|
1857
1936
|
* @param {string} [defaultColor]
|
|
1858
1937
|
* @param {string} [defaultStrokeColor]
|
|
1938
|
+
* @param {string} [overrideColor]
|
|
1859
1939
|
*
|
|
1860
1940
|
* @return {string}
|
|
1861
1941
|
*/
|
|
1862
|
-
function getLabelColor(element, defaultColor, defaultStrokeColor) {
|
|
1942
|
+
function getLabelColor(element, defaultColor, defaultStrokeColor, overrideColor) {
|
|
1863
1943
|
var di = getDi(element),
|
|
1864
1944
|
label = di.get('label');
|
|
1865
1945
|
|
|
1866
|
-
return label && label.get('color:color') || defaultColor ||
|
|
1946
|
+
return overrideColor || (label && label.get('color:color')) || defaultColor ||
|
|
1867
1947
|
getStrokeColor(element, defaultStrokeColor);
|
|
1868
1948
|
}
|
|
1869
1949
|
|
|
@@ -1967,6 +2047,45 @@
|
|
|
1967
2047
|
return componentsToPath(rectPath);
|
|
1968
2048
|
}
|
|
1969
2049
|
|
|
2050
|
+
/**
|
|
2051
|
+
* Get width and height from element or overrides.
|
|
2052
|
+
*
|
|
2053
|
+
* @param {Dimensions|Rect|ShapeLike} bounds
|
|
2054
|
+
* @param {Object} overrides
|
|
2055
|
+
*
|
|
2056
|
+
* @returns {Dimensions}
|
|
2057
|
+
*/
|
|
2058
|
+
function getBounds(bounds, overrides = {}) {
|
|
2059
|
+
return {
|
|
2060
|
+
width: getWidth(bounds, overrides),
|
|
2061
|
+
height: getHeight(bounds, overrides)
|
|
2062
|
+
};
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
* Get width from element or overrides.
|
|
2067
|
+
*
|
|
2068
|
+
* @param {Dimensions|Rect|ShapeLike} bounds
|
|
2069
|
+
* @param {Object} overrides
|
|
2070
|
+
*
|
|
2071
|
+
* @returns {number}
|
|
2072
|
+
*/
|
|
2073
|
+
function getWidth(bounds, overrides = {}) {
|
|
2074
|
+
return has$1(overrides, 'width') ? overrides.width : bounds.width;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* Get height from element or overrides.
|
|
2079
|
+
*
|
|
2080
|
+
* @param {Dimensions|Rect|ShapeLike} bounds
|
|
2081
|
+
* @param {Object} overrides
|
|
2082
|
+
*
|
|
2083
|
+
* @returns {number}
|
|
2084
|
+
*/
|
|
2085
|
+
function getHeight(bounds, overrides = {}) {
|
|
2086
|
+
return has$1(overrides, 'height') ? overrides.height : bounds.height;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
1970
2089
|
function _mergeNamespaces$1(n, m) {
|
|
1971
2090
|
m.forEach(function (e) {
|
|
1972
2091
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -2730,15 +2849,16 @@
|
|
|
2730
2849
|
}
|
|
2731
2850
|
};
|
|
2732
2851
|
|
|
2733
|
-
var
|
|
2852
|
+
var rendererIds = new Ids();
|
|
2734
2853
|
|
|
2735
|
-
var
|
|
2736
|
-
|
|
2854
|
+
var ELEMENT_LABEL_DISTANCE = 10,
|
|
2855
|
+
INNER_OUTER_DIST = 3,
|
|
2856
|
+
PARTICIPANT_STROKE_WIDTH = 1.5,
|
|
2857
|
+
TASK_BORDER_RADIUS = 10;
|
|
2737
2858
|
|
|
2738
|
-
var
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
var ELEMENT_LABEL_DISTANCE = 10;
|
|
2859
|
+
var DEFAULT_OPACITY = 0.95,
|
|
2860
|
+
FULL_OPACITY = 1,
|
|
2861
|
+
LOW_OPACITY = 0.25;
|
|
2742
2862
|
|
|
2743
2863
|
/**
|
|
2744
2864
|
* @typedef { Partial<{
|
|
@@ -2746,6 +2866,13 @@
|
|
|
2746
2866
|
* defaultStrokeColor: string,
|
|
2747
2867
|
* defaultLabelColor: string
|
|
2748
2868
|
* }> } BpmnRendererConfig
|
|
2869
|
+
*
|
|
2870
|
+
* @typedef { Partial<{
|
|
2871
|
+
* fill: string,
|
|
2872
|
+
* stroke: string,
|
|
2873
|
+
* width: string,
|
|
2874
|
+
* height: string
|
|
2875
|
+
* }> } Attrs
|
|
2749
2876
|
*/
|
|
2750
2877
|
|
|
2751
2878
|
/**
|
|
@@ -2773,7 +2900,7 @@
|
|
|
2773
2900
|
defaultStrokeColor = config && config.defaultStrokeColor,
|
|
2774
2901
|
defaultLabelColor = config && config.defaultLabelColor;
|
|
2775
2902
|
|
|
2776
|
-
var rendererId =
|
|
2903
|
+
var rendererId = rendererIds.next();
|
|
2777
2904
|
|
|
2778
2905
|
var markers = {};
|
|
2779
2906
|
|
|
@@ -2869,7 +2996,7 @@
|
|
|
2869
2996
|
cy: 6,
|
|
2870
2997
|
r: 3.5,
|
|
2871
2998
|
...shapeStyle({
|
|
2872
|
-
fill
|
|
2999
|
+
fill,
|
|
2873
3000
|
stroke: stroke,
|
|
2874
3001
|
strokeWidth: 1,
|
|
2875
3002
|
|
|
@@ -2889,7 +3016,7 @@
|
|
|
2889
3016
|
var messageflowEnd = create$1('path', {
|
|
2890
3017
|
d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z',
|
|
2891
3018
|
...shapeStyle({
|
|
2892
|
-
fill
|
|
3019
|
+
fill,
|
|
2893
3020
|
stroke: stroke,
|
|
2894
3021
|
strokeWidth: 1,
|
|
2895
3022
|
|
|
@@ -2910,7 +3037,7 @@
|
|
|
2910
3037
|
d: 'M 11 5 L 1 10 L 11 15',
|
|
2911
3038
|
...lineStyle({
|
|
2912
3039
|
fill: 'none',
|
|
2913
|
-
stroke
|
|
3040
|
+
stroke,
|
|
2914
3041
|
strokeWidth: 1.5,
|
|
2915
3042
|
|
|
2916
3043
|
// fix for safari / chrome / firefox bug not correctly
|
|
@@ -2931,7 +3058,7 @@
|
|
|
2931
3058
|
d: 'M 1 5 L 11 10 L 1 15',
|
|
2932
3059
|
...lineStyle({
|
|
2933
3060
|
fill: 'none',
|
|
2934
|
-
stroke
|
|
3061
|
+
stroke,
|
|
2935
3062
|
strokeWidth: 1.5,
|
|
2936
3063
|
|
|
2937
3064
|
// fix for safari / chrome / firefox bug not correctly
|
|
@@ -2951,7 +3078,7 @@
|
|
|
2951
3078
|
var conditionalFlowMarker = create$1('path', {
|
|
2952
3079
|
d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z',
|
|
2953
3080
|
...shapeStyle({
|
|
2954
|
-
fill
|
|
3081
|
+
fill,
|
|
2955
3082
|
stroke: stroke
|
|
2956
3083
|
})
|
|
2957
3084
|
});
|
|
@@ -2979,7 +3106,7 @@
|
|
|
2979
3106
|
}
|
|
2980
3107
|
}
|
|
2981
3108
|
|
|
2982
|
-
function drawCircle(parentGfx, width, height, offset, attrs) {
|
|
3109
|
+
function drawCircle(parentGfx, width, height, offset, attrs = {}) {
|
|
2983
3110
|
|
|
2984
3111
|
if (isObject(offset)) {
|
|
2985
3112
|
attrs = offset;
|
|
@@ -2990,10 +3117,6 @@
|
|
|
2990
3117
|
|
|
2991
3118
|
attrs = shapeStyle(attrs);
|
|
2992
3119
|
|
|
2993
|
-
if (attrs.fill === 'none') {
|
|
2994
|
-
delete attrs.fillOpacity;
|
|
2995
|
-
}
|
|
2996
|
-
|
|
2997
3120
|
var cx = width / 2,
|
|
2998
3121
|
cy = height / 2;
|
|
2999
3122
|
|
|
@@ -3093,7 +3216,6 @@
|
|
|
3093
3216
|
}
|
|
3094
3217
|
|
|
3095
3218
|
function drawPath(parentGfx, d, attrs) {
|
|
3096
|
-
|
|
3097
3219
|
attrs = lineStyle(attrs);
|
|
3098
3220
|
|
|
3099
3221
|
var path = create$1('path', {
|
|
@@ -3115,171 +3237,13 @@
|
|
|
3115
3237
|
}
|
|
3116
3238
|
|
|
3117
3239
|
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
|
|
3240
|
+
return function(parentGfx, element, attrs) {
|
|
3241
|
+
return renderer(type)(parentGfx, element, attrs);
|
|
3217
3242
|
};
|
|
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
3243
|
}
|
|
3231
3244
|
|
|
3232
|
-
|
|
3233
|
-
|
|
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
|
-
}
|
|
3248
|
-
|
|
3249
|
-
var handlers = this.handlers = {
|
|
3250
|
-
'bpmn:Event': function(parentGfx, element, attrs) {
|
|
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) {
|
|
3245
|
+
var eventIconRenderers = {
|
|
3246
|
+
'bpmn:MessageEventDefinition': function(parentGfx, element, attrs = {}, isThrowing) {
|
|
3283
3247
|
var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
|
|
3284
3248
|
xScaleFactor: 0.9,
|
|
3285
3249
|
yScaleFactor: 0.9,
|
|
@@ -3291,22 +3255,27 @@
|
|
|
3291
3255
|
}
|
|
3292
3256
|
});
|
|
3293
3257
|
|
|
3294
|
-
var fill = isThrowing
|
|
3295
|
-
|
|
3258
|
+
var fill = isThrowing
|
|
3259
|
+
? getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3260
|
+
: getFillColor(element, defaultFillColor, attrs.fill);
|
|
3261
|
+
|
|
3262
|
+
var stroke = isThrowing
|
|
3263
|
+
? getFillColor(element, defaultFillColor, attrs.fill)
|
|
3264
|
+
: getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3296
3265
|
|
|
3297
3266
|
var messagePath = drawPath(parentGfx, pathData, {
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3267
|
+
fill,
|
|
3268
|
+
stroke,
|
|
3269
|
+
strokeWidth: 1
|
|
3301
3270
|
});
|
|
3302
3271
|
|
|
3303
3272
|
return messagePath;
|
|
3304
3273
|
},
|
|
3305
|
-
'bpmn:TimerEventDefinition': function(parentGfx, element) {
|
|
3274
|
+
'bpmn:TimerEventDefinition': function(parentGfx, element, attrs = {}) {
|
|
3306
3275
|
var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, {
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3276
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3277
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3278
|
+
strokeWidth: 2
|
|
3310
3279
|
});
|
|
3311
3280
|
|
|
3312
3281
|
var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
|
|
@@ -3321,12 +3290,11 @@
|
|
|
3321
3290
|
});
|
|
3322
3291
|
|
|
3323
3292
|
drawPath(parentGfx, pathData, {
|
|
3324
|
-
|
|
3325
|
-
|
|
3293
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3294
|
+
strokeWidth: 2
|
|
3326
3295
|
});
|
|
3327
3296
|
|
|
3328
|
-
for (var i = 0;i < 12; i++) {
|
|
3329
|
-
|
|
3297
|
+
for (var i = 0; i < 12; i++) {
|
|
3330
3298
|
var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
|
|
3331
3299
|
xScaleFactor: 0.75,
|
|
3332
3300
|
yScaleFactor: 0.75,
|
|
@@ -3338,19 +3306,19 @@
|
|
|
3338
3306
|
}
|
|
3339
3307
|
});
|
|
3340
3308
|
|
|
3341
|
-
var width = element.width / 2
|
|
3342
|
-
|
|
3309
|
+
var width = element.width / 2,
|
|
3310
|
+
height = element.height / 2;
|
|
3343
3311
|
|
|
3344
3312
|
drawPath(parentGfx, linePathData, {
|
|
3345
3313
|
strokeWidth: 1,
|
|
3346
|
-
|
|
3347
|
-
|
|
3314
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3315
|
+
transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
|
|
3348
3316
|
});
|
|
3349
3317
|
}
|
|
3350
3318
|
|
|
3351
3319
|
return circle;
|
|
3352
3320
|
},
|
|
3353
|
-
'bpmn:EscalationEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3321
|
+
'bpmn:EscalationEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3354
3322
|
var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
|
|
3355
3323
|
xScaleFactor: 1,
|
|
3356
3324
|
yScaleFactor: 1,
|
|
@@ -3362,15 +3330,17 @@
|
|
|
3362
3330
|
}
|
|
3363
3331
|
});
|
|
3364
3332
|
|
|
3365
|
-
var fill = isThrowing
|
|
3333
|
+
var fill = isThrowing
|
|
3334
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3335
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3366
3336
|
|
|
3367
3337
|
return drawPath(parentGfx, pathData, {
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3338
|
+
fill,
|
|
3339
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3340
|
+
strokeWidth: 1
|
|
3371
3341
|
});
|
|
3372
3342
|
},
|
|
3373
|
-
'bpmn:ConditionalEventDefinition': function(parentGfx, event) {
|
|
3343
|
+
'bpmn:ConditionalEventDefinition': function(parentGfx, event, attrs = {}) {
|
|
3374
3344
|
var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
|
|
3375
3345
|
xScaleFactor: 1,
|
|
3376
3346
|
yScaleFactor: 1,
|
|
@@ -3383,11 +3353,12 @@
|
|
|
3383
3353
|
});
|
|
3384
3354
|
|
|
3385
3355
|
return drawPath(parentGfx, pathData, {
|
|
3386
|
-
|
|
3387
|
-
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
3356
|
+
fill: getFillColor(event, defaultFillColor, attrs.fill),
|
|
3357
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3358
|
+
strokeWidth: 1
|
|
3388
3359
|
});
|
|
3389
3360
|
},
|
|
3390
|
-
'bpmn:LinkEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3361
|
+
'bpmn:LinkEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3391
3362
|
var pathData = pathMap.getScaledPath('EVENT_LINK', {
|
|
3392
3363
|
xScaleFactor: 1,
|
|
3393
3364
|
yScaleFactor: 1,
|
|
@@ -3399,15 +3370,17 @@
|
|
|
3399
3370
|
}
|
|
3400
3371
|
});
|
|
3401
3372
|
|
|
3402
|
-
var fill = isThrowing
|
|
3373
|
+
var fill = isThrowing
|
|
3374
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3375
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3403
3376
|
|
|
3404
3377
|
return drawPath(parentGfx, pathData, {
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3378
|
+
fill,
|
|
3379
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3380
|
+
strokeWidth: 1
|
|
3408
3381
|
});
|
|
3409
3382
|
},
|
|
3410
|
-
'bpmn:ErrorEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3383
|
+
'bpmn:ErrorEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3411
3384
|
var pathData = pathMap.getScaledPath('EVENT_ERROR', {
|
|
3412
3385
|
xScaleFactor: 1.1,
|
|
3413
3386
|
yScaleFactor: 1.1,
|
|
@@ -3419,15 +3392,17 @@
|
|
|
3419
3392
|
}
|
|
3420
3393
|
});
|
|
3421
3394
|
|
|
3422
|
-
var fill = isThrowing
|
|
3395
|
+
var fill = isThrowing
|
|
3396
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3397
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3423
3398
|
|
|
3424
3399
|
return drawPath(parentGfx, pathData, {
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3400
|
+
fill,
|
|
3401
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3402
|
+
strokeWidth: 1
|
|
3428
3403
|
});
|
|
3429
3404
|
},
|
|
3430
|
-
'bpmn:CancelEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3405
|
+
'bpmn:CancelEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3431
3406
|
var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
|
|
3432
3407
|
xScaleFactor: 1.0,
|
|
3433
3408
|
yScaleFactor: 1.0,
|
|
@@ -3439,19 +3414,19 @@
|
|
|
3439
3414
|
}
|
|
3440
3415
|
});
|
|
3441
3416
|
|
|
3442
|
-
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
3417
|
+
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor, attrs.stroke) : 'none';
|
|
3443
3418
|
|
|
3444
3419
|
var path = drawPath(parentGfx, pathData, {
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3420
|
+
fill,
|
|
3421
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3422
|
+
strokeWidth: 1
|
|
3448
3423
|
});
|
|
3449
3424
|
|
|
3450
3425
|
rotate(path, 45);
|
|
3451
3426
|
|
|
3452
3427
|
return path;
|
|
3453
3428
|
},
|
|
3454
|
-
'bpmn:CompensateEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3429
|
+
'bpmn:CompensateEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3455
3430
|
var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
|
|
3456
3431
|
xScaleFactor: 1,
|
|
3457
3432
|
yScaleFactor: 1,
|
|
@@ -3463,15 +3438,17 @@
|
|
|
3463
3438
|
}
|
|
3464
3439
|
});
|
|
3465
3440
|
|
|
3466
|
-
var fill = isThrowing
|
|
3441
|
+
var fill = isThrowing
|
|
3442
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3443
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3467
3444
|
|
|
3468
3445
|
return drawPath(parentGfx, pathData, {
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3446
|
+
fill,
|
|
3447
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3448
|
+
strokeWidth: 1
|
|
3472
3449
|
});
|
|
3473
3450
|
},
|
|
3474
|
-
'bpmn:SignalEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3451
|
+
'bpmn:SignalEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3475
3452
|
var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
|
|
3476
3453
|
xScaleFactor: 0.9,
|
|
3477
3454
|
yScaleFactor: 0.9,
|
|
@@ -3483,15 +3460,17 @@
|
|
|
3483
3460
|
}
|
|
3484
3461
|
});
|
|
3485
3462
|
|
|
3486
|
-
var fill = isThrowing
|
|
3463
|
+
var fill = isThrowing
|
|
3464
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3465
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3487
3466
|
|
|
3488
3467
|
return drawPath(parentGfx, pathData, {
|
|
3489
3468
|
strokeWidth: 1,
|
|
3490
|
-
fill
|
|
3491
|
-
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
3469
|
+
fill,
|
|
3470
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3492
3471
|
});
|
|
3493
3472
|
},
|
|
3494
|
-
'bpmn:MultipleEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3473
|
+
'bpmn:MultipleEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3495
3474
|
var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
|
|
3496
3475
|
xScaleFactor: 1.1,
|
|
3497
3476
|
yScaleFactor: 1.1,
|
|
@@ -3503,14 +3482,16 @@
|
|
|
3503
3482
|
}
|
|
3504
3483
|
});
|
|
3505
3484
|
|
|
3506
|
-
var fill = isThrowing
|
|
3485
|
+
var fill = isThrowing
|
|
3486
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3487
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3507
3488
|
|
|
3508
3489
|
return drawPath(parentGfx, pathData, {
|
|
3509
|
-
|
|
3510
|
-
|
|
3490
|
+
fill,
|
|
3491
|
+
strokeWidth: 1
|
|
3511
3492
|
});
|
|
3512
3493
|
},
|
|
3513
|
-
'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event) {
|
|
3494
|
+
'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event, attrs = {}) {
|
|
3514
3495
|
var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
|
|
3515
3496
|
xScaleFactor: 1.2,
|
|
3516
3497
|
yScaleFactor: 1.2,
|
|
@@ -3523,501 +3504,791 @@
|
|
|
3523
3504
|
});
|
|
3524
3505
|
|
|
3525
3506
|
return drawPath(parentGfx, pathData, {
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
});
|
|
3530
|
-
},
|
|
3531
|
-
'bpmn:EndEvent': function(parentGfx, element, options) {
|
|
3532
|
-
var circle = renderer('bpmn:Event')(parentGfx, element, {
|
|
3533
|
-
strokeWidth: 4,
|
|
3534
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3535
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3507
|
+
fill: getFillColor(event, defaultFillColor, attrs.fill),
|
|
3508
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3509
|
+
strokeWidth: 1
|
|
3536
3510
|
});
|
|
3537
|
-
|
|
3538
|
-
if (!options || options.renderIcon !== false) {
|
|
3539
|
-
renderEventContent(element, parentGfx);
|
|
3540
|
-
}
|
|
3541
|
-
|
|
3542
|
-
return circle;
|
|
3543
3511
|
},
|
|
3544
|
-
'bpmn:TerminateEventDefinition': function(parentGfx, element) {
|
|
3512
|
+
'bpmn:TerminateEventDefinition': function(parentGfx, element, attrs = {}) {
|
|
3545
3513
|
var circle = drawCircle(parentGfx, element.width, element.height, 8, {
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3514
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3515
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3516
|
+
strokeWidth: 4
|
|
3549
3517
|
});
|
|
3550
3518
|
|
|
3551
3519
|
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
|
-
});
|
|
3520
|
+
}
|
|
3521
|
+
};
|
|
3559
3522
|
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
fill: getFillColor(element, 'none'),
|
|
3564
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3565
|
-
});
|
|
3523
|
+
function renderEventIcon(element, parentGfx, attrs = {}) {
|
|
3524
|
+
var semantic = getBusinessObject(element),
|
|
3525
|
+
isThrowing = isThrowEvent(semantic);
|
|
3566
3526
|
|
|
3567
|
-
|
|
3568
|
-
|
|
3527
|
+
if (semantic.get('eventDefinitions') && semantic.get('eventDefinitions').length > 1) {
|
|
3528
|
+
if (semantic.get('parallelMultiple')) {
|
|
3529
|
+
return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3530
|
+
}
|
|
3531
|
+
else {
|
|
3532
|
+
return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3569
3533
|
}
|
|
3534
|
+
}
|
|
3570
3535
|
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
|
|
3536
|
+
if (isTypedEvent(semantic, 'bpmn:MessageEventDefinition')) {
|
|
3537
|
+
return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3538
|
+
}
|
|
3575
3539
|
|
|
3576
|
-
'bpmn:
|
|
3540
|
+
if (isTypedEvent(semantic, 'bpmn:TimerEventDefinition')) {
|
|
3541
|
+
return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3542
|
+
}
|
|
3577
3543
|
|
|
3578
|
-
|
|
3544
|
+
if (isTypedEvent(semantic, 'bpmn:ConditionalEventDefinition')) {
|
|
3545
|
+
return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3546
|
+
}
|
|
3579
3547
|
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3548
|
+
if (isTypedEvent(semantic, 'bpmn:SignalEventDefinition')) {
|
|
3549
|
+
return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3550
|
+
}
|
|
3583
3551
|
|
|
3584
|
-
|
|
3585
|
-
|
|
3552
|
+
if (isTypedEvent(semantic, 'bpmn:EscalationEventDefinition')) {
|
|
3553
|
+
return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3554
|
+
}
|
|
3586
3555
|
|
|
3587
|
-
'bpmn:
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3591
|
-
};
|
|
3556
|
+
if (isTypedEvent(semantic, 'bpmn:LinkEventDefinition')) {
|
|
3557
|
+
return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3558
|
+
}
|
|
3592
3559
|
|
|
3593
|
-
|
|
3560
|
+
if (isTypedEvent(semantic, 'bpmn:ErrorEventDefinition')) {
|
|
3561
|
+
return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3562
|
+
}
|
|
3594
3563
|
|
|
3595
|
-
|
|
3596
|
-
|
|
3564
|
+
if (isTypedEvent(semantic, 'bpmn:CancelEventDefinition')) {
|
|
3565
|
+
return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3566
|
+
}
|
|
3597
3567
|
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
3568
|
+
if (isTypedEvent(semantic, 'bpmn:CompensateEventDefinition')) {
|
|
3569
|
+
return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3570
|
+
}
|
|
3602
3571
|
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3572
|
+
if (isTypedEvent(semantic, 'bpmn:TerminateEventDefinition')) {
|
|
3573
|
+
return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
return null;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
var taskMarkerRenderers = {
|
|
3580
|
+
'ParticipantMultiplicityMarker': function(parentGfx, element, attrs = {}) {
|
|
3581
|
+
var width = getWidth(element, attrs),
|
|
3582
|
+
height = getHeight(element, attrs);
|
|
3583
|
+
|
|
3584
|
+
var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {
|
|
3585
|
+
xScaleFactor: 1,
|
|
3586
|
+
yScaleFactor: 1,
|
|
3587
|
+
containerWidth: width,
|
|
3588
|
+
containerHeight: height,
|
|
3589
|
+
position: {
|
|
3590
|
+
mx: ((width / 2 - 6) / width),
|
|
3591
|
+
my: (height - 15) / height
|
|
3607
3592
|
}
|
|
3608
3593
|
});
|
|
3609
3594
|
|
|
3610
|
-
|
|
3595
|
+
drawMarker('participant-multiplicity', parentGfx, markerPath, {
|
|
3596
|
+
strokeWidth: 2,
|
|
3597
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3598
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3599
|
+
});
|
|
3600
|
+
},
|
|
3601
|
+
'SubProcessMarker': function(parentGfx, element, attrs = {}) {
|
|
3602
|
+
var markerRect = drawRect(parentGfx, 14, 14, 0, {
|
|
3611
3603
|
strokeWidth: 1,
|
|
3612
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3613
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3604
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3605
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3614
3606
|
});
|
|
3615
3607
|
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3608
|
+
translate$1(markerRect, element.width / 2 - 7.5, element.height - 20);
|
|
3609
|
+
|
|
3610
|
+
var markerPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
|
|
3611
|
+
xScaleFactor: 1.5,
|
|
3612
|
+
yScaleFactor: 1.5,
|
|
3613
|
+
containerWidth: element.width,
|
|
3614
|
+
containerHeight: element.height,
|
|
3615
|
+
position: {
|
|
3616
|
+
mx: (element.width / 2 - 7.5) / element.width,
|
|
3617
|
+
my: (element.height - 20) / element.height
|
|
3620
3618
|
}
|
|
3621
3619
|
});
|
|
3622
3620
|
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3621
|
+
drawMarker('sub-process', parentGfx, markerPath, {
|
|
3622
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3623
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3626
3624
|
});
|
|
3625
|
+
},
|
|
3626
|
+
'ParallelMarker': function(parentGfx, element, attrs) {
|
|
3627
|
+
var width = getWidth(element, attrs),
|
|
3628
|
+
height = getHeight(element, attrs);
|
|
3627
3629
|
|
|
3628
|
-
var
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3630
|
+
var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {
|
|
3631
|
+
xScaleFactor: 1,
|
|
3632
|
+
yScaleFactor: 1,
|
|
3633
|
+
containerWidth: width,
|
|
3634
|
+
containerHeight: height,
|
|
3635
|
+
position: {
|
|
3636
|
+
mx: ((width / 2 + attrs.parallel) / width),
|
|
3637
|
+
my: (height - 20) / height
|
|
3632
3638
|
}
|
|
3633
3639
|
});
|
|
3634
3640
|
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3641
|
+
drawMarker('parallel', parentGfx, markerPath, {
|
|
3642
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3643
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3639
3644
|
});
|
|
3640
|
-
|
|
3641
|
-
return task;
|
|
3642
3645
|
},
|
|
3643
|
-
'
|
|
3644
|
-
var
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
y: y
|
|
3646
|
+
'SequentialMarker': function(parentGfx, element, attrs) {
|
|
3647
|
+
var markerPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
|
|
3648
|
+
xScaleFactor: 1,
|
|
3649
|
+
yScaleFactor: 1,
|
|
3650
|
+
containerWidth: element.width,
|
|
3651
|
+
containerHeight: element.height,
|
|
3652
|
+
position: {
|
|
3653
|
+
mx: ((element.width / 2 + attrs.seq) / element.width),
|
|
3654
|
+
my: (element.height - 19) / element.height
|
|
3653
3655
|
}
|
|
3654
3656
|
});
|
|
3655
3657
|
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3658
|
+
drawMarker('sequential', parentGfx, markerPath, {
|
|
3659
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3660
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3660
3661
|
});
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3662
|
+
},
|
|
3663
|
+
'CompensationMarker': function(parentGfx, element, attrs) {
|
|
3664
|
+
var markerMath = pathMap.getScaledPath('MARKER_COMPENSATION', {
|
|
3665
|
+
xScaleFactor: 1,
|
|
3666
|
+
yScaleFactor: 1,
|
|
3667
|
+
containerWidth: element.width,
|
|
3668
|
+
containerHeight: element.height,
|
|
3669
|
+
position: {
|
|
3670
|
+
mx: ((element.width / 2 + attrs.compensation) / element.width),
|
|
3671
|
+
my: (element.height - 13) / element.height
|
|
3666
3672
|
}
|
|
3667
3673
|
});
|
|
3668
3674
|
|
|
3669
|
-
|
|
3670
|
-
strokeWidth:
|
|
3671
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3672
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3675
|
+
drawMarker('compensation', parentGfx, markerMath, {
|
|
3676
|
+
strokeWidth: 1,
|
|
3677
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3678
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3673
3679
|
});
|
|
3680
|
+
},
|
|
3681
|
+
'LoopMarker': function(parentGfx, element, attrs) {
|
|
3682
|
+
var width = getWidth(element, attrs),
|
|
3683
|
+
height = getHeight(element, attrs);
|
|
3674
3684
|
|
|
3675
|
-
var
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3685
|
+
var markerPath = pathMap.getScaledPath('MARKER_LOOP', {
|
|
3686
|
+
xScaleFactor: 1,
|
|
3687
|
+
yScaleFactor: 1,
|
|
3688
|
+
containerWidth: width,
|
|
3689
|
+
containerHeight: height,
|
|
3690
|
+
position: {
|
|
3691
|
+
mx: ((width / 2 + attrs.loop) / width),
|
|
3692
|
+
my: (height - 7) / height
|
|
3679
3693
|
}
|
|
3680
3694
|
});
|
|
3681
3695
|
|
|
3682
|
-
|
|
3683
|
-
strokeWidth:
|
|
3684
|
-
fill:
|
|
3685
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3696
|
+
drawMarker('loop', parentGfx, markerPath, {
|
|
3697
|
+
strokeWidth: 1.5,
|
|
3698
|
+
fill: 'none',
|
|
3699
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3700
|
+
strokeMiterlimit: 0.5
|
|
3686
3701
|
});
|
|
3687
|
-
|
|
3688
|
-
return task;
|
|
3689
3702
|
},
|
|
3690
|
-
'
|
|
3691
|
-
var
|
|
3703
|
+
'AdhocMarker': function(parentGfx, element, attrs) {
|
|
3704
|
+
var width = getWidth(element, attrs),
|
|
3705
|
+
height = getHeight(element, attrs);
|
|
3692
3706
|
|
|
3693
|
-
var
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3707
|
+
var markerPath = pathMap.getScaledPath('MARKER_ADHOC', {
|
|
3708
|
+
xScaleFactor: 1,
|
|
3709
|
+
yScaleFactor: 1,
|
|
3710
|
+
containerWidth: width,
|
|
3711
|
+
containerHeight: height,
|
|
3712
|
+
position: {
|
|
3713
|
+
mx: ((width / 2 + attrs.adhoc) / width),
|
|
3714
|
+
my: (height - 15) / height
|
|
3697
3715
|
}
|
|
3698
3716
|
});
|
|
3699
3717
|
|
|
3700
|
-
|
|
3701
|
-
strokeWidth:
|
|
3702
|
-
fill:
|
|
3703
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3718
|
+
drawMarker('adhoc', parentGfx, markerPath, {
|
|
3719
|
+
strokeWidth: 1,
|
|
3720
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3721
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3704
3722
|
});
|
|
3723
|
+
}
|
|
3724
|
+
};
|
|
3705
3725
|
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
3726
|
+
function renderTaskMarker(type, parentGfx, element, attrs) {
|
|
3727
|
+
taskMarkerRenderers[ type ](parentGfx, element, attrs);
|
|
3728
|
+
}
|
|
3710
3729
|
|
|
3711
|
-
|
|
3730
|
+
function renderTaskMarkers(parentGfx, element, taskMarkers, attrs = {}) {
|
|
3731
|
+
attrs = {
|
|
3732
|
+
fill: attrs.fill,
|
|
3733
|
+
stroke: attrs.stroke,
|
|
3734
|
+
width: getWidth(element, attrs),
|
|
3735
|
+
height: getHeight(element, attrs)
|
|
3736
|
+
};
|
|
3737
|
+
|
|
3738
|
+
var semantic = getBusinessObject(element);
|
|
3739
|
+
|
|
3740
|
+
var subprocess = taskMarkers && taskMarkers.includes('SubProcessMarker');
|
|
3741
|
+
|
|
3742
|
+
if (subprocess) {
|
|
3743
|
+
attrs = {
|
|
3744
|
+
...attrs,
|
|
3745
|
+
seq: -21,
|
|
3746
|
+
parallel: -22,
|
|
3747
|
+
compensation: -42,
|
|
3748
|
+
loop: -18,
|
|
3749
|
+
adhoc: 10
|
|
3750
|
+
};
|
|
3751
|
+
} else {
|
|
3752
|
+
attrs = {
|
|
3753
|
+
...attrs,
|
|
3754
|
+
seq: -5,
|
|
3755
|
+
parallel: -6,
|
|
3756
|
+
compensation: -27,
|
|
3757
|
+
loop: 0,
|
|
3758
|
+
adhoc: 10
|
|
3759
|
+
};
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
forEach$1(taskMarkers, function(marker) {
|
|
3763
|
+
renderTaskMarker(marker, parentGfx, element, attrs);
|
|
3764
|
+
});
|
|
3765
|
+
|
|
3766
|
+
if (semantic.get('isForCompensation')) {
|
|
3767
|
+
renderTaskMarker('CompensationMarker', parentGfx, element, attrs);
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
if (is$1(semantic, 'bpmn:AdHocSubProcess')) {
|
|
3771
|
+
renderTaskMarker('AdhocMarker', parentGfx, element, attrs);
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
var loopCharacteristics = semantic.get('loopCharacteristics'),
|
|
3775
|
+
isSequential = loopCharacteristics && loopCharacteristics.get('isSequential');
|
|
3776
|
+
|
|
3777
|
+
if (loopCharacteristics) {
|
|
3778
|
+
|
|
3779
|
+
if (isSequential === undefined) {
|
|
3780
|
+
renderTaskMarker('LoopMarker', parentGfx, element, attrs);
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
if (isSequential === false) {
|
|
3784
|
+
renderTaskMarker('ParallelMarker', parentGfx, element, attrs);
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
if (isSequential === true) {
|
|
3788
|
+
renderTaskMarker('SequentialMarker', parentGfx, element, attrs);
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3793
|
+
function renderLabel(parentGfx, label, attrs = {}) {
|
|
3794
|
+
attrs = assign$1({
|
|
3795
|
+
size: {
|
|
3796
|
+
width: 100
|
|
3797
|
+
}
|
|
3798
|
+
}, attrs);
|
|
3799
|
+
|
|
3800
|
+
var text = textRenderer.createText(label || '', attrs);
|
|
3801
|
+
|
|
3802
|
+
classes$1(text).add('djs-label');
|
|
3803
|
+
|
|
3804
|
+
append(parentGfx, text);
|
|
3805
|
+
|
|
3806
|
+
return text;
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3809
|
+
function renderEmbeddedLabel(parentGfx, element, align, attrs = {}) {
|
|
3810
|
+
var semantic = getBusinessObject(element);
|
|
3811
|
+
|
|
3812
|
+
var box = getBounds({
|
|
3813
|
+
x: element.x,
|
|
3814
|
+
y: element.y,
|
|
3815
|
+
width: element.width,
|
|
3816
|
+
height: element.height
|
|
3817
|
+
}, attrs);
|
|
3818
|
+
|
|
3819
|
+
return renderLabel(parentGfx, semantic.name, {
|
|
3820
|
+
align,
|
|
3821
|
+
box,
|
|
3822
|
+
padding: 7,
|
|
3823
|
+
style: {
|
|
3824
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3825
|
+
}
|
|
3826
|
+
});
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
function renderExternalLabel(parentGfx, element, attrs = {}) {
|
|
3830
|
+
var box = {
|
|
3831
|
+
width: 90,
|
|
3832
|
+
height: 30,
|
|
3833
|
+
x: element.width / 2 + element.x,
|
|
3834
|
+
y: element.height / 2 + element.y
|
|
3835
|
+
};
|
|
3836
|
+
|
|
3837
|
+
return renderLabel(parentGfx, getLabel(element), {
|
|
3838
|
+
box: box,
|
|
3839
|
+
fitBox: true,
|
|
3840
|
+
style: assign$1(
|
|
3841
|
+
{},
|
|
3842
|
+
textRenderer.getExternalStyle(),
|
|
3843
|
+
{
|
|
3844
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3845
|
+
}
|
|
3846
|
+
)
|
|
3847
|
+
});
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3850
|
+
function renderLaneLabel(parentGfx, text, element, attrs = {}) {
|
|
3851
|
+
var isHorizontalLane = isHorizontal(element);
|
|
3852
|
+
|
|
3853
|
+
var textBox = renderLabel(parentGfx, text, {
|
|
3854
|
+
box: {
|
|
3855
|
+
height: 30,
|
|
3856
|
+
width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs),
|
|
3857
|
+
},
|
|
3858
|
+
align: 'center-middle',
|
|
3859
|
+
style: {
|
|
3860
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3861
|
+
}
|
|
3862
|
+
});
|
|
3863
|
+
|
|
3864
|
+
if (isHorizontalLane) {
|
|
3865
|
+
var top = -1 * getHeight(element, attrs);
|
|
3866
|
+
transform(textBox, 0, -top, 270);
|
|
3867
|
+
}
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3870
|
+
function renderActivity(parentGfx, element, attrs = {}) {
|
|
3871
|
+
var {
|
|
3872
|
+
width,
|
|
3873
|
+
height
|
|
3874
|
+
} = getBounds(element, attrs);
|
|
3875
|
+
|
|
3876
|
+
return drawRect(parentGfx, width, height, TASK_BORDER_RADIUS, {
|
|
3877
|
+
...attrs,
|
|
3878
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3879
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3880
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3881
|
+
});
|
|
3882
|
+
}
|
|
3883
|
+
|
|
3884
|
+
function renderAssociation(parentGfx, element, attrs = {}) {
|
|
3885
|
+
var semantic = getBusinessObject(element);
|
|
3886
|
+
|
|
3887
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
3888
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3889
|
+
|
|
3890
|
+
if (semantic.get('associationDirection') === 'One' ||
|
|
3891
|
+
semantic.get('associationDirection') === 'Both') {
|
|
3892
|
+
attrs.markerEnd = marker('association-end', fill, stroke);
|
|
3893
|
+
}
|
|
3894
|
+
|
|
3895
|
+
if (semantic.get('associationDirection') === 'Both') {
|
|
3896
|
+
attrs.markerStart = marker('association-start', fill, stroke);
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3899
|
+
attrs = pickAttrs(attrs, [
|
|
3900
|
+
'markerStart',
|
|
3901
|
+
'markerEnd'
|
|
3902
|
+
]);
|
|
3903
|
+
|
|
3904
|
+
return drawConnectionSegments(parentGfx, element.waypoints, {
|
|
3905
|
+
...attrs,
|
|
3906
|
+
stroke,
|
|
3907
|
+
strokeDasharray: '0, 5'
|
|
3908
|
+
});
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
function renderDataObject(parentGfx, element, attrs = {}) {
|
|
3912
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
3913
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3914
|
+
|
|
3915
|
+
var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
|
|
3916
|
+
xScaleFactor: 1,
|
|
3917
|
+
yScaleFactor: 1,
|
|
3918
|
+
containerWidth: element.width,
|
|
3919
|
+
containerHeight: element.height,
|
|
3920
|
+
position: {
|
|
3921
|
+
mx: 0.474,
|
|
3922
|
+
my: 0.296
|
|
3923
|
+
}
|
|
3924
|
+
});
|
|
3925
|
+
|
|
3926
|
+
var dataObject = drawPath(parentGfx, pathData, {
|
|
3927
|
+
fill,
|
|
3928
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3929
|
+
stroke
|
|
3930
|
+
});
|
|
3931
|
+
|
|
3932
|
+
var semantic = getBusinessObject(element);
|
|
3933
|
+
|
|
3934
|
+
if (isCollection(semantic)) {
|
|
3935
|
+
var collectionPathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
|
|
3712
3936
|
xScaleFactor: 1,
|
|
3713
3937
|
yScaleFactor: 1,
|
|
3714
|
-
containerWidth:
|
|
3715
|
-
containerHeight:
|
|
3938
|
+
containerWidth: element.width,
|
|
3939
|
+
containerHeight: element.height,
|
|
3716
3940
|
position: {
|
|
3717
|
-
mx: 0.
|
|
3718
|
-
my:
|
|
3941
|
+
mx: 0.33,
|
|
3942
|
+
my: (element.height - 18) / element.height
|
|
3719
3943
|
}
|
|
3720
3944
|
});
|
|
3721
3945
|
|
|
3722
|
-
|
|
3723
|
-
strokeWidth:
|
|
3724
|
-
fill
|
|
3725
|
-
stroke
|
|
3946
|
+
drawPath(parentGfx, collectionPathData, {
|
|
3947
|
+
strokeWidth: 2,
|
|
3948
|
+
fill,
|
|
3949
|
+
stroke
|
|
3726
3950
|
});
|
|
3951
|
+
}
|
|
3727
3952
|
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
'bpmn:ReceiveTask' : function(parentGfx, element) {
|
|
3731
|
-
var semantic = getBusinessObject(element);
|
|
3953
|
+
return dataObject;
|
|
3954
|
+
}
|
|
3732
3955
|
|
|
3733
|
-
|
|
3734
|
-
|
|
3956
|
+
function renderEvent(parentGfx, element, attrs = {}) {
|
|
3957
|
+
return drawCircle(parentGfx, element.width, element.height, {
|
|
3958
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3959
|
+
...attrs,
|
|
3960
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3961
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3962
|
+
});
|
|
3963
|
+
}
|
|
3735
3964
|
|
|
3736
|
-
|
|
3737
|
-
|
|
3965
|
+
function renderGateway(parentGfx, element, attrs = {}) {
|
|
3966
|
+
return drawDiamond(parentGfx, element.width, element.height, {
|
|
3967
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3968
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3969
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3970
|
+
});
|
|
3971
|
+
}
|
|
3738
3972
|
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3973
|
+
function renderLane(parentGfx, element, attrs = {}) {
|
|
3974
|
+
var lane = drawRect(parentGfx, getWidth(element, attrs), getHeight(element, attrs), 0, {
|
|
3975
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3976
|
+
fillOpacity: attrs.fillOpacity || DEFAULT_OPACITY,
|
|
3977
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3978
|
+
strokeWidth: 1.5
|
|
3979
|
+
});
|
|
3746
3980
|
|
|
3747
|
-
|
|
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
|
-
}
|
|
3981
|
+
var semantic = getBusinessObject(element);
|
|
3758
3982
|
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3983
|
+
if (is$1(semantic, 'bpmn:Lane')) {
|
|
3984
|
+
var text = semantic.get('name');
|
|
3985
|
+
|
|
3986
|
+
renderLaneLabel(parentGfx, text, element, attrs);
|
|
3987
|
+
}
|
|
3988
|
+
|
|
3989
|
+
return lane;
|
|
3990
|
+
}
|
|
3991
|
+
|
|
3992
|
+
function renderSubProcess(parentGfx, element, attrs = {}) {
|
|
3993
|
+
var activity = renderActivity(parentGfx, element, attrs);
|
|
3994
|
+
|
|
3995
|
+
if (isEventSubProcess(element)) {
|
|
3996
|
+
attr$1(activity, {
|
|
3997
|
+
strokeDasharray: '0, 5.5',
|
|
3998
|
+
strokeWidth: 2.5
|
|
3763
3999
|
});
|
|
4000
|
+
}
|
|
3764
4001
|
|
|
3765
|
-
|
|
4002
|
+
var expanded = isExpanded(element);
|
|
4003
|
+
|
|
4004
|
+
renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle', attrs);
|
|
4005
|
+
|
|
4006
|
+
if (expanded) {
|
|
4007
|
+
renderTaskMarkers(parentGfx, element, undefined, attrs);
|
|
4008
|
+
} else {
|
|
4009
|
+
renderTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ], attrs);
|
|
4010
|
+
}
|
|
4011
|
+
|
|
4012
|
+
return activity;
|
|
4013
|
+
}
|
|
4014
|
+
|
|
4015
|
+
function renderTask(parentGfx, element, attrs = {}) {
|
|
4016
|
+
var activity = renderActivity(parentGfx, element, attrs);
|
|
4017
|
+
|
|
4018
|
+
renderEmbeddedLabel(parentGfx, element, 'center-middle', attrs);
|
|
4019
|
+
|
|
4020
|
+
renderTaskMarkers(parentGfx, element, undefined, attrs);
|
|
4021
|
+
|
|
4022
|
+
return activity;
|
|
4023
|
+
}
|
|
4024
|
+
|
|
4025
|
+
var handlers = this.handlers = {
|
|
4026
|
+
'bpmn:AdHocSubProcess': function(parentGfx, element, attrs = {}) {
|
|
4027
|
+
if (isExpanded(element)) {
|
|
4028
|
+
attrs = pickAttrs(attrs, [
|
|
4029
|
+
'fill',
|
|
4030
|
+
'stroke',
|
|
4031
|
+
'width',
|
|
4032
|
+
'height'
|
|
4033
|
+
]);
|
|
4034
|
+
} else {
|
|
4035
|
+
attrs = pickAttrs(attrs, [
|
|
4036
|
+
'fill',
|
|
4037
|
+
'stroke'
|
|
4038
|
+
]);
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
return renderSubProcess(parentGfx, element, attrs);
|
|
3766
4042
|
},
|
|
3767
|
-
'bpmn:
|
|
3768
|
-
|
|
4043
|
+
'bpmn:Association': function(parentGfx, element, attrs = {}) {
|
|
4044
|
+
attrs = pickAttrs(attrs, [
|
|
4045
|
+
'fill',
|
|
4046
|
+
'stroke'
|
|
4047
|
+
]);
|
|
3769
4048
|
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
}
|
|
3775
|
-
});
|
|
4049
|
+
return renderAssociation(parentGfx, element, attrs);
|
|
4050
|
+
},
|
|
4051
|
+
'bpmn:BoundaryEvent': function(parentGfx, element, attrs = {}) {
|
|
4052
|
+
var { renderIcon = true } = attrs;
|
|
3776
4053
|
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
stroke
|
|
4054
|
+
attrs = pickAttrs(attrs, [
|
|
4055
|
+
'fill',
|
|
4056
|
+
'stroke'
|
|
4057
|
+
]);
|
|
4058
|
+
|
|
4059
|
+
var semantic = getBusinessObject(element),
|
|
4060
|
+
cancelActivity = semantic.get('cancelActivity');
|
|
4061
|
+
|
|
4062
|
+
attrs = {
|
|
4063
|
+
strokeWidth: 1.5,
|
|
4064
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4065
|
+
fillOpacity: FULL_OPACITY,
|
|
4066
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
4067
|
+
};
|
|
4068
|
+
|
|
4069
|
+
if (!cancelActivity) {
|
|
4070
|
+
attrs.strokeDasharray = '6';
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
var event = renderEvent(parentGfx, element, attrs);
|
|
4074
|
+
|
|
4075
|
+
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {
|
|
4076
|
+
...attrs,
|
|
4077
|
+
fill: 'none'
|
|
3780
4078
|
});
|
|
3781
4079
|
|
|
3782
|
-
|
|
4080
|
+
if (renderIcon) {
|
|
4081
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4082
|
+
}
|
|
4083
|
+
|
|
4084
|
+
return event;
|
|
3783
4085
|
},
|
|
3784
|
-
'bpmn:BusinessRuleTask': function(parentGfx, element) {
|
|
3785
|
-
|
|
4086
|
+
'bpmn:BusinessRuleTask': function(parentGfx, element, attrs = {}) {
|
|
4087
|
+
attrs = pickAttrs(attrs, [
|
|
4088
|
+
'fill',
|
|
4089
|
+
'stroke'
|
|
4090
|
+
]);
|
|
3786
4091
|
|
|
3787
|
-
var
|
|
4092
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4093
|
+
|
|
4094
|
+
var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
|
|
3788
4095
|
abspos: {
|
|
3789
4096
|
x: 8,
|
|
3790
4097
|
y: 8
|
|
3791
4098
|
}
|
|
3792
4099
|
});
|
|
3793
4100
|
|
|
3794
|
-
var
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
fill: getFillColor(element,
|
|
3798
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4101
|
+
var businessPath = drawPath(parentGfx, headerData);
|
|
4102
|
+
|
|
4103
|
+
attr$1(businessPath, {
|
|
4104
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4105
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4106
|
+
strokeWidth: 1
|
|
3799
4107
|
});
|
|
3800
4108
|
|
|
3801
|
-
var
|
|
4109
|
+
var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
|
|
3802
4110
|
abspos: {
|
|
3803
4111
|
x: 8,
|
|
3804
4112
|
y: 8
|
|
3805
4113
|
}
|
|
3806
4114
|
});
|
|
3807
4115
|
|
|
3808
|
-
var
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
4116
|
+
var businessHeaderPath = drawPath(parentGfx, headerPathData);
|
|
4117
|
+
|
|
4118
|
+
attr$1(businessHeaderPath, {
|
|
4119
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4120
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4121
|
+
strokeWidth: 1
|
|
3812
4122
|
});
|
|
3813
4123
|
|
|
3814
4124
|
return task;
|
|
3815
4125
|
},
|
|
3816
|
-
'bpmn:
|
|
3817
|
-
attrs =
|
|
3818
|
-
fill
|
|
3819
|
-
stroke
|
|
4126
|
+
'bpmn:CallActivity': function(parentGfx, element, attrs = {}) {
|
|
4127
|
+
attrs = pickAttrs(attrs, [
|
|
4128
|
+
'fill',
|
|
4129
|
+
'stroke'
|
|
4130
|
+
]);
|
|
4131
|
+
|
|
4132
|
+
return renderSubProcess(parentGfx, element, {
|
|
4133
|
+
strokeWidth: 5,
|
|
3820
4134
|
...attrs
|
|
3821
|
-
};
|
|
4135
|
+
});
|
|
4136
|
+
},
|
|
4137
|
+
'bpmn:ComplexGateway': function(parentGfx, element, attrs = {}) {
|
|
4138
|
+
attrs = pickAttrs(attrs, [
|
|
4139
|
+
'fill',
|
|
4140
|
+
'stroke'
|
|
4141
|
+
]);
|
|
3822
4142
|
|
|
3823
|
-
var
|
|
4143
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
3824
4144
|
|
|
3825
|
-
var
|
|
4145
|
+
var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
|
|
4146
|
+
xScaleFactor: 0.5,
|
|
4147
|
+
yScaleFactor:0.5,
|
|
4148
|
+
containerWidth: element.width,
|
|
4149
|
+
containerHeight: element.height,
|
|
4150
|
+
position: {
|
|
4151
|
+
mx: 0.46,
|
|
4152
|
+
my: 0.26
|
|
4153
|
+
}
|
|
4154
|
+
});
|
|
3826
4155
|
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
}
|
|
4156
|
+
drawPath(parentGfx, pathData, {
|
|
4157
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4158
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4159
|
+
strokeWidth: 1
|
|
4160
|
+
});
|
|
3833
4161
|
|
|
3834
|
-
|
|
4162
|
+
return gateway;
|
|
4163
|
+
},
|
|
4164
|
+
'bpmn:DataInput': function(parentGfx, element, attrs = {}) {
|
|
4165
|
+
attrs = pickAttrs(attrs, [
|
|
4166
|
+
'fill',
|
|
4167
|
+
'stroke'
|
|
4168
|
+
]);
|
|
3835
4169
|
|
|
3836
|
-
|
|
3837
|
-
attachTaskMarkers(parentGfx, element);
|
|
3838
|
-
} else {
|
|
3839
|
-
attachTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ]);
|
|
3840
|
-
}
|
|
4170
|
+
var arrowPathData = pathMap.getRawPath('DATA_ARROW');
|
|
3841
4171
|
|
|
3842
|
-
|
|
3843
|
-
},
|
|
3844
|
-
'bpmn:AdHocSubProcess': function(parentGfx, element) {
|
|
3845
|
-
return renderer('bpmn:SubProcess')(parentGfx, element);
|
|
3846
|
-
},
|
|
3847
|
-
'bpmn:Transaction': function(parentGfx, element) {
|
|
3848
|
-
var outer = renderer('bpmn:SubProcess')(parentGfx, element, { strokeWidth: 1.5 });
|
|
4172
|
+
var dataObject = renderDataObject(parentGfx, element, attrs);
|
|
3849
4173
|
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
4174
|
+
drawPath(parentGfx, arrowPathData, {
|
|
4175
|
+
fill: 'none',
|
|
4176
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4177
|
+
strokeWidth: 1
|
|
3853
4178
|
});
|
|
3854
4179
|
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
return outer;
|
|
4180
|
+
return dataObject;
|
|
3858
4181
|
},
|
|
3859
|
-
'bpmn:
|
|
3860
|
-
|
|
3861
|
-
|
|
4182
|
+
'bpmn:DataInputAssociation': function(parentGfx, element, attrs = {}) {
|
|
4183
|
+
attrs = pickAttrs(attrs, [
|
|
4184
|
+
'fill',
|
|
4185
|
+
'stroke'
|
|
4186
|
+
]);
|
|
4187
|
+
|
|
4188
|
+
return renderAssociation(parentGfx, element, {
|
|
4189
|
+
...attrs,
|
|
4190
|
+
markerEnd: marker('association-end', getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke))
|
|
3862
4191
|
});
|
|
3863
4192
|
},
|
|
3864
|
-
'bpmn:
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
3870
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3871
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3872
|
-
strokeWidth
|
|
3873
|
-
};
|
|
3874
|
-
|
|
3875
|
-
var lane = renderer('bpmn:Lane')(parentGfx, element, attrs);
|
|
3876
|
-
|
|
3877
|
-
var expandedPool = isExpanded(element);
|
|
3878
|
-
|
|
3879
|
-
if (expandedPool) {
|
|
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 {
|
|
3890
|
-
|
|
3891
|
-
// collapsed pool draw text inline
|
|
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
|
-
}
|
|
3900
|
-
|
|
3901
|
-
var participantMultiplicity = !!(getBusinessObject(element).participantMultiplicity);
|
|
3902
|
-
|
|
3903
|
-
if (participantMultiplicity) {
|
|
3904
|
-
renderer('ParticipantMultiplicityMarker')(parentGfx, element);
|
|
3905
|
-
}
|
|
4193
|
+
'bpmn:DataObject': function(parentGfx, element, attrs = {}) {
|
|
4194
|
+
attrs = pickAttrs(attrs, [
|
|
4195
|
+
'fill',
|
|
4196
|
+
'stroke'
|
|
4197
|
+
]);
|
|
3906
4198
|
|
|
3907
|
-
return
|
|
4199
|
+
return renderDataObject(parentGfx, element, attrs);
|
|
3908
4200
|
},
|
|
3909
|
-
'bpmn:
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
stroke
|
|
3914
|
-
|
|
3915
|
-
...attrs
|
|
3916
|
-
});
|
|
3917
|
-
|
|
3918
|
-
var semantic = getBusinessObject(element);
|
|
4201
|
+
'bpmn:DataObjectReference': as('bpmn:DataObject'),
|
|
4202
|
+
'bpmn:DataOutput': function(parentGfx, element, attrs = {}) {
|
|
4203
|
+
attrs = pickAttrs(attrs, [
|
|
4204
|
+
'fill',
|
|
4205
|
+
'stroke'
|
|
4206
|
+
]);
|
|
3919
4207
|
|
|
3920
|
-
|
|
3921
|
-
var text = semantic.name;
|
|
3922
|
-
renderLaneLabel(parentGfx, text, element);
|
|
3923
|
-
}
|
|
4208
|
+
var arrowPathData = pathMap.getRawPath('DATA_ARROW');
|
|
3924
4209
|
|
|
3925
|
-
|
|
3926
|
-
},
|
|
3927
|
-
'bpmn:InclusiveGateway': function(parentGfx, element) {
|
|
3928
|
-
var diamond = renderer('bpmn:Gateway')(parentGfx, element);
|
|
4210
|
+
var dataObject = renderDataObject(parentGfx, element, attrs);
|
|
3929
4211
|
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4212
|
+
drawPath(parentGfx, arrowPathData, {
|
|
4213
|
+
strokeWidth: 1,
|
|
4214
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4215
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3935
4216
|
});
|
|
3936
4217
|
|
|
3937
|
-
return
|
|
4218
|
+
return dataObject;
|
|
3938
4219
|
},
|
|
3939
|
-
'bpmn:
|
|
3940
|
-
|
|
4220
|
+
'bpmn:DataOutputAssociation': function(parentGfx, element, attrs = {}) {
|
|
4221
|
+
attrs = pickAttrs(attrs, [
|
|
4222
|
+
'fill',
|
|
4223
|
+
'stroke'
|
|
4224
|
+
]);
|
|
3941
4225
|
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
containerWidth: element.width,
|
|
3946
|
-
containerHeight: element.height,
|
|
3947
|
-
position: {
|
|
3948
|
-
mx: 0.32,
|
|
3949
|
-
my: 0.3
|
|
3950
|
-
}
|
|
4226
|
+
return renderAssociation(parentGfx, element, {
|
|
4227
|
+
...attrs,
|
|
4228
|
+
markerEnd: marker('association-end', getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke))
|
|
3951
4229
|
});
|
|
3952
|
-
|
|
3953
|
-
if ((getDi(element).isMarkerVisible)) {
|
|
3954
|
-
drawPath(parentGfx, pathData, {
|
|
3955
|
-
strokeWidth: 1,
|
|
3956
|
-
fill: getStrokeColor(element, defaultStrokeColor),
|
|
3957
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3958
|
-
});
|
|
3959
|
-
}
|
|
3960
|
-
|
|
3961
|
-
return diamond;
|
|
3962
4230
|
},
|
|
3963
|
-
'bpmn:
|
|
3964
|
-
|
|
4231
|
+
'bpmn:DataStoreReference': function(parentGfx, element, attrs = {}) {
|
|
4232
|
+
attrs = pickAttrs(attrs, [
|
|
4233
|
+
'fill',
|
|
4234
|
+
'stroke'
|
|
4235
|
+
]);
|
|
3965
4236
|
|
|
3966
|
-
var
|
|
3967
|
-
xScaleFactor:
|
|
3968
|
-
yScaleFactor:
|
|
4237
|
+
var dataStorePath = pathMap.getScaledPath('DATA_STORE', {
|
|
4238
|
+
xScaleFactor: 1,
|
|
4239
|
+
yScaleFactor: 1,
|
|
3969
4240
|
containerWidth: element.width,
|
|
3970
4241
|
containerHeight: element.height,
|
|
3971
4242
|
position: {
|
|
3972
|
-
mx: 0
|
|
3973
|
-
my: 0.
|
|
4243
|
+
mx: 0,
|
|
4244
|
+
my: 0.133
|
|
3974
4245
|
}
|
|
3975
4246
|
});
|
|
3976
4247
|
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4248
|
+
return drawPath(parentGfx, dataStorePath, {
|
|
4249
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4250
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
4251
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4252
|
+
strokeWidth: 2
|
|
3981
4253
|
});
|
|
3982
|
-
|
|
3983
|
-
return diamond;
|
|
3984
4254
|
},
|
|
3985
|
-
'bpmn:
|
|
3986
|
-
var
|
|
4255
|
+
'bpmn:EndEvent': function(parentGfx, element, attrs = {}) {
|
|
4256
|
+
var { renderIcon = true } = attrs;
|
|
3987
4257
|
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
containerHeight: element.height,
|
|
3993
|
-
position: {
|
|
3994
|
-
mx: 0.46,
|
|
3995
|
-
my: 0.2
|
|
3996
|
-
}
|
|
3997
|
-
});
|
|
4258
|
+
attrs = pickAttrs(attrs, [
|
|
4259
|
+
'fill',
|
|
4260
|
+
'stroke'
|
|
4261
|
+
]);
|
|
3998
4262
|
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4263
|
+
var event = renderEvent(parentGfx, element, {
|
|
4264
|
+
...attrs,
|
|
4265
|
+
strokeWidth: 4
|
|
4003
4266
|
});
|
|
4004
4267
|
|
|
4005
|
-
|
|
4268
|
+
if (renderIcon) {
|
|
4269
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4270
|
+
}
|
|
4271
|
+
|
|
4272
|
+
return event;
|
|
4006
4273
|
},
|
|
4007
|
-
'bpmn:EventBasedGateway': function(parentGfx, element) {
|
|
4274
|
+
'bpmn:EventBasedGateway': function(parentGfx, element, attrs = {}) {
|
|
4275
|
+
attrs = pickAttrs(attrs, [
|
|
4276
|
+
'fill',
|
|
4277
|
+
'stroke'
|
|
4278
|
+
]);
|
|
4008
4279
|
|
|
4009
4280
|
var semantic = getBusinessObject(element);
|
|
4010
4281
|
|
|
4011
|
-
var diamond =
|
|
4282
|
+
var diamond = renderGateway(parentGfx, element, attrs);
|
|
4012
4283
|
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4284
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.20, {
|
|
4285
|
+
fill: getFillColor(element, 'none', attrs.fill),
|
|
4286
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4287
|
+
strokeWidth: 1
|
|
4017
4288
|
});
|
|
4018
4289
|
|
|
4019
|
-
var type = semantic.eventGatewayType
|
|
4020
|
-
|
|
4290
|
+
var type = semantic.get('eventGatewayType'),
|
|
4291
|
+
instantiate = !!semantic.get('instantiate');
|
|
4021
4292
|
|
|
4022
4293
|
function drawEvent() {
|
|
4023
4294
|
|
|
@@ -4032,18 +4303,17 @@
|
|
|
4032
4303
|
}
|
|
4033
4304
|
});
|
|
4034
4305
|
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4306
|
+
drawPath(parentGfx, pathData, {
|
|
4307
|
+
fill: 'none',
|
|
4308
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4309
|
+
strokeWidth: 2
|
|
4039
4310
|
});
|
|
4040
4311
|
}
|
|
4041
4312
|
|
|
4042
4313
|
if (type === 'Parallel') {
|
|
4043
|
-
|
|
4044
4314
|
var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
|
|
4045
4315
|
xScaleFactor: 0.4,
|
|
4046
|
-
yScaleFactor:0.4,
|
|
4316
|
+
yScaleFactor: 0.4,
|
|
4047
4317
|
containerWidth: element.width,
|
|
4048
4318
|
containerHeight: element.height,
|
|
4049
4319
|
position: {
|
|
@@ -4053,16 +4323,16 @@
|
|
|
4053
4323
|
});
|
|
4054
4324
|
|
|
4055
4325
|
drawPath(parentGfx, pathData, {
|
|
4056
|
-
|
|
4057
|
-
|
|
4326
|
+
fill: 'none',
|
|
4327
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4328
|
+
strokeWidth: 1
|
|
4058
4329
|
});
|
|
4059
4330
|
} else if (type === 'Exclusive') {
|
|
4060
|
-
|
|
4061
4331
|
if (!instantiate) {
|
|
4062
4332
|
drawCircle(parentGfx, element.width, element.height, element.height * 0.26, {
|
|
4063
|
-
strokeWidth: 1,
|
|
4064
4333
|
fill: 'none',
|
|
4065
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4334
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4335
|
+
strokeWidth: 1
|
|
4066
4336
|
});
|
|
4067
4337
|
}
|
|
4068
4338
|
|
|
@@ -4072,104 +4342,163 @@
|
|
|
4072
4342
|
|
|
4073
4343
|
return diamond;
|
|
4074
4344
|
},
|
|
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);
|
|
4345
|
+
'bpmn:ExclusiveGateway': function(parentGfx, element, attrs = {}) {
|
|
4346
|
+
attrs = pickAttrs(attrs, [
|
|
4347
|
+
'fill',
|
|
4348
|
+
'stroke'
|
|
4349
|
+
]);
|
|
4085
4350
|
|
|
4086
|
-
var
|
|
4087
|
-
markerEnd: marker('sequenceflow-end', fill, stroke),
|
|
4088
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4089
|
-
});
|
|
4351
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
4090
4352
|
|
|
4091
|
-
var
|
|
4353
|
+
var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
|
|
4354
|
+
xScaleFactor: 0.4,
|
|
4355
|
+
yScaleFactor: 0.4,
|
|
4356
|
+
containerWidth: element.width,
|
|
4357
|
+
containerHeight: element.height,
|
|
4358
|
+
position: {
|
|
4359
|
+
mx: 0.32,
|
|
4360
|
+
my: 0.3
|
|
4361
|
+
}
|
|
4362
|
+
});
|
|
4092
4363
|
|
|
4093
|
-
var
|
|
4364
|
+
var di = getDi(element);
|
|
4094
4365
|
|
|
4095
|
-
if (
|
|
4096
|
-
|
|
4366
|
+
if (di.get('isMarkerVisible')) {
|
|
4367
|
+
drawPath(parentGfx, pathData, {
|
|
4368
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4369
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4370
|
+
strokeWidth: 1
|
|
4371
|
+
});
|
|
4372
|
+
}
|
|
4097
4373
|
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4374
|
+
return gateway;
|
|
4375
|
+
},
|
|
4376
|
+
'bpmn:Gateway': function(parentGfx, element, attrs = {}) {
|
|
4377
|
+
attrs = pickAttrs(attrs, [
|
|
4378
|
+
'fill',
|
|
4379
|
+
'stroke'
|
|
4380
|
+
]);
|
|
4104
4381
|
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4382
|
+
return renderGateway(parentGfx, element, attrs);
|
|
4383
|
+
},
|
|
4384
|
+
'bpmn:Group': function(parentGfx, element, attrs = {}) {
|
|
4385
|
+
attrs = pickAttrs(attrs, [
|
|
4386
|
+
'fill',
|
|
4387
|
+
'stroke',
|
|
4388
|
+
'width',
|
|
4389
|
+
'height'
|
|
4390
|
+
]);
|
|
4113
4391
|
|
|
4114
|
-
return
|
|
4392
|
+
return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
|
|
4393
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4394
|
+
strokeWidth: 1.5,
|
|
4395
|
+
strokeDasharray: '10, 6, 0, 6',
|
|
4396
|
+
fill: 'none',
|
|
4397
|
+
pointerEvents: 'none',
|
|
4398
|
+
width: getWidth(element, attrs),
|
|
4399
|
+
height: getHeight(element, attrs)
|
|
4400
|
+
});
|
|
4115
4401
|
},
|
|
4116
|
-
'bpmn:
|
|
4402
|
+
'bpmn:InclusiveGateway': function(parentGfx, element, attrs = {}) {
|
|
4403
|
+
attrs = pickAttrs(attrs, [
|
|
4404
|
+
'fill',
|
|
4405
|
+
'stroke'
|
|
4406
|
+
]);
|
|
4117
4407
|
|
|
4118
|
-
var
|
|
4408
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
4119
4409
|
|
|
4120
|
-
|
|
4121
|
-
|
|
4410
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.24, {
|
|
4411
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4412
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4413
|
+
strokeWidth: 2.5
|
|
4414
|
+
});
|
|
4122
4415
|
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
};
|
|
4416
|
+
return gateway;
|
|
4417
|
+
},
|
|
4418
|
+
'bpmn:IntermediateEvent': function(parentGfx, element, attrs = {}) {
|
|
4419
|
+
var { renderIcon = true } = attrs;
|
|
4128
4420
|
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4421
|
+
attrs = pickAttrs(attrs, [
|
|
4422
|
+
'fill',
|
|
4423
|
+
'stroke'
|
|
4424
|
+
]);
|
|
4425
|
+
|
|
4426
|
+
var outer = renderEvent(parentGfx, element, {
|
|
4427
|
+
...attrs,
|
|
4428
|
+
strokeWidth: 1.5
|
|
4429
|
+
});
|
|
4430
|
+
|
|
4431
|
+
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {
|
|
4432
|
+
fill: 'none',
|
|
4433
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4434
|
+
strokeWidth: 1.5
|
|
4435
|
+
});
|
|
4133
4436
|
|
|
4134
|
-
if (
|
|
4135
|
-
|
|
4437
|
+
if (renderIcon) {
|
|
4438
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4136
4439
|
}
|
|
4137
4440
|
|
|
4138
|
-
return
|
|
4441
|
+
return outer;
|
|
4139
4442
|
},
|
|
4140
|
-
'bpmn:
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4443
|
+
'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
|
|
4444
|
+
'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
|
|
4445
|
+
'bpmn:Lane': function(parentGfx, element, attrs = {}) {
|
|
4446
|
+
attrs = pickAttrs(attrs, [
|
|
4447
|
+
'fill',
|
|
4448
|
+
'stroke',
|
|
4449
|
+
'width',
|
|
4450
|
+
'height'
|
|
4451
|
+
]);
|
|
4452
|
+
|
|
4453
|
+
return renderLane(parentGfx, element, {
|
|
4454
|
+
...attrs,
|
|
4455
|
+
fillOpacity: LOW_OPACITY
|
|
4146
4456
|
});
|
|
4147
4457
|
},
|
|
4148
|
-
'bpmn:
|
|
4149
|
-
|
|
4150
|
-
|
|
4458
|
+
'bpmn:ManualTask': function(parentGfx, element, attrs = {}) {
|
|
4459
|
+
attrs = pickAttrs(attrs, [
|
|
4460
|
+
'fill',
|
|
4461
|
+
'stroke'
|
|
4462
|
+
]);
|
|
4463
|
+
|
|
4464
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4465
|
+
|
|
4466
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
|
|
4467
|
+
abspos: {
|
|
4468
|
+
x: 17,
|
|
4469
|
+
y: 15
|
|
4470
|
+
}
|
|
4471
|
+
});
|
|
4151
4472
|
|
|
4152
|
-
|
|
4153
|
-
|
|
4473
|
+
drawPath(parentGfx, pathData, {
|
|
4474
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4475
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4476
|
+
strokeWidth: 0.5
|
|
4154
4477
|
});
|
|
4478
|
+
|
|
4479
|
+
return task;
|
|
4155
4480
|
},
|
|
4156
|
-
'bpmn:MessageFlow': function(parentGfx, element) {
|
|
4481
|
+
'bpmn:MessageFlow': function(parentGfx, element, attrs = {}) {
|
|
4482
|
+
attrs = pickAttrs(attrs, [
|
|
4483
|
+
'fill',
|
|
4484
|
+
'stroke'
|
|
4485
|
+
]);
|
|
4157
4486
|
|
|
4158
4487
|
var semantic = getBusinessObject(element),
|
|
4159
4488
|
di = getDi(element);
|
|
4160
4489
|
|
|
4161
|
-
var fill = getFillColor(element, defaultFillColor),
|
|
4162
|
-
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
4490
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
4491
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
4163
4492
|
|
|
4164
4493
|
var path = drawConnectionSegments(parentGfx, element.waypoints, {
|
|
4165
4494
|
markerEnd: marker('messageflow-end', fill, stroke),
|
|
4166
4495
|
markerStart: marker('messageflow-start', fill, stroke),
|
|
4496
|
+
stroke,
|
|
4167
4497
|
strokeDasharray: '10, 11',
|
|
4168
|
-
strokeWidth: 1.5
|
|
4169
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4498
|
+
strokeWidth: 1.5
|
|
4170
4499
|
});
|
|
4171
4500
|
|
|
4172
|
-
if (semantic.messageRef) {
|
|
4501
|
+
if (semantic.get('messageRef')) {
|
|
4173
4502
|
var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
|
|
4174
4503
|
|
|
4175
4504
|
var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
|
|
@@ -4179,404 +4508,518 @@
|
|
|
4179
4508
|
}
|
|
4180
4509
|
});
|
|
4181
4510
|
|
|
4182
|
-
var messageAttrs = {
|
|
4511
|
+
var messageAttrs = {
|
|
4512
|
+
strokeWidth: 1
|
|
4513
|
+
};
|
|
4514
|
+
|
|
4515
|
+
if (di.get('messageVisibleKind') === 'initiating') {
|
|
4516
|
+
messageAttrs.fill = fill;
|
|
4517
|
+
messageAttrs.stroke = stroke;
|
|
4518
|
+
} else {
|
|
4519
|
+
messageAttrs.fill = stroke;
|
|
4520
|
+
messageAttrs.stroke = fill;
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4523
|
+
var message = drawPath(parentGfx, markerPathData, messageAttrs);
|
|
4524
|
+
|
|
4525
|
+
var messageRef = semantic.get('messageRef'),
|
|
4526
|
+
name = messageRef.get('name');
|
|
4527
|
+
|
|
4528
|
+
var label = renderLabel(parentGfx, name, {
|
|
4529
|
+
align: 'center-top',
|
|
4530
|
+
fitBox: true,
|
|
4531
|
+
style: {
|
|
4532
|
+
fill: stroke
|
|
4533
|
+
}
|
|
4534
|
+
});
|
|
4535
|
+
|
|
4536
|
+
var messageBounds = message.getBBox(),
|
|
4537
|
+
labelBounds = label.getBBox();
|
|
4538
|
+
|
|
4539
|
+
var translateX = midPoint.x - labelBounds.width / 2,
|
|
4540
|
+
translateY = midPoint.y + messageBounds.height / 2 + ELEMENT_LABEL_DISTANCE;
|
|
4541
|
+
|
|
4542
|
+
transform(label, translateX, translateY, 0);
|
|
4543
|
+
}
|
|
4544
|
+
|
|
4545
|
+
return path;
|
|
4546
|
+
},
|
|
4547
|
+
'bpmn:ParallelGateway': function(parentGfx, element, attrs = {}) {
|
|
4548
|
+
attrs = pickAttrs(attrs, [
|
|
4549
|
+
'fill',
|
|
4550
|
+
'stroke'
|
|
4551
|
+
]);
|
|
4552
|
+
|
|
4553
|
+
var diamond = renderGateway(parentGfx, element, attrs);
|
|
4554
|
+
|
|
4555
|
+
var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
|
|
4556
|
+
xScaleFactor: 0.6,
|
|
4557
|
+
yScaleFactor: 0.6,
|
|
4558
|
+
containerWidth: element.width,
|
|
4559
|
+
containerHeight: element.height,
|
|
4560
|
+
position: {
|
|
4561
|
+
mx: 0.46,
|
|
4562
|
+
my: 0.2
|
|
4563
|
+
}
|
|
4564
|
+
});
|
|
4565
|
+
|
|
4566
|
+
drawPath(parentGfx, pathData, {
|
|
4567
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4568
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4569
|
+
strokeWidth: 1
|
|
4570
|
+
});
|
|
4571
|
+
|
|
4572
|
+
return diamond;
|
|
4573
|
+
},
|
|
4574
|
+
'bpmn:Participant': function(parentGfx, element, attrs = {}) {
|
|
4575
|
+
attrs = pickAttrs(attrs, [
|
|
4576
|
+
'fill',
|
|
4577
|
+
'stroke',
|
|
4578
|
+
'width',
|
|
4579
|
+
'height'
|
|
4580
|
+
]);
|
|
4581
|
+
|
|
4582
|
+
var participant = renderLane(parentGfx, element, attrs);
|
|
4583
|
+
|
|
4584
|
+
var expandedParticipant = isExpanded(element);
|
|
4585
|
+
var horizontalParticipant = isHorizontal(element);
|
|
4586
|
+
|
|
4587
|
+
var semantic = getBusinessObject(element),
|
|
4588
|
+
name = semantic.get('name');
|
|
4589
|
+
|
|
4590
|
+
if (expandedParticipant) {
|
|
4591
|
+
var waypoints = horizontalParticipant ? [
|
|
4592
|
+
{
|
|
4593
|
+
x: 30,
|
|
4594
|
+
y: 0
|
|
4595
|
+
},
|
|
4596
|
+
{
|
|
4597
|
+
x: 30,
|
|
4598
|
+
y: getHeight(element, attrs)
|
|
4599
|
+
}
|
|
4600
|
+
] : [
|
|
4601
|
+
{
|
|
4602
|
+
x: 0,
|
|
4603
|
+
y: 30
|
|
4604
|
+
},
|
|
4605
|
+
{
|
|
4606
|
+
x: getWidth(element, attrs),
|
|
4607
|
+
y: 30
|
|
4608
|
+
}
|
|
4609
|
+
];
|
|
4610
|
+
|
|
4611
|
+
drawLine(parentGfx, waypoints, {
|
|
4612
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4613
|
+
strokeWidth: PARTICIPANT_STROKE_WIDTH
|
|
4614
|
+
});
|
|
4615
|
+
|
|
4616
|
+
renderLaneLabel(parentGfx, name, element, attrs);
|
|
4617
|
+
} else {
|
|
4618
|
+
var bounds = getBounds(element, attrs);
|
|
4183
4619
|
|
|
4184
|
-
if (
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
} else {
|
|
4188
|
-
messageAttrs.fill = '#888';
|
|
4189
|
-
messageAttrs.stroke = 'white';
|
|
4620
|
+
if (!horizontalParticipant) {
|
|
4621
|
+
bounds.height = getWidth(element, attrs);
|
|
4622
|
+
bounds.width = getHeight(element, attrs);
|
|
4190
4623
|
}
|
|
4191
4624
|
|
|
4192
|
-
var
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
var label = renderLabel(parentGfx, labelText, {
|
|
4196
|
-
align: 'center-top',
|
|
4197
|
-
fitBox: true,
|
|
4625
|
+
var textBox = renderLabel(parentGfx, name, {
|
|
4626
|
+
box: bounds,
|
|
4627
|
+
align: 'center-middle',
|
|
4198
4628
|
style: {
|
|
4199
|
-
fill:
|
|
4629
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
4200
4630
|
}
|
|
4201
4631
|
});
|
|
4202
4632
|
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
transform(label, translateX, translateY, 0);
|
|
4633
|
+
if (!horizontalParticipant) {
|
|
4634
|
+
var top = -1 * getHeight(element, attrs);
|
|
4635
|
+
transform(textBox, 0, -top, 270);
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4210
4638
|
|
|
4639
|
+
if (semantic.get('participantMultiplicity')) {
|
|
4640
|
+
renderTaskMarker('ParticipantMultiplicityMarker', parentGfx, element, attrs);
|
|
4211
4641
|
}
|
|
4212
4642
|
|
|
4213
|
-
return
|
|
4643
|
+
return participant;
|
|
4214
4644
|
},
|
|
4215
|
-
'bpmn:
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
containerHeight: element.height,
|
|
4221
|
-
position: {
|
|
4222
|
-
mx: 0.474,
|
|
4223
|
-
my: 0.296
|
|
4224
|
-
}
|
|
4225
|
-
});
|
|
4226
|
-
|
|
4227
|
-
var elementObject = drawPath(parentGfx, pathData, {
|
|
4228
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4229
|
-
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
4230
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4231
|
-
});
|
|
4645
|
+
'bpmn:ReceiveTask' : function(parentGfx, element, attrs = {}) {
|
|
4646
|
+
attrs = pickAttrs(attrs, [
|
|
4647
|
+
'fill',
|
|
4648
|
+
'stroke'
|
|
4649
|
+
]);
|
|
4232
4650
|
|
|
4233
4651
|
var semantic = getBusinessObject(element);
|
|
4234
4652
|
|
|
4235
|
-
|
|
4236
|
-
renderDataItemCollection(parentGfx, element);
|
|
4237
|
-
}
|
|
4653
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4238
4654
|
|
|
4239
|
-
|
|
4240
|
-
},
|
|
4241
|
-
'bpmn:DataObjectReference': as('bpmn:DataObject'),
|
|
4242
|
-
'bpmn:DataInput': function(parentGfx, element) {
|
|
4655
|
+
var pathData;
|
|
4243
4656
|
|
|
4244
|
-
|
|
4657
|
+
if (semantic.get('instantiate')) {
|
|
4658
|
+
drawCircle(parentGfx, 28, 28, 20 * 0.22, {
|
|
4659
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4660
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4661
|
+
strokeWidth: 1
|
|
4662
|
+
});
|
|
4245
4663
|
|
|
4246
|
-
|
|
4247
|
-
|
|
4664
|
+
pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
|
|
4665
|
+
abspos: {
|
|
4666
|
+
x: 7.77,
|
|
4667
|
+
y: 9.52
|
|
4668
|
+
}
|
|
4669
|
+
});
|
|
4670
|
+
} else {
|
|
4671
|
+
pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
4672
|
+
xScaleFactor: 0.9,
|
|
4673
|
+
yScaleFactor: 0.9,
|
|
4674
|
+
containerWidth: 21,
|
|
4675
|
+
containerHeight: 14,
|
|
4676
|
+
position: {
|
|
4677
|
+
mx: 0.3,
|
|
4678
|
+
my: 0.4
|
|
4679
|
+
}
|
|
4680
|
+
});
|
|
4681
|
+
}
|
|
4248
4682
|
|
|
4249
|
-
|
|
4683
|
+
drawPath(parentGfx, pathData, {
|
|
4684
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4685
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4686
|
+
strokeWidth: 1
|
|
4687
|
+
});
|
|
4250
4688
|
|
|
4251
|
-
return
|
|
4689
|
+
return task;
|
|
4252
4690
|
},
|
|
4253
|
-
'bpmn:
|
|
4254
|
-
|
|
4691
|
+
'bpmn:ScriptTask': function(parentGfx, element, attrs = {}) {
|
|
4692
|
+
attrs = pickAttrs(attrs, [
|
|
4693
|
+
'fill',
|
|
4694
|
+
'stroke'
|
|
4695
|
+
]);
|
|
4255
4696
|
|
|
4256
|
-
|
|
4257
|
-
var elementObject = renderer('bpmn:DataObject')(parentGfx, element);
|
|
4697
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4258
4698
|
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4699
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
|
|
4700
|
+
abspos: {
|
|
4701
|
+
x: 15,
|
|
4702
|
+
y: 20
|
|
4703
|
+
}
|
|
4262
4704
|
});
|
|
4263
4705
|
|
|
4264
|
-
|
|
4706
|
+
drawPath(parentGfx, pathData, {
|
|
4707
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4708
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4709
|
+
strokeWidth: 1
|
|
4710
|
+
});
|
|
4711
|
+
|
|
4712
|
+
return task;
|
|
4265
4713
|
},
|
|
4266
|
-
'bpmn:
|
|
4267
|
-
|
|
4714
|
+
'bpmn:SendTask': function(parentGfx, element, attrs = {}) {
|
|
4715
|
+
attrs = pickAttrs(attrs, [
|
|
4716
|
+
'fill',
|
|
4717
|
+
'stroke'
|
|
4718
|
+
]);
|
|
4719
|
+
|
|
4720
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4721
|
+
|
|
4722
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
4268
4723
|
xScaleFactor: 1,
|
|
4269
4724
|
yScaleFactor: 1,
|
|
4270
|
-
containerWidth:
|
|
4271
|
-
containerHeight:
|
|
4725
|
+
containerWidth: 21,
|
|
4726
|
+
containerHeight: 14,
|
|
4272
4727
|
position: {
|
|
4273
|
-
mx: 0,
|
|
4274
|
-
my: 0.
|
|
4728
|
+
mx: 0.285,
|
|
4729
|
+
my: 0.357
|
|
4275
4730
|
}
|
|
4276
4731
|
});
|
|
4277
4732
|
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4733
|
+
drawPath(parentGfx, pathData, {
|
|
4734
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4735
|
+
stroke: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4736
|
+
strokeWidth: 1
|
|
4283
4737
|
});
|
|
4284
4738
|
|
|
4285
|
-
return
|
|
4739
|
+
return task;
|
|
4286
4740
|
},
|
|
4287
|
-
'bpmn:
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4741
|
+
'bpmn:SequenceFlow': function(parentGfx, element, attrs = {}) {
|
|
4742
|
+
attrs = pickAttrs(attrs, [
|
|
4743
|
+
'fill',
|
|
4744
|
+
'stroke'
|
|
4745
|
+
]);
|
|
4291
4746
|
|
|
4292
|
-
var
|
|
4293
|
-
|
|
4294
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4295
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4296
|
-
};
|
|
4747
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
4748
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
4297
4749
|
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4750
|
+
var connection = drawConnectionSegments(parentGfx, element.waypoints, {
|
|
4751
|
+
markerEnd: marker('sequenceflow-end', fill, stroke),
|
|
4752
|
+
stroke
|
|
4753
|
+
});
|
|
4301
4754
|
|
|
4302
|
-
|
|
4303
|
-
var outerAttrs = {
|
|
4304
|
-
...attrs,
|
|
4305
|
-
fillOpacity: 1
|
|
4306
|
-
};
|
|
4755
|
+
var semantic = getBusinessObject(element);
|
|
4307
4756
|
|
|
4308
|
-
|
|
4309
|
-
var innerAttrs = {
|
|
4310
|
-
...attrs,
|
|
4311
|
-
fill: 'none'
|
|
4312
|
-
};
|
|
4757
|
+
var { source } = element;
|
|
4313
4758
|
|
|
4314
|
-
|
|
4759
|
+
if (source) {
|
|
4760
|
+
var sourceSemantic = getBusinessObject(source);
|
|
4315
4761
|
|
|
4316
|
-
|
|
4762
|
+
// conditional flow marker
|
|
4763
|
+
if (semantic.get('conditionExpression') && is$1(sourceSemantic, 'bpmn:Activity')) {
|
|
4764
|
+
attr$1(connection, {
|
|
4765
|
+
markerStart: marker('conditional-flow-marker', fill, stroke)
|
|
4766
|
+
});
|
|
4767
|
+
}
|
|
4317
4768
|
|
|
4318
|
-
|
|
4319
|
-
|
|
4769
|
+
// default marker
|
|
4770
|
+
if (sourceSemantic.get('default') && (is$1(sourceSemantic, 'bpmn:Gateway') || is$1(sourceSemantic, 'bpmn:Activity')) &&
|
|
4771
|
+
sourceSemantic.get('default') === semantic) {
|
|
4772
|
+
attr$1(connection, {
|
|
4773
|
+
markerStart: marker('conditional-default-flow-marker', fill, stroke)
|
|
4774
|
+
});
|
|
4775
|
+
}
|
|
4320
4776
|
}
|
|
4321
4777
|
|
|
4322
|
-
return
|
|
4323
|
-
},
|
|
4324
|
-
'bpmn:Group': function(parentGfx, element) {
|
|
4325
|
-
return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
|
|
4326
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
4327
|
-
strokeWidth: 1.5,
|
|
4328
|
-
strokeDasharray: '10,6,0,6',
|
|
4329
|
-
fill: 'none',
|
|
4330
|
-
pointerEvents: 'none'
|
|
4331
|
-
});
|
|
4778
|
+
return connection;
|
|
4332
4779
|
},
|
|
4333
|
-
'
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4780
|
+
'bpmn:ServiceTask': function(parentGfx, element, attrs = {}) {
|
|
4781
|
+
attrs = pickAttrs(attrs, [
|
|
4782
|
+
'fill',
|
|
4783
|
+
'stroke'
|
|
4784
|
+
]);
|
|
4785
|
+
|
|
4786
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4787
|
+
|
|
4788
|
+
drawCircle(parentGfx, 10, 10, {
|
|
4789
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4790
|
+
stroke: 'none',
|
|
4791
|
+
transform: 'translate(6, 6)'
|
|
4340
4792
|
});
|
|
4341
4793
|
|
|
4342
|
-
var
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
containerHeight: element.height,
|
|
4347
|
-
position: {
|
|
4348
|
-
mx: 0.0,
|
|
4349
|
-
my: 0.0
|
|
4794
|
+
var pathDataService1 = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
|
|
4795
|
+
abspos: {
|
|
4796
|
+
x: 12,
|
|
4797
|
+
y: 18
|
|
4350
4798
|
}
|
|
4351
4799
|
});
|
|
4352
4800
|
|
|
4353
|
-
drawPath(parentGfx,
|
|
4354
|
-
|
|
4801
|
+
drawPath(parentGfx, pathDataService1, {
|
|
4802
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4803
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4804
|
+
strokeWidth: 1
|
|
4355
4805
|
});
|
|
4356
4806
|
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
padding: 7,
|
|
4362
|
-
style: {
|
|
4363
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
4364
|
-
}
|
|
4807
|
+
drawCircle(parentGfx, 10, 10, {
|
|
4808
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4809
|
+
stroke: 'none',
|
|
4810
|
+
transform: 'translate(11, 10)'
|
|
4365
4811
|
});
|
|
4366
4812
|
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
xScaleFactor: 1,
|
|
4372
|
-
yScaleFactor: 1,
|
|
4373
|
-
containerWidth: element.width,
|
|
4374
|
-
containerHeight: element.height,
|
|
4375
|
-
position: {
|
|
4376
|
-
mx: ((element.width / 2) / element.width),
|
|
4377
|
-
my: (element.height - 15) / element.height
|
|
4813
|
+
var pathDataService2 = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
|
|
4814
|
+
abspos: {
|
|
4815
|
+
x: 17,
|
|
4816
|
+
y: 22
|
|
4378
4817
|
}
|
|
4379
4818
|
});
|
|
4380
4819
|
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4820
|
+
drawPath(parentGfx, pathDataService2, {
|
|
4821
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4822
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4823
|
+
strokeWidth: 1
|
|
4385
4824
|
});
|
|
4825
|
+
|
|
4826
|
+
return task;
|
|
4386
4827
|
},
|
|
4387
|
-
'
|
|
4388
|
-
var
|
|
4389
|
-
strokeWidth: 1,
|
|
4390
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4391
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4392
|
-
});
|
|
4828
|
+
'bpmn:StartEvent': function(parentGfx, element, attrs = {}) {
|
|
4829
|
+
var { renderIcon = true } = attrs;
|
|
4393
4830
|
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4831
|
+
attrs = pickAttrs(attrs, [
|
|
4832
|
+
'fill',
|
|
4833
|
+
'stroke'
|
|
4834
|
+
]);
|
|
4397
4835
|
|
|
4398
|
-
var
|
|
4399
|
-
xScaleFactor: 1.5,
|
|
4400
|
-
yScaleFactor: 1.5,
|
|
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
|
-
});
|
|
4836
|
+
var semantic = getBusinessObject(element);
|
|
4408
4837
|
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4838
|
+
if (!semantic.get('isInterrupting')) {
|
|
4839
|
+
attrs = {
|
|
4840
|
+
...attrs,
|
|
4841
|
+
strokeDasharray: '6'
|
|
4842
|
+
};
|
|
4843
|
+
}
|
|
4844
|
+
|
|
4845
|
+
var event = renderEvent(parentGfx, element, attrs);
|
|
4846
|
+
|
|
4847
|
+
if (renderIcon) {
|
|
4848
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
return event;
|
|
4413
4852
|
},
|
|
4414
|
-
'
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4853
|
+
'bpmn:SubProcess': function(parentGfx, element, attrs = {}) {
|
|
4854
|
+
if (isExpanded(element)) {
|
|
4855
|
+
attrs = pickAttrs(attrs, [
|
|
4856
|
+
'fill',
|
|
4857
|
+
'stroke',
|
|
4858
|
+
'width',
|
|
4859
|
+
'height'
|
|
4860
|
+
]);
|
|
4861
|
+
} else {
|
|
4862
|
+
attrs = pickAttrs(attrs, [
|
|
4863
|
+
'fill',
|
|
4864
|
+
'stroke'
|
|
4865
|
+
]);
|
|
4866
|
+
}
|
|
4425
4867
|
|
|
4426
|
-
|
|
4427
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4428
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4429
|
-
});
|
|
4868
|
+
return renderSubProcess(parentGfx, element, attrs);
|
|
4430
4869
|
},
|
|
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
|
-
});
|
|
4870
|
+
'bpmn:Task': function(parentGfx, element, attrs = {}) {
|
|
4871
|
+
attrs = pickAttrs(attrs, [
|
|
4872
|
+
'fill',
|
|
4873
|
+
'stroke'
|
|
4874
|
+
]);
|
|
4442
4875
|
|
|
4443
|
-
|
|
4444
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4445
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4446
|
-
});
|
|
4876
|
+
return renderTask(parentGfx, element, attrs);
|
|
4447
4877
|
},
|
|
4448
|
-
'
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4878
|
+
'bpmn:TextAnnotation': function(parentGfx, element, attrs = {}) {
|
|
4879
|
+
attrs = pickAttrs(attrs, [
|
|
4880
|
+
'fill',
|
|
4881
|
+
'stroke',
|
|
4882
|
+
'width',
|
|
4883
|
+
'height'
|
|
4884
|
+
]);
|
|
4885
|
+
|
|
4886
|
+
var {
|
|
4887
|
+
width,
|
|
4888
|
+
height
|
|
4889
|
+
} = getBounds(element, attrs);
|
|
4890
|
+
|
|
4891
|
+
var textElement = drawRect(parentGfx, width, height, 0, 0, {
|
|
4892
|
+
fill: 'none',
|
|
4893
|
+
stroke: 'none'
|
|
4458
4894
|
});
|
|
4459
4895
|
|
|
4460
|
-
|
|
4461
|
-
strokeWidth: 1,
|
|
4462
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4463
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4464
|
-
});
|
|
4465
|
-
},
|
|
4466
|
-
'LoopMarker': function(parentGfx, element, position) {
|
|
4467
|
-
var markerPath = pathMap.getScaledPath('MARKER_LOOP', {
|
|
4896
|
+
var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
|
|
4468
4897
|
xScaleFactor: 1,
|
|
4469
4898
|
yScaleFactor: 1,
|
|
4470
|
-
containerWidth:
|
|
4471
|
-
containerHeight:
|
|
4899
|
+
containerWidth: width,
|
|
4900
|
+
containerHeight: height,
|
|
4472
4901
|
position: {
|
|
4473
|
-
mx:
|
|
4474
|
-
my:
|
|
4902
|
+
mx: 0.0,
|
|
4903
|
+
my: 0.0
|
|
4475
4904
|
}
|
|
4476
4905
|
});
|
|
4477
4906
|
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4481
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
4482
|
-
strokeMiterlimit: 0.5
|
|
4483
|
-
});
|
|
4484
|
-
},
|
|
4485
|
-
'AdhocMarker': function(parentGfx, element, position) {
|
|
4486
|
-
var markerPath = pathMap.getScaledPath('MARKER_ADHOC', {
|
|
4487
|
-
xScaleFactor: 1,
|
|
4488
|
-
yScaleFactor: 1,
|
|
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
|
|
4494
|
-
}
|
|
4907
|
+
drawPath(parentGfx, textPathData, {
|
|
4908
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
4495
4909
|
});
|
|
4496
4910
|
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4911
|
+
var semantic = getBusinessObject(element),
|
|
4912
|
+
text = semantic.get('text') || '';
|
|
4913
|
+
|
|
4914
|
+
renderLabel(parentGfx, text, {
|
|
4915
|
+
align: 'left-top',
|
|
4916
|
+
box: getBounds(element, attrs),
|
|
4917
|
+
padding: 7,
|
|
4918
|
+
style: {
|
|
4919
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
4920
|
+
}
|
|
4501
4921
|
});
|
|
4502
|
-
}
|
|
4503
|
-
};
|
|
4504
4922
|
|
|
4505
|
-
|
|
4506
|
-
|
|
4923
|
+
return textElement;
|
|
4924
|
+
},
|
|
4925
|
+
'bpmn:Transaction': function(parentGfx, element, attrs = {}) {
|
|
4926
|
+
if (isExpanded(element)) {
|
|
4927
|
+
attrs = pickAttrs(attrs, [
|
|
4928
|
+
'fill',
|
|
4929
|
+
'stroke',
|
|
4930
|
+
'width',
|
|
4931
|
+
'height'
|
|
4932
|
+
]);
|
|
4933
|
+
} else {
|
|
4934
|
+
attrs = pickAttrs(attrs, [
|
|
4935
|
+
'fill',
|
|
4936
|
+
'stroke'
|
|
4937
|
+
]);
|
|
4938
|
+
}
|
|
4507
4939
|
|
|
4508
|
-
|
|
4509
|
-
|
|
4940
|
+
var outer = renderSubProcess(parentGfx, element, {
|
|
4941
|
+
strokeWidth: 1.5,
|
|
4942
|
+
...attrs
|
|
4943
|
+
});
|
|
4510
4944
|
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
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
|
-
}
|
|
4945
|
+
var innerAttrs = styles.style([ 'no-fill', 'no-events' ], {
|
|
4946
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4947
|
+
strokeWidth: 1.5
|
|
4948
|
+
});
|
|
4528
4949
|
|
|
4529
|
-
|
|
4530
|
-
renderer(marker)(parentGfx, element, position);
|
|
4531
|
-
});
|
|
4950
|
+
var expanded = isExpanded(element);
|
|
4532
4951
|
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4952
|
+
if (!expanded) {
|
|
4953
|
+
attrs = {};
|
|
4954
|
+
}
|
|
4536
4955
|
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4956
|
+
drawRect(
|
|
4957
|
+
parentGfx,
|
|
4958
|
+
getWidth(element, attrs),
|
|
4959
|
+
getHeight(element, attrs),
|
|
4960
|
+
TASK_BORDER_RADIUS - INNER_OUTER_DIST,
|
|
4961
|
+
INNER_OUTER_DIST,
|
|
4962
|
+
innerAttrs
|
|
4963
|
+
);
|
|
4540
4964
|
|
|
4541
|
-
|
|
4542
|
-
|
|
4965
|
+
return outer;
|
|
4966
|
+
},
|
|
4967
|
+
'bpmn:UserTask': function(parentGfx, element, attrs = {}) {
|
|
4968
|
+
attrs = pickAttrs(attrs, [
|
|
4969
|
+
'fill',
|
|
4970
|
+
'stroke'
|
|
4971
|
+
]);
|
|
4543
4972
|
|
|
4544
|
-
|
|
4973
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4545
4974
|
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
}
|
|
4975
|
+
var x = 15;
|
|
4976
|
+
var y = 12;
|
|
4549
4977
|
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4978
|
+
var pathDataUser1 = pathMap.getScaledPath('TASK_TYPE_USER_1', {
|
|
4979
|
+
abspos: {
|
|
4980
|
+
x: x,
|
|
4981
|
+
y: y
|
|
4982
|
+
}
|
|
4983
|
+
});
|
|
4553
4984
|
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4985
|
+
drawPath(parentGfx, pathDataUser1, {
|
|
4986
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4987
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4988
|
+
strokeWidth: 0.5
|
|
4989
|
+
});
|
|
4559
4990
|
|
|
4560
|
-
|
|
4991
|
+
var pathDataUser2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
|
|
4992
|
+
abspos: {
|
|
4993
|
+
x: x,
|
|
4994
|
+
y: y
|
|
4995
|
+
}
|
|
4996
|
+
});
|
|
4561
4997
|
|
|
4562
|
-
|
|
4998
|
+
drawPath(parentGfx, pathDataUser2, {
|
|
4999
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
5000
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
5001
|
+
strokeWidth: 0.5
|
|
5002
|
+
});
|
|
4563
5003
|
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
mx: 0.33,
|
|
4571
|
-
my: yPosition
|
|
4572
|
-
}
|
|
4573
|
-
});
|
|
5004
|
+
var pathDataUser3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
|
|
5005
|
+
abspos: {
|
|
5006
|
+
x: x,
|
|
5007
|
+
y: y
|
|
5008
|
+
}
|
|
5009
|
+
});
|
|
4574
5010
|
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
5011
|
+
drawPath(parentGfx, pathDataUser3, {
|
|
5012
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
5013
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
5014
|
+
strokeWidth: 0.5
|
|
5015
|
+
});
|
|
4579
5016
|
|
|
5017
|
+
return task;
|
|
5018
|
+
},
|
|
5019
|
+
'label': function(parentGfx, element, attrs = {}) {
|
|
5020
|
+
return renderExternalLabel(parentGfx, element, attrs);
|
|
5021
|
+
}
|
|
5022
|
+
};
|
|
4580
5023
|
|
|
4581
5024
|
// extension API, use at your own risk
|
|
4582
5025
|
this._drawPath = drawPath;
|
|
@@ -4611,15 +5054,16 @@
|
|
|
4611
5054
|
*
|
|
4612
5055
|
* @param {SVGElement} parentGfx
|
|
4613
5056
|
* @param {Element} element
|
|
5057
|
+
* @param {Attrs} [attrs]
|
|
4614
5058
|
*
|
|
4615
5059
|
* @return {SVGElement} mainGfx
|
|
4616
5060
|
*/
|
|
4617
|
-
BpmnRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
4618
|
-
var type = element
|
|
4619
|
-
var h = this._renderer(type);
|
|
5061
|
+
BpmnRenderer.prototype.drawShape = function(parentGfx, element, attrs = {}) {
|
|
5062
|
+
var { type } = element;
|
|
4620
5063
|
|
|
4621
|
-
|
|
4622
|
-
|
|
5064
|
+
var handler = this._renderer(type);
|
|
5065
|
+
|
|
5066
|
+
return handler(parentGfx, element, attrs);
|
|
4623
5067
|
};
|
|
4624
5068
|
|
|
4625
5069
|
/**
|
|
@@ -4627,15 +5071,16 @@
|
|
|
4627
5071
|
*
|
|
4628
5072
|
* @param {SVGElement} parentGfx
|
|
4629
5073
|
* @param {Element} element
|
|
5074
|
+
* @param {Attrs} [attrs]
|
|
4630
5075
|
*
|
|
4631
5076
|
* @return {SVGElement} mainGfx
|
|
4632
5077
|
*/
|
|
4633
|
-
BpmnRenderer.prototype.drawConnection = function(parentGfx, element) {
|
|
4634
|
-
var type = element
|
|
4635
|
-
|
|
5078
|
+
BpmnRenderer.prototype.drawConnection = function(parentGfx, element, attrs = {}) {
|
|
5079
|
+
var { type } = element;
|
|
5080
|
+
|
|
5081
|
+
var handler = this._renderer(type);
|
|
4636
5082
|
|
|
4637
|
-
|
|
4638
|
-
return h(parentGfx, element);
|
|
5083
|
+
return handler(parentGfx, element, attrs);
|
|
4639
5084
|
};
|
|
4640
5085
|
|
|
4641
5086
|
/**
|
|
@@ -4646,7 +5091,6 @@
|
|
|
4646
5091
|
* @return {string} path
|
|
4647
5092
|
*/
|
|
4648
5093
|
BpmnRenderer.prototype.getShapePath = function(element) {
|
|
4649
|
-
|
|
4650
5094
|
if (is$1(element, 'bpmn:Event')) {
|
|
4651
5095
|
return getCirclePath(element);
|
|
4652
5096
|
}
|
|
@@ -4662,6 +5106,24 @@
|
|
|
4662
5106
|
return getRectPath(element);
|
|
4663
5107
|
};
|
|
4664
5108
|
|
|
5109
|
+
/**
|
|
5110
|
+
* Pick attributes if they exist.
|
|
5111
|
+
*
|
|
5112
|
+
* @param {Object} attrs
|
|
5113
|
+
* @param {string[]} keys
|
|
5114
|
+
*
|
|
5115
|
+
* @returns {Object}
|
|
5116
|
+
*/
|
|
5117
|
+
function pickAttrs(attrs, keys = []) {
|
|
5118
|
+
return keys.reduce((pickedAttrs, key) => {
|
|
5119
|
+
if (attrs[ key ]) {
|
|
5120
|
+
pickedAttrs[ key ] = attrs[ key ];
|
|
5121
|
+
}
|
|
5122
|
+
|
|
5123
|
+
return pickedAttrs;
|
|
5124
|
+
}, {});
|
|
5125
|
+
}
|
|
5126
|
+
|
|
4665
5127
|
/**
|
|
4666
5128
|
* @typedef {import('../util/Types').Dimensions} Dimensions
|
|
4667
5129
|
*
|
|
@@ -5758,10 +6220,6 @@
|
|
|
5758
6220
|
translate: [ 'value', translate ]
|
|
5759
6221
|
};
|
|
5760
6222
|
|
|
5761
|
-
function getDefaultExportFromCjs (x) {
|
|
5762
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5763
|
-
}
|
|
5764
|
-
|
|
5765
6223
|
/**
|
|
5766
6224
|
* @param {Point} point
|
|
5767
6225
|
*
|
|
@@ -6293,10 +6751,6 @@
|
|
|
6293
6751
|
return event.originalEvent || event.srcEvent;
|
|
6294
6752
|
}
|
|
6295
6753
|
|
|
6296
|
-
function isMac() {
|
|
6297
|
-
return (/mac/i).test(navigator.platform);
|
|
6298
|
-
}
|
|
6299
|
-
|
|
6300
6754
|
/**
|
|
6301
6755
|
* @param {MouseEvent} event
|
|
6302
6756
|
* @param {string} button
|
|
@@ -6329,26 +6783,6 @@
|
|
|
6329
6783
|
return isButton(event, 1);
|
|
6330
6784
|
}
|
|
6331
6785
|
|
|
6332
|
-
/**
|
|
6333
|
-
* @param {MouseEvent} event
|
|
6334
|
-
*
|
|
6335
|
-
* @return {boolean}
|
|
6336
|
-
*/
|
|
6337
|
-
function hasPrimaryModifier(event) {
|
|
6338
|
-
var originalEvent = getOriginal(event) || event;
|
|
6339
|
-
|
|
6340
|
-
if (!isPrimaryButton(event)) {
|
|
6341
|
-
return false;
|
|
6342
|
-
}
|
|
6343
|
-
|
|
6344
|
-
// Use cmd as primary modifier key for mac OS
|
|
6345
|
-
if (isMac()) {
|
|
6346
|
-
return originalEvent.metaKey;
|
|
6347
|
-
} else {
|
|
6348
|
-
return originalEvent.ctrlKey;
|
|
6349
|
-
}
|
|
6350
|
-
}
|
|
6351
|
-
|
|
6352
6786
|
/**
|
|
6353
6787
|
* @param {MouseEvent} event
|
|
6354
6788
|
*
|
|
@@ -6949,6 +7383,8 @@
|
|
|
6949
7383
|
|
|
6950
7384
|
var LOW_PRIORITY$2 = 500;
|
|
6951
7385
|
|
|
7386
|
+
var DEFAULT_PRIORITY$2 = 1000;
|
|
7387
|
+
|
|
6952
7388
|
/**
|
|
6953
7389
|
* @typedef {import('../../model/Types').Element} Element
|
|
6954
7390
|
*
|
|
@@ -6967,25 +7403,30 @@
|
|
|
6967
7403
|
*/
|
|
6968
7404
|
function Outline(eventBus, styles) {
|
|
6969
7405
|
|
|
6970
|
-
this.
|
|
7406
|
+
this._eventBus = eventBus;
|
|
7407
|
+
|
|
7408
|
+
this.offset = 5;
|
|
6971
7409
|
|
|
6972
7410
|
var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);
|
|
6973
7411
|
|
|
6974
7412
|
var self = this;
|
|
6975
7413
|
|
|
6976
|
-
|
|
7414
|
+
/**
|
|
7415
|
+
* @param {SVGElement} gfx
|
|
7416
|
+
*
|
|
7417
|
+
* @return {SVGElement} outline
|
|
7418
|
+
*/
|
|
7419
|
+
function createOutline(gfx) {
|
|
6977
7420
|
var outline = create$1('rect');
|
|
6978
7421
|
|
|
6979
7422
|
attr$1(outline, assign$1({
|
|
6980
|
-
x:
|
|
6981
|
-
y:
|
|
7423
|
+
x: 0,
|
|
7424
|
+
y: 0,
|
|
6982
7425
|
rx: 4,
|
|
6983
7426
|
width: 100,
|
|
6984
7427
|
height: 100
|
|
6985
7428
|
}, OUTLINE_STYLE));
|
|
6986
7429
|
|
|
6987
|
-
append(gfx, outline);
|
|
6988
|
-
|
|
6989
7430
|
return outline;
|
|
6990
7431
|
}
|
|
6991
7432
|
|
|
@@ -6998,7 +7439,8 @@
|
|
|
6998
7439
|
var outline = query('.djs-outline', gfx);
|
|
6999
7440
|
|
|
7000
7441
|
if (!outline) {
|
|
7001
|
-
outline = createOutline(
|
|
7442
|
+
outline = self.getOutline(element) || createOutline();
|
|
7443
|
+
append(gfx, outline);
|
|
7002
7444
|
}
|
|
7003
7445
|
|
|
7004
7446
|
self.updateShapeOutline(outline, element);
|
|
@@ -7011,7 +7453,8 @@
|
|
|
7011
7453
|
var outline = query('.djs-outline', gfx);
|
|
7012
7454
|
|
|
7013
7455
|
if (!outline) {
|
|
7014
|
-
outline = createOutline(
|
|
7456
|
+
outline = createOutline();
|
|
7457
|
+
append(gfx, outline);
|
|
7015
7458
|
}
|
|
7016
7459
|
|
|
7017
7460
|
self.updateConnectionOutline(outline, element);
|
|
@@ -7028,25 +7471,34 @@
|
|
|
7028
7471
|
*/
|
|
7029
7472
|
Outline.prototype.updateShapeOutline = function(outline, element) {
|
|
7030
7473
|
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
y: -this.offset,
|
|
7034
|
-
width: element.width + this.offset * 2,
|
|
7035
|
-
height: element.height + this.offset * 2
|
|
7036
|
-
});
|
|
7474
|
+
var updated = false;
|
|
7475
|
+
var providers = this._getProviders();
|
|
7037
7476
|
|
|
7038
|
-
|
|
7477
|
+
if (providers.length) {
|
|
7478
|
+
forEach$1(providers, function(provider) {
|
|
7479
|
+
updated = updated || provider.updateOutline(element, outline);
|
|
7480
|
+
});
|
|
7481
|
+
}
|
|
7039
7482
|
|
|
7483
|
+
if (!updated) {
|
|
7484
|
+
attr$1(outline, {
|
|
7485
|
+
x: -this.offset,
|
|
7486
|
+
y: -this.offset,
|
|
7487
|
+
width: element.width + this.offset * 2,
|
|
7488
|
+
height: element.height + this.offset * 2
|
|
7489
|
+
});
|
|
7490
|
+
}
|
|
7491
|
+
};
|
|
7040
7492
|
|
|
7041
7493
|
/**
|
|
7042
7494
|
* Updates the outline of a connection respecting the bounding box of
|
|
7043
7495
|
* the connection and an outline offset.
|
|
7496
|
+
* Register an outline provider with the given priority.
|
|
7044
7497
|
*
|
|
7045
7498
|
* @param {SVGElement} outline
|
|
7046
7499
|
* @param {Element} connection
|
|
7047
7500
|
*/
|
|
7048
7501
|
Outline.prototype.updateConnectionOutline = function(outline, connection) {
|
|
7049
|
-
|
|
7050
7502
|
var bbox = getBBox(connection);
|
|
7051
7503
|
|
|
7052
7504
|
attr$1(outline, {
|
|
@@ -7055,9 +7507,61 @@
|
|
|
7055
7507
|
width: bbox.width + this.offset * 2,
|
|
7056
7508
|
height: bbox.height + this.offset * 2
|
|
7057
7509
|
});
|
|
7510
|
+
};
|
|
7511
|
+
|
|
7512
|
+
/**
|
|
7513
|
+
* Register an outline provider with the given priority.
|
|
7514
|
+
*
|
|
7515
|
+
* @param {number} priority
|
|
7516
|
+
* @param {OutlineProvider} provider
|
|
7517
|
+
*/
|
|
7518
|
+
Outline.prototype.registerProvider = function(priority, provider) {
|
|
7519
|
+
if (!provider) {
|
|
7520
|
+
provider = priority;
|
|
7521
|
+
priority = DEFAULT_PRIORITY$2;
|
|
7522
|
+
}
|
|
7523
|
+
|
|
7524
|
+
this._eventBus.on('outline.getProviders', priority, function(event) {
|
|
7525
|
+
event.providers.push(provider);
|
|
7526
|
+
});
|
|
7527
|
+
};
|
|
7528
|
+
|
|
7529
|
+
/**
|
|
7530
|
+
* Returns the registered outline providers.
|
|
7531
|
+
*
|
|
7532
|
+
* @returns {OutlineProvider[]}
|
|
7533
|
+
*/
|
|
7534
|
+
Outline.prototype._getProviders = function() {
|
|
7535
|
+
var event = this._eventBus.createEvent({
|
|
7536
|
+
type: 'outline.getProviders',
|
|
7537
|
+
providers: []
|
|
7538
|
+
});
|
|
7539
|
+
|
|
7540
|
+
this._eventBus.fire(event);
|
|
7058
7541
|
|
|
7542
|
+
return event.providers;
|
|
7059
7543
|
};
|
|
7060
7544
|
|
|
7545
|
+
/**
|
|
7546
|
+
* Returns the outline for an element.
|
|
7547
|
+
*
|
|
7548
|
+
* @param {Element} element
|
|
7549
|
+
**/
|
|
7550
|
+
Outline.prototype.getOutline = function(element) {
|
|
7551
|
+
var outline;
|
|
7552
|
+
var providers = this._getProviders();
|
|
7553
|
+
|
|
7554
|
+
forEach$1(providers, function(provider) {
|
|
7555
|
+
|
|
7556
|
+
if (!isFunction(provider.getOutline)) {
|
|
7557
|
+
return;
|
|
7558
|
+
}
|
|
7559
|
+
|
|
7560
|
+
outline = outline || provider.getOutline(element);
|
|
7561
|
+
});
|
|
7562
|
+
|
|
7563
|
+
return outline;
|
|
7564
|
+
};
|
|
7061
7565
|
|
|
7062
7566
|
Outline.$inject = [ 'eventBus', 'styles', 'elementRegistry' ];
|
|
7063
7567
|
|
|
@@ -7399,8 +7903,8 @@
|
|
|
7399
7903
|
var isSelected = selection.isSelected(element),
|
|
7400
7904
|
isMultiSelect = selection.get().length > 1;
|
|
7401
7905
|
|
|
7402
|
-
// Add to selection if
|
|
7403
|
-
var add =
|
|
7906
|
+
// Add to selection if SHIFT pressed
|
|
7907
|
+
var add = hasSecondaryModifier(event);
|
|
7404
7908
|
|
|
7405
7909
|
if (isSelected && isMultiSelect) {
|
|
7406
7910
|
if (add) {
|
|
@@ -9376,7 +9880,7 @@
|
|
|
9376
9880
|
}
|
|
9377
9881
|
|
|
9378
9882
|
/**
|
|
9379
|
-
* @typedef {import('./index').InjectAnnotated } InjectAnnotated
|
|
9883
|
+
* @typedef {import('./index.js').InjectAnnotated } InjectAnnotated
|
|
9380
9884
|
*/
|
|
9381
9885
|
|
|
9382
9886
|
/**
|
|
@@ -9446,9 +9950,9 @@
|
|
|
9446
9950
|
}
|
|
9447
9951
|
|
|
9448
9952
|
/**
|
|
9449
|
-
* @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
|
|
9450
|
-
* @typedef { import('./index').ModuleDefinition } ModuleDefinition
|
|
9451
|
-
* @typedef { import('./index').InjectorContext } InjectorContext
|
|
9953
|
+
* @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration
|
|
9954
|
+
* @typedef { import('./index.js').ModuleDefinition } ModuleDefinition
|
|
9955
|
+
* @typedef { import('./index.js').InjectorContext } InjectorContext
|
|
9452
9956
|
*/
|
|
9453
9957
|
|
|
9454
9958
|
/**
|
|
@@ -9551,11 +10055,20 @@
|
|
|
9551
10055
|
};
|
|
9552
10056
|
}
|
|
9553
10057
|
|
|
9554
|
-
|
|
10058
|
+
/**
|
|
10059
|
+
* Instantiate the given type, injecting dependencies.
|
|
10060
|
+
*
|
|
10061
|
+
* @template T
|
|
10062
|
+
*
|
|
10063
|
+
* @param { Function | [...string[], Function ]} type
|
|
10064
|
+
*
|
|
10065
|
+
* @return T
|
|
10066
|
+
*/
|
|
10067
|
+
function instantiate(type) {
|
|
9555
10068
|
const {
|
|
9556
10069
|
fn,
|
|
9557
10070
|
dependencies
|
|
9558
|
-
} = fnDef(
|
|
10071
|
+
} = fnDef(type);
|
|
9559
10072
|
|
|
9560
10073
|
// instantiate var args constructor
|
|
9561
10074
|
const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
|
|
@@ -9563,6 +10076,17 @@
|
|
|
9563
10076
|
return new Constructor();
|
|
9564
10077
|
}
|
|
9565
10078
|
|
|
10079
|
+
/**
|
|
10080
|
+
* Invoke the given function, injecting dependencies. Return the result.
|
|
10081
|
+
*
|
|
10082
|
+
* @template T
|
|
10083
|
+
*
|
|
10084
|
+
* @param { Function | [...string[], Function ]} func
|
|
10085
|
+
* @param { Object } [context]
|
|
10086
|
+
* @param { Object } [locals]
|
|
10087
|
+
*
|
|
10088
|
+
* @return {T} invocation result
|
|
10089
|
+
*/
|
|
9566
10090
|
function invoke(func, context, locals) {
|
|
9567
10091
|
const {
|
|
9568
10092
|
fn,
|
|
@@ -11831,32 +12355,17 @@
|
|
|
11831
12355
|
}
|
|
11832
12356
|
};
|
|
11833
12357
|
|
|
11834
|
-
var objectRefs = {exports: {}};
|
|
11835
|
-
|
|
11836
|
-
var collection = {};
|
|
11837
|
-
|
|
11838
|
-
/**
|
|
11839
|
-
* An empty collection stub. Use {@link RefsCollection.extend} to extend a
|
|
11840
|
-
* collection with ref semantics.
|
|
11841
|
-
*
|
|
11842
|
-
* @class RefsCollection
|
|
11843
|
-
*/
|
|
11844
|
-
|
|
11845
12358
|
/**
|
|
11846
12359
|
* Extends a collection with {@link Refs} aware methods
|
|
11847
12360
|
*
|
|
11848
|
-
* @
|
|
11849
|
-
* @
|
|
11850
|
-
*
|
|
11851
|
-
* @param
|
|
11852
|
-
* @param {Refs} refs instance
|
|
11853
|
-
* @param {Object} property represented by the collection
|
|
11854
|
-
* @param {Object} target object the collection is attached to
|
|
12361
|
+
* @param {Array<Object>} collection
|
|
12362
|
+
* @param {Refs} refs instance
|
|
12363
|
+
* @param {Object} property represented by the collection
|
|
12364
|
+
* @param {Object} target object the collection is attached to
|
|
11855
12365
|
*
|
|
11856
12366
|
* @return {RefsCollection<Object>} the extended array
|
|
11857
12367
|
*/
|
|
11858
12368
|
function extend(collection, refs, property, target) {
|
|
11859
|
-
|
|
11860
12369
|
var inverseProperty = property.inverse;
|
|
11861
12370
|
|
|
11862
12371
|
/**
|
|
@@ -11867,7 +12376,7 @@
|
|
|
11867
12376
|
* @param {Object} element the element to remove
|
|
11868
12377
|
*/
|
|
11869
12378
|
Object.defineProperty(collection, 'remove', {
|
|
11870
|
-
value: function(element) {
|
|
12379
|
+
value: function (element) {
|
|
11871
12380
|
var idx = this.indexOf(element);
|
|
11872
12381
|
if (idx !== -1) {
|
|
11873
12382
|
this.splice(idx, 1);
|
|
@@ -11875,7 +12384,6 @@
|
|
|
11875
12384
|
// unset inverse
|
|
11876
12385
|
refs.unset(element, inverseProperty, target);
|
|
11877
12386
|
}
|
|
11878
|
-
|
|
11879
12387
|
return element;
|
|
11880
12388
|
}
|
|
11881
12389
|
});
|
|
@@ -11888,7 +12396,7 @@
|
|
|
11888
12396
|
* @param {Object} element the element to check for
|
|
11889
12397
|
*/
|
|
11890
12398
|
Object.defineProperty(collection, 'contains', {
|
|
11891
|
-
value: function(element) {
|
|
12399
|
+
value: function (element) {
|
|
11892
12400
|
return this.indexOf(element) !== -1;
|
|
11893
12401
|
}
|
|
11894
12402
|
});
|
|
@@ -11903,12 +12411,9 @@
|
|
|
11903
12411
|
* (possibly moving other elements around)
|
|
11904
12412
|
*/
|
|
11905
12413
|
Object.defineProperty(collection, 'add', {
|
|
11906
|
-
value: function(element, idx) {
|
|
11907
|
-
|
|
12414
|
+
value: function (element, idx) {
|
|
11908
12415
|
var currentIdx = this.indexOf(element);
|
|
11909
|
-
|
|
11910
12416
|
if (typeof idx === 'undefined') {
|
|
11911
|
-
|
|
11912
12417
|
if (currentIdx !== -1) {
|
|
11913
12418
|
// element already in collection (!)
|
|
11914
12419
|
return;
|
|
@@ -11920,14 +12425,12 @@
|
|
|
11920
12425
|
|
|
11921
12426
|
// handle already in collection
|
|
11922
12427
|
if (currentIdx !== -1) {
|
|
11923
|
-
|
|
11924
12428
|
// remove element from currentIdx
|
|
11925
12429
|
this.splice(currentIdx, 1);
|
|
11926
12430
|
}
|
|
11927
12431
|
|
|
11928
12432
|
// add element at idx
|
|
11929
12433
|
this.splice(idx, 0, element);
|
|
11930
|
-
|
|
11931
12434
|
if (currentIdx === -1) {
|
|
11932
12435
|
// set inverse, unless element was
|
|
11933
12436
|
// in collection already
|
|
@@ -11941,69 +12444,53 @@
|
|
|
11941
12444
|
Object.defineProperty(collection, '__refs_collection', {
|
|
11942
12445
|
value: true
|
|
11943
12446
|
});
|
|
11944
|
-
|
|
11945
12447
|
return collection;
|
|
11946
12448
|
}
|
|
11947
12449
|
|
|
11948
|
-
|
|
12450
|
+
/**
|
|
12451
|
+
* Checks if a given collection is extended
|
|
12452
|
+
*
|
|
12453
|
+
* @param {Array<Object>} collection
|
|
12454
|
+
*
|
|
12455
|
+
* @return {boolean}
|
|
12456
|
+
*/
|
|
11949
12457
|
function isExtended(collection) {
|
|
11950
12458
|
return collection.__refs_collection === true;
|
|
11951
12459
|
}
|
|
11952
12460
|
|
|
11953
|
-
collection.extend = extend;
|
|
11954
|
-
|
|
11955
|
-
collection.isExtended = isExtended;
|
|
11956
|
-
|
|
11957
|
-
var Collection = collection;
|
|
11958
|
-
|
|
11959
12461
|
function hasOwnProperty$1(e, property) {
|
|
11960
12462
|
return Object.prototype.hasOwnProperty.call(e, property.name || property);
|
|
11961
12463
|
}
|
|
11962
|
-
|
|
11963
12464
|
function defineCollectionProperty(ref, property, target) {
|
|
11964
|
-
|
|
11965
|
-
var collection = Collection.extend(target[property.name] || [], ref, property, target);
|
|
11966
|
-
|
|
12465
|
+
var collection = extend(target[property.name] || [], ref, property, target);
|
|
11967
12466
|
Object.defineProperty(target, property.name, {
|
|
11968
12467
|
enumerable: property.enumerable,
|
|
11969
12468
|
value: collection
|
|
11970
12469
|
});
|
|
11971
|
-
|
|
11972
12470
|
if (collection.length) {
|
|
11973
|
-
|
|
11974
|
-
collection.forEach(function(o) {
|
|
12471
|
+
collection.forEach(function (o) {
|
|
11975
12472
|
ref.set(o, property.inverse, target);
|
|
11976
12473
|
});
|
|
11977
12474
|
}
|
|
11978
12475
|
}
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
12476
|
function defineProperty$1(ref, property, target) {
|
|
11982
|
-
|
|
11983
12477
|
var inverseProperty = property.inverse;
|
|
11984
|
-
|
|
11985
12478
|
var _value = target[property.name];
|
|
11986
|
-
|
|
11987
12479
|
Object.defineProperty(target, property.name, {
|
|
11988
12480
|
configurable: property.configurable,
|
|
11989
12481
|
enumerable: property.enumerable,
|
|
11990
|
-
|
|
11991
|
-
get: function() {
|
|
12482
|
+
get: function () {
|
|
11992
12483
|
return _value;
|
|
11993
12484
|
},
|
|
11994
|
-
|
|
11995
|
-
set: function(value) {
|
|
11996
|
-
|
|
12485
|
+
set: function (value) {
|
|
11997
12486
|
// return if we already performed all changes
|
|
11998
12487
|
if (value === _value) {
|
|
11999
12488
|
return;
|
|
12000
12489
|
}
|
|
12001
|
-
|
|
12002
12490
|
var old = _value;
|
|
12003
12491
|
|
|
12004
12492
|
// temporary set null
|
|
12005
12493
|
_value = null;
|
|
12006
|
-
|
|
12007
12494
|
if (old) {
|
|
12008
12495
|
ref.unset(old, inverseProperty, target);
|
|
12009
12496
|
}
|
|
@@ -12015,7 +12502,6 @@
|
|
|
12015
12502
|
ref.set(_value, inverseProperty, target);
|
|
12016
12503
|
}
|
|
12017
12504
|
});
|
|
12018
|
-
|
|
12019
12505
|
}
|
|
12020
12506
|
|
|
12021
12507
|
/**
|
|
@@ -12061,16 +12547,14 @@
|
|
|
12061
12547
|
*
|
|
12062
12548
|
* wheels[0].car // undefined
|
|
12063
12549
|
*/
|
|
12064
|
-
function Refs
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
return new Refs$1(a, b);
|
|
12550
|
+
function Refs(a, b) {
|
|
12551
|
+
if (!(this instanceof Refs)) {
|
|
12552
|
+
return new Refs(a, b);
|
|
12068
12553
|
}
|
|
12069
12554
|
|
|
12070
12555
|
// link
|
|
12071
12556
|
a.inverse = b;
|
|
12072
12557
|
b.inverse = a;
|
|
12073
|
-
|
|
12074
12558
|
this.props = {};
|
|
12075
12559
|
this.props[a.name] = a;
|
|
12076
12560
|
this.props[b.name] = b;
|
|
@@ -12085,43 +12569,34 @@
|
|
|
12085
12569
|
* @param {Object} target
|
|
12086
12570
|
* @param {String} property
|
|
12087
12571
|
*/
|
|
12088
|
-
Refs
|
|
12572
|
+
Refs.prototype.bind = function (target, property) {
|
|
12089
12573
|
if (typeof property === 'string') {
|
|
12090
12574
|
if (!this.props[property]) {
|
|
12091
12575
|
throw new Error('no property <' + property + '> in ref');
|
|
12092
12576
|
}
|
|
12093
12577
|
property = this.props[property];
|
|
12094
12578
|
}
|
|
12095
|
-
|
|
12096
12579
|
if (property.collection) {
|
|
12097
12580
|
defineCollectionProperty(this, property, target);
|
|
12098
12581
|
} else {
|
|
12099
12582
|
defineProperty$1(this, property, target);
|
|
12100
12583
|
}
|
|
12101
12584
|
};
|
|
12102
|
-
|
|
12103
|
-
Refs$1.prototype.ensureRefsCollection = function(target, property) {
|
|
12104
|
-
|
|
12585
|
+
Refs.prototype.ensureRefsCollection = function (target, property) {
|
|
12105
12586
|
var collection = target[property.name];
|
|
12106
|
-
|
|
12107
|
-
if (!Collection.isExtended(collection)) {
|
|
12587
|
+
if (!isExtended(collection)) {
|
|
12108
12588
|
defineCollectionProperty(this, property, target);
|
|
12109
12589
|
}
|
|
12110
|
-
|
|
12111
12590
|
return collection;
|
|
12112
12591
|
};
|
|
12113
|
-
|
|
12114
|
-
Refs$1.prototype.ensureBound = function(target, property) {
|
|
12592
|
+
Refs.prototype.ensureBound = function (target, property) {
|
|
12115
12593
|
if (!hasOwnProperty$1(target, property)) {
|
|
12116
12594
|
this.bind(target, property);
|
|
12117
12595
|
}
|
|
12118
12596
|
};
|
|
12119
|
-
|
|
12120
|
-
Refs$1.prototype.unset = function(target, property, value) {
|
|
12121
|
-
|
|
12597
|
+
Refs.prototype.unset = function (target, property, value) {
|
|
12122
12598
|
if (target) {
|
|
12123
12599
|
this.ensureBound(target, property);
|
|
12124
|
-
|
|
12125
12600
|
if (property.collection) {
|
|
12126
12601
|
this.ensureRefsCollection(target, property).remove(value);
|
|
12127
12602
|
} else {
|
|
@@ -12129,12 +12604,9 @@
|
|
|
12129
12604
|
}
|
|
12130
12605
|
}
|
|
12131
12606
|
};
|
|
12132
|
-
|
|
12133
|
-
Refs$1.prototype.set = function(target, property, value) {
|
|
12134
|
-
|
|
12607
|
+
Refs.prototype.set = function (target, property, value) {
|
|
12135
12608
|
if (target) {
|
|
12136
12609
|
this.ensureBound(target, property);
|
|
12137
|
-
|
|
12138
12610
|
if (property.collection) {
|
|
12139
12611
|
this.ensureRefsCollection(target, property).add(value);
|
|
12140
12612
|
} else {
|
|
@@ -12143,15 +12615,6 @@
|
|
|
12143
12615
|
}
|
|
12144
12616
|
};
|
|
12145
12617
|
|
|
12146
|
-
var refs = Refs$1;
|
|
12147
|
-
|
|
12148
|
-
objectRefs.exports = refs;
|
|
12149
|
-
|
|
12150
|
-
objectRefs.exports.Collection = collection;
|
|
12151
|
-
|
|
12152
|
-
var objectRefsExports = objectRefs.exports;
|
|
12153
|
-
var Refs = /*@__PURE__*/getDefaultExportFromCjs(objectRefsExports);
|
|
12154
|
-
|
|
12155
12618
|
var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
|
|
12156
12619
|
labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),
|
|
12157
12620
|
attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),
|
|
@@ -13356,13 +13819,14 @@
|
|
|
13356
13819
|
*
|
|
13357
13820
|
* @param {SVGElement} visual The graphical element.
|
|
13358
13821
|
* @param {ShapeLike} element The shape.
|
|
13822
|
+
* @param {Object} attrs Optional attributes.
|
|
13359
13823
|
*
|
|
13360
13824
|
* @return {SVGElement}
|
|
13361
13825
|
*/
|
|
13362
|
-
GraphicsFactory.prototype.drawShape = function(visual, element) {
|
|
13826
|
+
GraphicsFactory.prototype.drawShape = function(visual, element, attrs = {}) {
|
|
13363
13827
|
var eventBus = this._eventBus;
|
|
13364
13828
|
|
|
13365
|
-
return eventBus.fire('render.shape', { gfx: visual, element
|
|
13829
|
+
return eventBus.fire('render.shape', { gfx: visual, element, attrs });
|
|
13366
13830
|
};
|
|
13367
13831
|
|
|
13368
13832
|
/**
|
|
@@ -13383,13 +13847,14 @@
|
|
|
13383
13847
|
*
|
|
13384
13848
|
* @param {SVGElement} visual The graphical element.
|
|
13385
13849
|
* @param {ConnectionLike} element The connection.
|
|
13850
|
+
* @param {Object} attrs Optional attributes.
|
|
13386
13851
|
*
|
|
13387
13852
|
* @return {SVGElement}
|
|
13388
13853
|
*/
|
|
13389
|
-
GraphicsFactory.prototype.drawConnection = function(visual, element) {
|
|
13854
|
+
GraphicsFactory.prototype.drawConnection = function(visual, element, attrs = {}) {
|
|
13390
13855
|
var eventBus = this._eventBus;
|
|
13391
13856
|
|
|
13392
|
-
return eventBus.fire('render.connection', { gfx: visual, element
|
|
13857
|
+
return eventBus.fire('render.connection', { gfx: visual, element, attrs });
|
|
13393
13858
|
};
|
|
13394
13859
|
|
|
13395
13860
|
/**
|
|
@@ -13966,6 +14431,17 @@
|
|
|
13966
14431
|
this.idProperty = p;
|
|
13967
14432
|
};
|
|
13968
14433
|
|
|
14434
|
+
DescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) {
|
|
14435
|
+
|
|
14436
|
+
const _extends = typeDescriptor.extends || [];
|
|
14437
|
+
|
|
14438
|
+
if (_extends.length) {
|
|
14439
|
+
throw new Error(
|
|
14440
|
+
`cannot create <${ typeDescriptor.name }> extending <${ typeDescriptor.extends }>`
|
|
14441
|
+
);
|
|
14442
|
+
}
|
|
14443
|
+
};
|
|
14444
|
+
|
|
13969
14445
|
DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
|
|
13970
14446
|
var propertyName = p.name,
|
|
13971
14447
|
definedProperty = this.propertiesByName[propertyName];
|
|
@@ -13984,6 +14460,10 @@
|
|
|
13984
14460
|
|
|
13985
14461
|
DescriptorBuilder.prototype.addTrait = function(t, inherited) {
|
|
13986
14462
|
|
|
14463
|
+
if (inherited) {
|
|
14464
|
+
this.assertNotTrait(t);
|
|
14465
|
+
}
|
|
14466
|
+
|
|
13987
14467
|
var typesByName = this.allTypesByName,
|
|
13988
14468
|
types = this.allTypes;
|
|
13989
14469
|
|
|
@@ -14117,7 +14597,9 @@
|
|
|
14117
14597
|
});
|
|
14118
14598
|
|
|
14119
14599
|
forEach$1(type.extends, bind$2(function(extendsName) {
|
|
14120
|
-
var
|
|
14600
|
+
var extendsNameNs = parseName(extendsName, ns.prefix);
|
|
14601
|
+
|
|
14602
|
+
var extended = this.typeMap[extendsNameNs.name];
|
|
14121
14603
|
|
|
14122
14604
|
extended.traits = extended.traits || [];
|
|
14123
14605
|
extended.traits.push(name);
|
|
@@ -14146,24 +14628,33 @@
|
|
|
14146
14628
|
|
|
14147
14629
|
var self = this;
|
|
14148
14630
|
|
|
14631
|
+
/**
|
|
14632
|
+
* Traverse the selected super type or trait
|
|
14633
|
+
*
|
|
14634
|
+
* @param {String} cls
|
|
14635
|
+
* @param {Boolean} [trait=false]
|
|
14636
|
+
*/
|
|
14637
|
+
function traverse(cls, trait) {
|
|
14638
|
+
var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
|
|
14639
|
+
self.mapTypes(parentNs, iterator, trait);
|
|
14640
|
+
}
|
|
14641
|
+
|
|
14149
14642
|
/**
|
|
14150
14643
|
* Traverse the selected trait.
|
|
14151
14644
|
*
|
|
14152
14645
|
* @param {String} cls
|
|
14153
14646
|
*/
|
|
14154
14647
|
function traverseTrait(cls) {
|
|
14155
|
-
return
|
|
14648
|
+
return traverse(cls, true);
|
|
14156
14649
|
}
|
|
14157
14650
|
|
|
14158
14651
|
/**
|
|
14159
|
-
* Traverse the selected super type
|
|
14652
|
+
* Traverse the selected super type
|
|
14160
14653
|
*
|
|
14161
14654
|
* @param {String} cls
|
|
14162
|
-
* @param {Boolean} [trait=false]
|
|
14163
14655
|
*/
|
|
14164
|
-
function traverseSuper(cls
|
|
14165
|
-
|
|
14166
|
-
self.mapTypes(parentNs, iterator, trait);
|
|
14656
|
+
function traverseSuper(cls) {
|
|
14657
|
+
return traverse(cls, false);
|
|
14167
14658
|
}
|
|
14168
14659
|
|
|
14169
14660
|
if (!type) {
|
|
@@ -14246,7 +14737,7 @@
|
|
|
14246
14737
|
throw new TypeError('property name must be a non-empty string');
|
|
14247
14738
|
}
|
|
14248
14739
|
|
|
14249
|
-
var property = this.
|
|
14740
|
+
var property = this.getProperty(target, name);
|
|
14250
14741
|
|
|
14251
14742
|
var propertyName = property && property.name;
|
|
14252
14743
|
|
|
@@ -14257,7 +14748,7 @@
|
|
|
14257
14748
|
if (property) {
|
|
14258
14749
|
delete target[propertyName];
|
|
14259
14750
|
} else {
|
|
14260
|
-
delete target.$attrs[name];
|
|
14751
|
+
delete target.$attrs[stripGlobal(name)];
|
|
14261
14752
|
}
|
|
14262
14753
|
} else {
|
|
14263
14754
|
|
|
@@ -14270,7 +14761,7 @@
|
|
|
14270
14761
|
defineProperty(target, property, value);
|
|
14271
14762
|
}
|
|
14272
14763
|
} else {
|
|
14273
|
-
target.$attrs[name] = value;
|
|
14764
|
+
target.$attrs[stripGlobal(name)] = value;
|
|
14274
14765
|
}
|
|
14275
14766
|
}
|
|
14276
14767
|
};
|
|
@@ -14285,10 +14776,10 @@
|
|
|
14285
14776
|
*/
|
|
14286
14777
|
Properties.prototype.get = function(target, name) {
|
|
14287
14778
|
|
|
14288
|
-
var property = this.
|
|
14779
|
+
var property = this.getProperty(target, name);
|
|
14289
14780
|
|
|
14290
14781
|
if (!property) {
|
|
14291
|
-
return target.$attrs[name];
|
|
14782
|
+
return target.$attrs[stripGlobal(name)];
|
|
14292
14783
|
}
|
|
14293
14784
|
|
|
14294
14785
|
var propertyName = property.name;
|
|
@@ -14342,6 +14833,44 @@
|
|
|
14342
14833
|
this.define(target, '$model', { value: model });
|
|
14343
14834
|
};
|
|
14344
14835
|
|
|
14836
|
+
/**
|
|
14837
|
+
* Return property with the given name on the element.
|
|
14838
|
+
*
|
|
14839
|
+
* @param {any} target
|
|
14840
|
+
* @param {string} name
|
|
14841
|
+
*
|
|
14842
|
+
* @return {object | null} property
|
|
14843
|
+
*/
|
|
14844
|
+
Properties.prototype.getProperty = function(target, name) {
|
|
14845
|
+
|
|
14846
|
+
var model = this.model;
|
|
14847
|
+
|
|
14848
|
+
var property = model.getPropertyDescriptor(target, name);
|
|
14849
|
+
|
|
14850
|
+
if (property) {
|
|
14851
|
+
return property;
|
|
14852
|
+
}
|
|
14853
|
+
|
|
14854
|
+
if (name.includes(':')) {
|
|
14855
|
+
return null;
|
|
14856
|
+
}
|
|
14857
|
+
|
|
14858
|
+
const strict = model.config.strict;
|
|
14859
|
+
|
|
14860
|
+
if (typeof strict !== 'undefined') {
|
|
14861
|
+
const error = new TypeError(`unknown property <${ name }> on <${ target.$type }>`);
|
|
14862
|
+
|
|
14863
|
+
if (strict) {
|
|
14864
|
+
throw error;
|
|
14865
|
+
} else {
|
|
14866
|
+
|
|
14867
|
+
// eslint-disable-next-line no-undef
|
|
14868
|
+
typeof console !== 'undefined' && console.warn(error);
|
|
14869
|
+
}
|
|
14870
|
+
}
|
|
14871
|
+
|
|
14872
|
+
return null;
|
|
14873
|
+
};
|
|
14345
14874
|
|
|
14346
14875
|
function isUndefined(val) {
|
|
14347
14876
|
return typeof val === 'undefined';
|
|
@@ -14356,6 +14885,10 @@
|
|
|
14356
14885
|
});
|
|
14357
14886
|
}
|
|
14358
14887
|
|
|
14888
|
+
function stripGlobal(name) {
|
|
14889
|
+
return name.replace(/^:/, '');
|
|
14890
|
+
}
|
|
14891
|
+
|
|
14359
14892
|
// Moddle implementation /////////////////////////////////////////////////
|
|
14360
14893
|
|
|
14361
14894
|
/**
|
|
@@ -14378,8 +14911,10 @@
|
|
|
14378
14911
|
* var moddle = new Moddle([pkg]);
|
|
14379
14912
|
*
|
|
14380
14913
|
* @param {Array<Package>} packages the packages to contain
|
|
14914
|
+
*
|
|
14915
|
+
* @param { { strict?: boolean } } [config] moddle configuration
|
|
14381
14916
|
*/
|
|
14382
|
-
function Moddle(packages) {
|
|
14917
|
+
function Moddle(packages, config = {}) {
|
|
14383
14918
|
|
|
14384
14919
|
this.properties = new Properties(this);
|
|
14385
14920
|
|
|
@@ -14387,6 +14922,8 @@
|
|
|
14387
14922
|
this.registry = new Registry(packages, this.properties);
|
|
14388
14923
|
|
|
14389
14924
|
this.typeCache = {};
|
|
14925
|
+
|
|
14926
|
+
this.config = config;
|
|
14390
14927
|
}
|
|
14391
14928
|
|
|
14392
14929
|
|
|
@@ -14480,6 +15017,12 @@
|
|
|
14480
15017
|
$type: name,
|
|
14481
15018
|
$instanceOf: function(type) {
|
|
14482
15019
|
return type === this.$type;
|
|
15020
|
+
},
|
|
15021
|
+
get: function(key) {
|
|
15022
|
+
return this[key];
|
|
15023
|
+
},
|
|
15024
|
+
set: function(key, value) {
|
|
15025
|
+
set$1(this, [ key ], value);
|
|
14483
15026
|
}
|
|
14484
15027
|
};
|
|
14485
15028
|
|
|
@@ -14495,6 +15038,8 @@
|
|
|
14495
15038
|
|
|
14496
15039
|
this.properties.defineDescriptor(element, descriptor);
|
|
14497
15040
|
this.properties.defineModel(element, this);
|
|
15041
|
+
this.properties.define(element, 'get', { enumerable: false, writable: true });
|
|
15042
|
+
this.properties.define(element, 'set', { enumerable: false, writable: true });
|
|
14498
15043
|
this.properties.define(element, '$parent', { enumerable: false, writable: true });
|
|
14499
15044
|
this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });
|
|
14500
15045
|
|