@operato/scene-bpmn 1.1.8 → 1.1.10
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/CHANGELOG.md +19 -0
- package/dist/base/bpmn-container-base.js +2 -2
- package/dist/base/bpmn-container-base.js.map +1 -1
- package/dist/base/bpmn-control-base.js +2 -2
- package/dist/base/bpmn-control-base.js.map +1 -1
- package/dist/bpmn-data-object.d.ts +2 -1
- package/dist/bpmn-data-object.js +13 -0
- package/dist/bpmn-data-object.js.map +1 -1
- package/dist/bpmn-data-store.d.ts +2 -0
- package/dist/bpmn-data-store.js +13 -0
- package/dist/bpmn-data-store.js.map +1 -1
- package/dist/bpmn-event.d.ts +9 -3
- package/dist/bpmn-event.js +28 -7
- package/dist/bpmn-event.js.map +1 -1
- package/dist/bpmn-expanded-subprocess.d.ts +13 -2
- package/dist/bpmn-expanded-subprocess.js +91 -3
- package/dist/bpmn-expanded-subprocess.js.map +1 -1
- package/dist/bpmn-flow.d.ts +8 -2
- package/dist/bpmn-flow.js +8 -0
- package/dist/bpmn-flow.js.map +1 -1
- package/dist/bpmn-gateway.d.ts +2 -1
- package/dist/bpmn-gateway.js +13 -0
- package/dist/bpmn-gateway.js.map +1 -1
- package/dist/bpmn-message.d.ts +2 -0
- package/dist/bpmn-message.js +13 -0
- package/dist/bpmn-message.js.map +1 -1
- package/dist/bpmn-subprocess.d.ts +13 -2
- package/dist/bpmn-subprocess.js +91 -3
- package/dist/bpmn-subprocess.js.map +1 -1
- package/dist/bpmn-task.js +14 -2
- package/dist/bpmn-task.js.map +1 -1
- package/dist/templates/bpmn-comment.d.ts +4 -0
- package/dist/templates/bpmn-comment.js +5 -1
- package/dist/templates/bpmn-comment.js.map +1 -1
- package/dist/templates/bpmn-data-object.d.ts +1 -0
- package/dist/templates/bpmn-data-object.js +2 -1
- package/dist/templates/bpmn-data-object.js.map +1 -1
- package/dist/templates/bpmn-data-store.d.ts +1 -0
- package/dist/templates/bpmn-data-store.js +2 -1
- package/dist/templates/bpmn-data-store.js.map +1 -1
- package/dist/templates/bpmn-event.d.ts +1 -0
- package/dist/templates/bpmn-event.js +2 -1
- package/dist/templates/bpmn-event.js.map +1 -1
- package/dist/templates/bpmn-flow.d.ts +11 -4
- package/dist/templates/bpmn-flow.js +11 -4
- package/dist/templates/bpmn-flow.js.map +1 -1
- package/dist/templates/bpmn-gateway.d.ts +1 -0
- package/dist/templates/bpmn-gateway.js +2 -1
- package/dist/templates/bpmn-gateway.js.map +1 -1
- package/dist/templates/bpmn-message.d.ts +1 -0
- package/dist/templates/bpmn-message.js +2 -1
- package/dist/templates/bpmn-message.js.map +1 -1
- package/dist/templates/index.d.ts +24 -2
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +20 -5
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +20 -0
- package/logs/application-2022-11-05-23.log +6 -0
- package/logs/application-2022-11-06-00.log +6 -0
- package/logs/application-2022-11-06-12.log +6 -0
- package/logs/application-2022-11-06-14.log +18 -0
- package/logs/connections-2022-11-05-23.log +35 -0
- package/logs/connections-2022-11-06-00.log +35 -0
- package/logs/connections-2022-11-06-12.log +35 -0
- package/logs/connections-2022-11-06-14.log +70 -0
- package/package.json +2 -2
- package/src/base/bpmn-container-base.ts +3 -3
- package/src/base/bpmn-control-base.ts +3 -3
- package/src/bpmn-data-object.ts +17 -1
- package/src/bpmn-data-store.ts +17 -1
- package/src/bpmn-event.ts +36 -10
- package/src/bpmn-expanded-subprocess.ts +94 -3
- package/src/bpmn-flow.ts +9 -0
- package/src/bpmn-gateway.ts +17 -1
- package/src/bpmn-message.ts +17 -1
- package/src/bpmn-subprocess.ts +93 -3
- package/src/bpmn-task.ts +13 -2
- package/src/templates/bpmn-comment.ts +5 -1
- package/src/templates/bpmn-data-object.ts +2 -1
- package/src/templates/bpmn-data-store.ts +2 -1
- package/src/templates/bpmn-event.ts +2 -1
- package/src/templates/bpmn-flow.ts +11 -4
- package/src/templates/bpmn-gateway.ts +2 -1
- package/src/templates/bpmn-message.ts +2 -1
- package/translations/en.json +5 -1
- package/translations/ko.json +5 -1
- package/translations/ms.json +5 -1
- package/translations/zh.json +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/logs/application-2022-11-04-11.log +0 -6
|
@@ -14,6 +14,77 @@ const NATURE = {
|
|
|
14
14
|
type: 'checkbox',
|
|
15
15
|
label: 'call-activity',
|
|
16
16
|
name: 'callActivity'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: 'checkbox',
|
|
20
|
+
label: 'transaction',
|
|
21
|
+
name: 'transaction'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'checkbox',
|
|
25
|
+
label: 'interrupting',
|
|
26
|
+
name: 'interrupting'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 'select',
|
|
30
|
+
label: 'event',
|
|
31
|
+
name: 'event',
|
|
32
|
+
property: {
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
display: '',
|
|
36
|
+
value: ''
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
display: 'message',
|
|
40
|
+
value: 'message'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
display: 'timer',
|
|
44
|
+
value: 'timer'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
display: 'error',
|
|
48
|
+
value: 'error'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
display: 'escalation',
|
|
52
|
+
value: 'escalation'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
display: 'cancel',
|
|
56
|
+
value: 'cancel'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
display: 'compensation',
|
|
60
|
+
value: 'compensation'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
display: 'conditional',
|
|
64
|
+
value: 'conditional'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
display: 'link',
|
|
68
|
+
value: 'link'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
display: 'signal',
|
|
72
|
+
value: 'signal'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
display: 'terminate',
|
|
76
|
+
value: 'terminate'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
display: 'multiple',
|
|
80
|
+
value: 'multiple'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
display: 'parallel multiple',
|
|
84
|
+
value: 'parallel-multiple'
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
17
88
|
}
|
|
18
89
|
],
|
|
19
90
|
help: '/bpmn/expanded-subprocess/expanded-subprocess'
|
|
@@ -24,8 +95,8 @@ export default class BPMNExpandedSubprocess extends BPMNContainerBase {
|
|
|
24
95
|
}
|
|
25
96
|
render(ctx) {
|
|
26
97
|
const { left, top, width, height } = this.bounds;
|
|
27
|
-
const { callActivity } = this.state;
|
|
28
|
-
|
|
98
|
+
const { callActivity, interrupting, transaction } = this.state;
|
|
99
|
+
var radius = 9;
|
|
29
100
|
ctx.translate(left, top);
|
|
30
101
|
ctx.beginPath();
|
|
31
102
|
ctx.moveTo(radius, 0);
|
|
@@ -33,8 +104,25 @@ export default class BPMNExpandedSubprocess extends BPMNContainerBase {
|
|
|
33
104
|
ctx.arcTo(width, height, 0, height, radius);
|
|
34
105
|
ctx.arcTo(0, height, 0, 0, radius);
|
|
35
106
|
ctx.arcTo(0, 0, width, 0, radius);
|
|
107
|
+
if (transaction) {
|
|
108
|
+
const LINEGAP = 3;
|
|
109
|
+
radius -= LINEGAP;
|
|
110
|
+
ctx.moveTo(radius + LINEGAP, LINEGAP);
|
|
111
|
+
ctx.arcTo(width - LINEGAP, LINEGAP, width - LINEGAP, height - LINEGAP, radius);
|
|
112
|
+
ctx.arcTo(width - LINEGAP, height - LINEGAP, LINEGAP, height, radius);
|
|
113
|
+
ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius);
|
|
114
|
+
ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius);
|
|
115
|
+
}
|
|
36
116
|
this.drawFill(ctx);
|
|
37
|
-
|
|
117
|
+
if (callActivity) {
|
|
118
|
+
this.drawStroke(ctx, { lineWidth: 5 });
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.drawStroke(ctx, {
|
|
122
|
+
lineWidth: transaction ? 1 : 2,
|
|
123
|
+
lineDash: interrupting ? 'dash' : 'solid'
|
|
124
|
+
});
|
|
125
|
+
}
|
|
38
126
|
ctx.translate(-left, -top);
|
|
39
127
|
}
|
|
40
128
|
get textHidden() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bpmn-expanded-subprocess.js","sourceRoot":"","sources":["../src/bpmn-expanded-subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"bpmn-expanded-subprocess.js","sourceRoot":"","sources":["../src/bpmn-expanded-subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGlD,OAAO,iBAAmD,MAAM,4BAA4B,CAAA;AAE5F,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM;SACd;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,aAAa;SACpB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,cAAc;SACrB;QACD;YACE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AO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;SAC9D;QAED,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAElB,IAAI,YAAY,EAAE;YAChB,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAA;SACvC;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;gBACnB,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9B,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;aAC1C,CAAC,CAAA;SACH;QAED,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAA","sourcesContent":["import { Component } from '@hatiolab/things-scene'\nimport { over } from 'lodash'\n\nimport BPMNContainerBase, { DIRECTION, INOUT, NODE, FLOW } from './base/bpmn-container-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'string',\n name: 'name',\n label: 'name'\n },\n {\n type: 'checkbox',\n label: 'call-activity',\n name: 'callActivity'\n },\n {\n type: 'checkbox',\n label: 'transaction',\n name: 'transaction'\n },\n {\n type: 'checkbox',\n label: 'interrupting',\n name: 'interrupting'\n },\n {\n type: 'select',\n label: 'event',\n name: 'event',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'message',\n value: 'message'\n },\n {\n display: 'timer',\n value: 'timer'\n },\n {\n display: 'error',\n value: 'error'\n },\n {\n display: 'escalation',\n value: 'escalation'\n },\n {\n display: 'cancel',\n value: 'cancel'\n },\n {\n display: 'compensation',\n value: 'compensation'\n },\n {\n display: 'conditional',\n value: 'conditional'\n },\n {\n display: 'link',\n value: 'link'\n },\n {\n display: 'signal',\n value: 'signal'\n },\n {\n display: 'terminate',\n value: 'terminate'\n },\n {\n display: 'multiple',\n value: 'multiple'\n },\n {\n display: 'parallel multiple',\n value: 'parallel-multiple'\n }\n ]\n }\n }\n ],\n help: '/bpmn/expanded-subprocess/expanded-subprocess'\n}\n\nexport default class BPMNExpandedSubprocess extends BPMNContainerBase {\n get nature() {\n return NATURE\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { callActivity, interrupting, transaction } = this.state\n var radius = 9\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n if (transaction) {\n const LINEGAP = 3\n radius -= LINEGAP\n\n ctx.moveTo(radius + LINEGAP, LINEGAP)\n ctx.arcTo(width - LINEGAP, LINEGAP, width - LINEGAP, height - LINEGAP, radius)\n ctx.arcTo(width - LINEGAP, height - LINEGAP, LINEGAP, height, radius)\n ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius)\n ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius)\n }\n\n this.drawFill(ctx)\n\n if (callActivity) {\n this.drawStroke(ctx, { lineWidth: 5 })\n } else {\n this.drawStroke(ctx, {\n lineWidth: transaction ? 1 : 2,\n lineDash: interrupting ? 'dash' : 'solid'\n })\n }\n\n ctx.translate(-left, -top)\n }\n\n get textHidden() {\n return false\n }\n}\n\nComponent.register('bpmn-expanded-subprocess', BPMNExpandedSubprocess)\n"]}
|
package/dist/bpmn-flow.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export default class BPMNFlow extends OrthoLine {
|
|
|
4
4
|
mutable: boolean;
|
|
5
5
|
resizable: boolean;
|
|
6
6
|
rotatable: boolean;
|
|
7
|
-
properties: {
|
|
7
|
+
properties: ({
|
|
8
8
|
type: string;
|
|
9
9
|
label: string;
|
|
10
10
|
name: string;
|
|
@@ -13,7 +13,13 @@ export default class BPMNFlow extends OrthoLine {
|
|
|
13
13
|
max: number;
|
|
14
14
|
step: number;
|
|
15
15
|
};
|
|
16
|
-
}
|
|
16
|
+
} | {
|
|
17
|
+
type: string;
|
|
18
|
+
label: string;
|
|
19
|
+
name: string;
|
|
20
|
+
property?: undefined;
|
|
21
|
+
})[];
|
|
17
22
|
help: string;
|
|
18
23
|
};
|
|
24
|
+
get pathExtendable(): boolean;
|
|
19
25
|
}
|
package/dist/bpmn-flow.js
CHANGED
|
@@ -13,6 +13,11 @@ const NATURE = {
|
|
|
13
13
|
max: 100,
|
|
14
14
|
step: 1
|
|
15
15
|
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: 'checkbox',
|
|
19
|
+
label: 'default',
|
|
20
|
+
name: 'default'
|
|
16
21
|
}
|
|
17
22
|
],
|
|
18
23
|
help: 'bpmn/flow/flow'
|
|
@@ -21,6 +26,9 @@ export default class BPMNFlow extends OrthoLine {
|
|
|
21
26
|
get nature() {
|
|
22
27
|
return NATURE;
|
|
23
28
|
}
|
|
29
|
+
get pathExtendable() {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
33
|
Component.register('bpmn-flow', BPMNFlow);
|
|
26
34
|
//# sourceMappingURL=bpmn-flow.js.map
|
package/dist/bpmn-flow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bpmn-flow.js","sourceRoot":"","sources":["../src/bpmn-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE7D,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE;gBACR,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,GAAG;gBACR,IAAI,EAAE,CAAC;aACR;SACF;KACF;IACD,IAAI,EAAE,gBAAgB;CACvB,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAS;IAC7C,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["import { Component, OrthoLine } from '@hatiolab/things-scene'\n\nconst NATURE = {\n mutable: false,\n resizable: false,\n rotatable: false,\n properties: [\n {\n type: 'number',\n label: 'round',\n name: 'round',\n property: {\n min: 0,\n max: 100,\n step: 1\n }\n }\n ],\n help: 'bpmn/flow/flow'\n}\n\nexport default class BPMNFlow extends OrthoLine {\n get nature() {\n return NATURE\n }\n}\n\nComponent.register('bpmn-flow', BPMNFlow)\n"]}
|
|
1
|
+
{"version":3,"file":"bpmn-flow.js","sourceRoot":"","sources":["../src/bpmn-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE7D,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE;gBACR,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,GAAG;gBACR,IAAI,EAAE,CAAC;aACR;SACF;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,SAAS;SAChB;KACF;IACD,IAAI,EAAE,gBAAgB;CACvB,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAS;IAC7C,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["import { Component, OrthoLine } from '@hatiolab/things-scene'\n\nconst NATURE = {\n mutable: false,\n resizable: false,\n rotatable: false,\n properties: [\n {\n type: 'number',\n label: 'round',\n name: 'round',\n property: {\n min: 0,\n max: 100,\n step: 1\n }\n },\n {\n type: 'checkbox',\n label: 'default',\n name: 'default'\n }\n ],\n help: 'bpmn/flow/flow'\n}\n\nexport default class BPMNFlow extends OrthoLine {\n get nature() {\n return NATURE\n }\n\n get pathExtendable() {\n return false\n }\n}\n\nComponent.register('bpmn-flow', BPMNFlow)\n"]}
|
package/dist/bpmn-gateway.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Properties } from '@hatiolab/things-scene';
|
|
1
|
+
import { BOUNDS, Properties } from '@hatiolab/things-scene';
|
|
2
2
|
import BPMNControlBase from './base/bpmn-control-base';
|
|
3
3
|
export default class BPMNGateway extends BPMNControlBase {
|
|
4
4
|
private imageElement?;
|
|
@@ -19,6 +19,7 @@ export default class BPMNGateway extends BPMNControlBase {
|
|
|
19
19
|
}[];
|
|
20
20
|
help: string;
|
|
21
21
|
};
|
|
22
|
+
get textBounds(): BOUNDS;
|
|
22
23
|
render(ctx: CanvasRenderingContext2D): void;
|
|
23
24
|
onchange(after: Properties, before: Properties): void;
|
|
24
25
|
getImageElement(): HTMLImageElement | undefined;
|
package/dist/bpmn-gateway.js
CHANGED
|
@@ -45,6 +45,19 @@ export default class BPMNGateway extends BPMNControlBase {
|
|
|
45
45
|
static get nature() {
|
|
46
46
|
return NATURE;
|
|
47
47
|
}
|
|
48
|
+
get textBounds() {
|
|
49
|
+
var { left, top, width, height } = this.bounds;
|
|
50
|
+
var { paddingTop, paddingLeft, paddingRight } = this.state;
|
|
51
|
+
paddingTop || (paddingTop = 0);
|
|
52
|
+
paddingLeft || (paddingLeft = 0);
|
|
53
|
+
paddingRight || (paddingRight = 0);
|
|
54
|
+
return {
|
|
55
|
+
left: left + paddingLeft,
|
|
56
|
+
top: top + paddingTop + height + 10,
|
|
57
|
+
width: Math.max(width - paddingLeft - paddingRight, 0),
|
|
58
|
+
height: 0
|
|
59
|
+
};
|
|
60
|
+
}
|
|
48
61
|
render(ctx) {
|
|
49
62
|
var { left, top, width, height } = this.bounds;
|
|
50
63
|
ctx.translate(left, top);
|
package/dist/bpmn-gateway.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bpmn-gateway.js","sourceRoot":"","sources":["../src/bpmn-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"bpmn-gateway.js","sourceRoot":"","sources":["../src/bpmn-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAEtE,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,EAAE;wBACX,KAAK,EAAE,EAAE;qBACV;oBACD;wBACE,OAAO,EAAE,WAAW;wBACpB,KAAK,EAAE,WAAW;qBACnB;oBACD;wBACE,OAAO,EAAE,WAAW;wBACpB,KAAK,EAAE,WAAW;qBACnB;oBACD;wBACE,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,SAAS;qBACjB;oBACD;wBACE,OAAO,EAAE,aAAa;wBACtB,KAAK,EAAE,aAAa;qB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C,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAA;SAClG;QAED,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA;AAE/C,MAAM,MAAM,GAA+B;IACzC,SAAS,EAAE;;;;;;;;;GASV;IACD,SAAS,EAAE;;;;;;;;;GASV;IACD,QAAQ,EAAE;;;;;;;;;GAST;IACD,OAAO,EAAE;;;;;;;;;;;GAWR;IACD,aAAa,EAAE;;;;;;;;;;;;GAYd;CACF,CAAA","sourcesContent":["import { BOUNDS, Component, Properties } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'select',\n label: 'gateway-type',\n name: 'gatewayType',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'exclusive',\n value: 'exclusive'\n },\n {\n display: 'inclusive',\n value: 'inclusive'\n },\n {\n display: 'complex',\n value: 'complex'\n },\n {\n display: 'event based',\n value: 'event-based'\n },\n {\n display: 'parallel',\n value: 'parallel'\n }\n ]\n }\n }\n ],\n help: '/bpmn/gateway/gateway'\n}\n\nexport default class BPMNGateway extends BPMNControlBase {\n private imageElement?: HTMLImageElement\n\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(width / 2, 0)\n ctx.lineTo(width, height / 2)\n ctx.lineTo(width / 2, height)\n ctx.lineTo(0, height / 2)\n ctx.lineTo(width / 2, 0)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, width / 6, height / 6, (width * 2) / 3, (height * 2) / 3)\n }\n\n ctx.translate(-left, -top)\n }\n\n onchange(after: Properties, before: Properties) {\n if ('gatewayType' in after || 'strokeStyle' in after) {\n delete this.imageElement\n }\n }\n\n getImageElement(): HTMLImageElement | undefined {\n if (!this.imageElement) {\n const { gatewayType, strokeStyle } = this.state\n\n if (!gatewayType) {\n return\n }\n\n const src = IMAGES[gatewayType]\n if (!src) {\n return\n }\n\n this.imageElement = new Image()\n this.imageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(src.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.imageElement\n }\n}\n\nComponent.register('bpmn-gateway', BPMNGateway)\n\nconst IMAGES: { [type: string]: string } = {\n inclusive: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17.5,8.5c5,0,9,4,9,9s-4,9-9,9s-9-4-9-9S12.5,8.5,17.5,8.5 M17.5,6C11.1,6,6,11.1,6,17.5S11.1,29,17.5,29S29,23.9,29,17.5\n\t\tS23.9,6,17.5,6L17.5,6z\"/>\n </svg>\n `,\n exclusive: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"6.5\" y=\"15.8\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"22\" height=\"3.5\"/>\n <rect class=\"st0\" x=\"15.8\" y=\"6.5\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"3.5\" height=\"22\"/>\n </svg>\n `,\n parallel: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"16.3\" y=\"6.5\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" width=\"22\" height=\"3.5\"/>\n </svg>\n `,\n complex: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"16.2\" y=\"6.5\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"22\" height=\"3.5\"/>\n <rect class=\"st0\" x=\"16.2\" y=\"6.5\" transform=\"matrix(0.7072 -0.707 0.707 0.7072 -7.2487 17.4966)\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" width=\"22\" height=\"3.5\"/>\n </svg>\n `,\n 'event-based': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17.5,6.2c6.2,0,11.2,5,11.2,11.2s-5,11.2-11.2,11.2s-11.2-5-11.2-11.2S11.3,6.2,17.5,6.2 M17.5,5.5c-6.6,0-12,5.4-12,12\n s5.4,12,12,12s12-5.4,12-12S24.1,5.5,17.5,5.5L17.5,5.5z\"/>\n <path class=\"st0\" d=\"M17.5,8.2c5.1,0,9.2,4.1,9.2,9.2s-4.1,9.2-9.2,9.2s-9.2-4.1-9.2-9.2S12.4,8.2,17.5,8.2 M17.5,7.5c-5.5,0-10,4.5-10,10\n s4.5,10,10,10s10-4.5,10-10S23,7.5,17.5,7.5L17.5,7.5z\"/>\n <path class=\"st0\" d=\"M17.5,11.7l5.7,4.1L21,22.5h-7l-2.2-6.7L17.5,11.7 M17.5,10l-7.3,5.3l2.8,8.6h9l2.8-8.6L17.5,10L17.5,10z\"/>\n </svg>\n `\n}\n"]}
|
package/dist/bpmn-message.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BOUNDS } from '@hatiolab/things-scene';
|
|
1
2
|
import BPMNControlBase from './base/bpmn-control-base';
|
|
2
3
|
export default class BPMNMessage extends BPMNControlBase {
|
|
3
4
|
static get nature(): {
|
|
@@ -7,5 +8,6 @@ export default class BPMNMessage extends BPMNControlBase {
|
|
|
7
8
|
properties: never[];
|
|
8
9
|
help: string;
|
|
9
10
|
};
|
|
11
|
+
get textBounds(): BOUNDS;
|
|
10
12
|
render(ctx: CanvasRenderingContext2D): void;
|
|
11
13
|
}
|
package/dist/bpmn-message.js
CHANGED
|
@@ -11,6 +11,19 @@ export default class BPMNMessage extends BPMNControlBase {
|
|
|
11
11
|
static get nature() {
|
|
12
12
|
return NATURE;
|
|
13
13
|
}
|
|
14
|
+
get textBounds() {
|
|
15
|
+
var { left, top, width, height } = this.bounds;
|
|
16
|
+
var { paddingTop, paddingLeft, paddingRight } = this.state;
|
|
17
|
+
paddingTop || (paddingTop = 0);
|
|
18
|
+
paddingLeft || (paddingLeft = 0);
|
|
19
|
+
paddingRight || (paddingRight = 0);
|
|
20
|
+
return {
|
|
21
|
+
left: left + paddingLeft,
|
|
22
|
+
top: top + paddingTop + height + 10,
|
|
23
|
+
width: Math.max(width - paddingLeft - paddingRight, 0),
|
|
24
|
+
height: 0
|
|
25
|
+
};
|
|
26
|
+
}
|
|
14
27
|
render(ctx) {
|
|
15
28
|
var { left, top, width, height } = this.bounds;
|
|
16
29
|
const corner = (Math.min(width, height) * 2) / 5;
|
package/dist/bpmn-message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bpmn-message.js","sourceRoot":"","sources":["../src/bpmn-message.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"bpmn-message.js","sourceRoot":"","sources":["../src/bpmn-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE1D,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,uBAAuB;CAC9B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,eAAe;IACtD,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9C,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE1D,UAAU,KAA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QAEpB,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA","sourcesContent":["import { BOUNDS, Component } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/message/message'\n}\n\nexport default class BPMNMessage extends BPMNControlBase {\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n const corner = (Math.min(width, height) * 2) / 5\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(0, 0)\n ctx.lineTo(width, 0)\n ctx.lineTo(width, height)\n ctx.lineTo(0, height)\n ctx.lineTo(0, 0)\n ctx.lineTo(width / 2, height / 2)\n ctx.lineTo(width, 0)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.translate(-left, -top)\n }\n}\n\nComponent.register('bpmn-message', BPMNMessage)\n"]}
|
|
@@ -6,11 +6,22 @@ export default class BPMNSubprocess extends BPMNControlBase {
|
|
|
6
6
|
mutable: boolean;
|
|
7
7
|
resizable: boolean;
|
|
8
8
|
rotatable: boolean;
|
|
9
|
-
properties: {
|
|
9
|
+
properties: ({
|
|
10
10
|
type: string;
|
|
11
11
|
label: string;
|
|
12
12
|
name: string;
|
|
13
|
-
|
|
13
|
+
property?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
type: string;
|
|
16
|
+
label: string;
|
|
17
|
+
name: string;
|
|
18
|
+
property: {
|
|
19
|
+
options: {
|
|
20
|
+
display: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
})[];
|
|
14
25
|
help: string;
|
|
15
26
|
};
|
|
16
27
|
render(ctx: CanvasRenderingContext2D): void;
|
package/dist/bpmn-subprocess.js
CHANGED
|
@@ -29,6 +29,77 @@ const NATURE = {
|
|
|
29
29
|
type: 'checkbox',
|
|
30
30
|
label: 'call-activity',
|
|
31
31
|
name: 'callActivity'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'checkbox',
|
|
35
|
+
label: 'transaction',
|
|
36
|
+
name: 'transaction'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'checkbox',
|
|
40
|
+
label: 'interrupting',
|
|
41
|
+
name: 'interrupting'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'select',
|
|
45
|
+
label: 'event',
|
|
46
|
+
name: 'event',
|
|
47
|
+
property: {
|
|
48
|
+
options: [
|
|
49
|
+
{
|
|
50
|
+
display: '',
|
|
51
|
+
value: ''
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
display: 'message',
|
|
55
|
+
value: 'message'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
display: 'timer',
|
|
59
|
+
value: 'timer'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
display: 'error',
|
|
63
|
+
value: 'error'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
display: 'escalation',
|
|
67
|
+
value: 'escalation'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
display: 'cancel',
|
|
71
|
+
value: 'cancel'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
display: 'compensation',
|
|
75
|
+
value: 'compensation'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
display: 'conditional',
|
|
79
|
+
value: 'conditional'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
display: 'link',
|
|
83
|
+
value: 'link'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
display: 'signal',
|
|
87
|
+
value: 'signal'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
display: 'terminate',
|
|
91
|
+
value: 'terminate'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
display: 'multiple',
|
|
95
|
+
value: 'multiple'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
display: 'parallel multiple',
|
|
99
|
+
value: 'parallel-multiple'
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
32
103
|
}
|
|
33
104
|
],
|
|
34
105
|
help: '/bpmn/subprocess/subprocess'
|
|
@@ -39,17 +110,34 @@ export default class BPMNSubprocess extends BPMNControlBase {
|
|
|
39
110
|
}
|
|
40
111
|
render(ctx) {
|
|
41
112
|
var { left, top, width, height } = this.bounds;
|
|
42
|
-
const { callActivity } = this.state;
|
|
113
|
+
const { callActivity, interrupting, transaction } = this.state;
|
|
43
114
|
ctx.translate(left, top);
|
|
44
115
|
ctx.beginPath();
|
|
45
|
-
var radius =
|
|
116
|
+
var radius = 10;
|
|
46
117
|
ctx.moveTo(radius, 0);
|
|
47
118
|
ctx.arcTo(width, 0, width, height, radius);
|
|
48
119
|
ctx.arcTo(width, height, 0, height, radius);
|
|
49
120
|
ctx.arcTo(0, height, 0, 0, radius);
|
|
50
121
|
ctx.arcTo(0, 0, width, 0, radius);
|
|
122
|
+
if (transaction) {
|
|
123
|
+
const LINEGAP = 3;
|
|
124
|
+
radius -= LINEGAP;
|
|
125
|
+
ctx.moveTo(radius + LINEGAP, LINEGAP);
|
|
126
|
+
ctx.arcTo(width - LINEGAP, LINEGAP, width - LINEGAP, height - LINEGAP, radius);
|
|
127
|
+
ctx.arcTo(width - LINEGAP, height - LINEGAP, LINEGAP, height, radius);
|
|
128
|
+
ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius);
|
|
129
|
+
ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius);
|
|
130
|
+
}
|
|
51
131
|
this.drawFill(ctx);
|
|
52
|
-
|
|
132
|
+
if (callActivity) {
|
|
133
|
+
this.drawStroke(ctx, { lineWidth: 5 });
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
this.drawStroke(ctx, {
|
|
137
|
+
lineWidth: transaction ? 1 : 2,
|
|
138
|
+
lineDash: interrupting ? 'dash' : 'solid'
|
|
139
|
+
});
|
|
140
|
+
}
|
|
53
141
|
ctx.beginPath();
|
|
54
142
|
const images = this.getMarkerImages() || [];
|
|
55
143
|
const start = (width - images.length * 16) / 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bpmn-subprocess.js","sourceRoot":"","sources":["../src/bpmn-subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAE9D,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;SACb;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,eAAe;SACtB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;SACd;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;SACrB;KACF;IACD,IAAI,EAAE,6BAA6B;CACpC,CAAA;AAED,MAAM,CAAC,OAAO,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,CAAC,CAAA;AAErD,MAAM,OAAO,GAA+B;IAC1C,IAAI,EAAE;;;;;;;;;CASP;IACC,aAAa,EAAE;;;;;;;;;;;;GAYd;IACD,YAAY,EAAE;;;;;;;;;;;;;;;GAeb;IACD,UAAU,EAAE;;;;;;;;;;;;;;;;;GAiBX;IACD,KAAK,EAAE;;;;;;;;;;GAUN;CACF,CAAA","sourcesContent":["import { Component, Properties } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'checkbox',\n label: 'loop',\n name: 'loop'\n },\n {\n type: 'checkbox',\n label: 'multi-instance',\n name: 'multiInstance'\n },\n {\n type: 'checkbox',\n label: 'compensation',\n name: 'compensation'\n },\n {\n type: 'checkbox',\n label: 'adhoc',\n name: 'adhoc'\n },\n {\n type: 'checkbox',\n label: 'call-activity',\n name: 'callActivity'\n }\n ],\n help: '/bpmn/subprocess/subprocess'\n}\n\nexport default class BPMNSubprocess extends BPMNControlBase {\n private markerImages?: HTMLImageElement[]\n\n static get nature() {\n return NATURE\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n const { callActivity } = this.state\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n var radius = 9\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n this.drawFill(ctx)\n this.drawStroke(ctx, callActivity ? { lineWidth: 5 } : undefined)\n\n ctx.beginPath()\n\n const images = this.getMarkerImages() || []\n const start = (width - images.length * 16) / 2\n\n images.forEach((image, index) => {\n this.drawImage(ctx, image, start + index * 16, height - 16, 16, 16)\n })\n\n ctx.translate(-left, -top)\n }\n\n onchange(after: Properties, before: Properties) {\n if (['loop', 'multiInstance', 'adhoc', 'compensation', 'strokeStyle'].find(prop => prop in after)) {\n delete this.markerImages\n }\n }\n\n getMarkerImages(): HTMLImageElement[] | null | undefined {\n if (!this.markerImages) {\n const { strokeStyle } = this.state\n\n this.markerImages = Object.keys(MARKERS)\n .filter(key => key === 'subprocess' || this.state[key])\n .map(key => {\n let image = new Image()\n image.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(MARKERS[key].replace(/{{strokeColor}}/g, strokeStyle))\n return image\n })\n }\n\n return this.markerImages\n }\n}\n\nComponent.register('bpmn-subprocess', BPMNSubprocess)\n\nconst MARKERS: { [type: string]: string } = {\n loop: `\n<svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M9.5,5.2C4.3,9.7,3.7,17.5,8.1,22.8L5,25.4l7.8,0.6l0.6-7.8L10.2,21c-3.5-4.1-3-10.1,1-13.6s10.1-3,13.6,1\n\ts3,10.1-1,13.6c-1.6,1.4-3.5,2.1-5.4,2.3l-0.2,2.8c2.6-0.2,5.3-1.1,7.4-3c5.2-4.5,5.8-12.3,1.3-17.5S14.7,0.8,9.5,5.2z\"/>\n</svg>\n`,\n multiInstance: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <rect x=\"5.5\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n <rect x=\"15.9\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n <rect x=\"26.2\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n </g>\n </svg>\n `,\n compensation: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <path class=\"st0\" d=\"M16.1,6.9v15.6l-7.8-7.8L16.1,6.9 M18.1,2.1L5.5,14.7l12.6,12.6V2.1L18.1,2.1z M5.5,14.7L5.5,14.7L5.5,14.7\n L5.5,14.7L5.5,14.7z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M27.5,6.9v15.6l-7.8-7.8L27.5,6.9 M29.5,2.1L16.9,14.7l12.6,12.6V2.1L29.5,2.1z M16.9,14.7L16.9,14.7\n L16.9,14.7L16.9,14.7L16.9,14.7z\"/>\n </g>\n </svg>\n `,\n subprocess: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-miterlimit:10;}\n .st1{fill:{{strokeColor}};} \n </style>\n <rect x=\"5.5\" y=\"2.5\" class=\"st0\" width=\"24\" height=\"24\"/>\n <g>\n <g>\n <rect x=\"16.4\" y=\"6\" class=\"st1\" width=\"2.1\" height=\"17\"/>\n </g>\n <g>\n <rect x=\"9\" y=\"13.4\" class=\"st1\" width=\"17\" height=\"2.1\"/>\n </g>\n </g>\n </svg>\n `,\n adhoc: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M29.2,10.3c-0.8,0.9-1.7,1.7-2.5,2.2c-0.8,0.5-1.6,0.8-2.4,0.8c-1,0-3-0.6-6.1-1.9C15,10.2,12.6,9.6,11,9.6\n\t\tc-2.1,0-3.9,0.7-5.5,1.9v6.9c0.1,0,0.3-0.2,0.6-0.6C7.9,16,9.5,15,10.9,15c0.8,0,2.9,0.6,6.1,1.9c3.3,1.2,5.7,1.8,7.1,1.8\n\t\tc2,0,3.8-0.6,5.3-1.8v-6.9C29.4,10.1,29.3,10.2,29.2,10.3z\"/>\n </svg>\n `\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bpmn-subprocess.js","sourceRoot":"","sources":["../src/bpmn-subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAE9D,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;SACb;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,eAAe;SACtB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;SACd;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE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AI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE;YACjG,OAAO,IAAI,CAAC,YAAY,CAAA;SACzB;IACH,CAAC;IAED,eAAe;QACb,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;YAElC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;iBACrC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;iBACtD,GAAG,CAAC,GAAG,CAAC,EAAE;gBACT,IAAI,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;gBACvB,KAAK,CAAC,GAAG;oBACP,0CAA0C,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAA;gBAC1G,OAAO,KAAK,CAAA;YACd,CAAC,CAAC,CAAA;SACL;QAED,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAA;AAErD,MAAM,OAAO,GAA+B;IAC1C,IAAI,EAAE;;;;;;;;;CASP;IACC,aAAa,EAAE;;;;;;;;;;;;GAYd;IACD,YAAY,EAAE;;;;;;;;;;;;;;;GAeb;IACD,UAAU,EAAE;;;;;;;;;;;;;;;;;GAiBX;IACD,KAAK,EAAE;;;;;;;;;;GAUN;CACF,CAAA","sourcesContent":["import { Component, Properties } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'checkbox',\n label: 'loop',\n name: 'loop'\n },\n {\n type: 'checkbox',\n label: 'multi-instance',\n name: 'multiInstance'\n },\n {\n type: 'checkbox',\n label: 'compensation',\n name: 'compensation'\n },\n {\n type: 'checkbox',\n label: 'adhoc',\n name: 'adhoc'\n },\n {\n type: 'checkbox',\n label: 'call-activity',\n name: 'callActivity'\n },\n {\n type: 'checkbox',\n label: 'transaction',\n name: 'transaction'\n },\n {\n type: 'checkbox',\n label: 'interrupting',\n name: 'interrupting'\n },\n {\n type: 'select',\n label: 'event',\n name: 'event',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'message',\n value: 'message'\n },\n {\n display: 'timer',\n value: 'timer'\n },\n {\n display: 'error',\n value: 'error'\n },\n {\n display: 'escalation',\n value: 'escalation'\n },\n {\n display: 'cancel',\n value: 'cancel'\n },\n {\n display: 'compensation',\n value: 'compensation'\n },\n {\n display: 'conditional',\n value: 'conditional'\n },\n {\n display: 'link',\n value: 'link'\n },\n {\n display: 'signal',\n value: 'signal'\n },\n {\n display: 'terminate',\n value: 'terminate'\n },\n {\n display: 'multiple',\n value: 'multiple'\n },\n {\n display: 'parallel multiple',\n value: 'parallel-multiple'\n }\n ]\n }\n }\n ],\n help: '/bpmn/subprocess/subprocess'\n}\n\nexport default class BPMNSubprocess extends BPMNControlBase {\n private markerImages?: HTMLImageElement[]\n\n static get nature() {\n return NATURE\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n const { callActivity, interrupting, transaction } = this.state\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n var radius = 10\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n if (transaction) {\n const LINEGAP = 3\n radius -= LINEGAP\n\n ctx.moveTo(radius + LINEGAP, LINEGAP)\n ctx.arcTo(width - LINEGAP, LINEGAP, width - LINEGAP, height - LINEGAP, radius)\n ctx.arcTo(width - LINEGAP, height - LINEGAP, LINEGAP, height, radius)\n ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius)\n ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius)\n }\n\n this.drawFill(ctx)\n\n if (callActivity) {\n this.drawStroke(ctx, { lineWidth: 5 })\n } else {\n this.drawStroke(ctx, {\n lineWidth: transaction ? 1 : 2,\n lineDash: interrupting ? 'dash' : 'solid'\n })\n }\n\n ctx.beginPath()\n\n const images = this.getMarkerImages() || []\n const start = (width - images.length * 16) / 2\n\n images.forEach((image, index) => {\n this.drawImage(ctx, image, start + index * 16, height - 16, 16, 16)\n })\n\n ctx.translate(-left, -top)\n }\n\n onchange(after: Properties, before: Properties) {\n if (['loop', 'multiInstance', 'adhoc', 'compensation', 'strokeStyle'].find(prop => prop in after)) {\n delete this.markerImages\n }\n }\n\n getMarkerImages(): HTMLImageElement[] | null | undefined {\n if (!this.markerImages) {\n const { strokeStyle } = this.state\n\n this.markerImages = Object.keys(MARKERS)\n .filter(key => key === 'subprocess' || this.state[key])\n .map(key => {\n let image = new Image()\n image.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(MARKERS[key].replace(/{{strokeColor}}/g, strokeStyle))\n return image\n })\n }\n\n return this.markerImages\n }\n}\n\nComponent.register('bpmn-subprocess', BPMNSubprocess)\n\nconst MARKERS: { [type: string]: string } = {\n loop: `\n<svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M9.5,5.2C4.3,9.7,3.7,17.5,8.1,22.8L5,25.4l7.8,0.6l0.6-7.8L10.2,21c-3.5-4.1-3-10.1,1-13.6s10.1-3,13.6,1\n\ts3,10.1-1,13.6c-1.6,1.4-3.5,2.1-5.4,2.3l-0.2,2.8c2.6-0.2,5.3-1.1,7.4-3c5.2-4.5,5.8-12.3,1.3-17.5S14.7,0.8,9.5,5.2z\"/>\n</svg>\n`,\n multiInstance: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <rect x=\"5.5\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n <rect x=\"15.9\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n <rect x=\"26.2\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n </g>\n </svg>\n `,\n compensation: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <path class=\"st0\" d=\"M16.1,6.9v15.6l-7.8-7.8L16.1,6.9 M18.1,2.1L5.5,14.7l12.6,12.6V2.1L18.1,2.1z M5.5,14.7L5.5,14.7L5.5,14.7\n L5.5,14.7L5.5,14.7z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M27.5,6.9v15.6l-7.8-7.8L27.5,6.9 M29.5,2.1L16.9,14.7l12.6,12.6V2.1L29.5,2.1z M16.9,14.7L16.9,14.7\n L16.9,14.7L16.9,14.7L16.9,14.7z\"/>\n </g>\n </svg>\n `,\n subprocess: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-miterlimit:10;}\n .st1{fill:{{strokeColor}};} \n </style>\n <rect x=\"5.5\" y=\"2.5\" class=\"st0\" width=\"24\" height=\"24\"/>\n <g>\n <g>\n <rect x=\"16.4\" y=\"6\" class=\"st1\" width=\"2.1\" height=\"17\"/>\n </g>\n <g>\n <rect x=\"9\" y=\"13.4\" class=\"st1\" width=\"17\" height=\"2.1\"/>\n </g>\n </g>\n </svg>\n `,\n adhoc: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M29.2,10.3c-0.8,0.9-1.7,1.7-2.5,2.2c-0.8,0.5-1.6,0.8-2.4,0.8c-1,0-3-0.6-6.1-1.9C15,10.2,12.6,9.6,11,9.6\n\t\tc-2.1,0-3.9,0.7-5.5,1.9v6.9c0.1,0,0.3-0.2,0.6-0.6C7.9,16,9.5,15,10.9,15c0.8,0,2.9,0.6,6.1,1.9c3.3,1.2,5.7,1.8,7.1,1.8\n\t\tc2,0,3.8-0.6,5.3-1.8v-6.9C29.4,10.1,29.3,10.2,29.2,10.3z\"/>\n </svg>\n `\n}\n"]}
|
package/dist/bpmn-task.js
CHANGED
|
@@ -76,6 +76,11 @@ const NATURE = {
|
|
|
76
76
|
type: 'checkbox',
|
|
77
77
|
label: 'call-activity',
|
|
78
78
|
name: 'callActivity'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: 'checkbox',
|
|
82
|
+
label: 'interrupting',
|
|
83
|
+
name: 'interrupting'
|
|
79
84
|
}
|
|
80
85
|
],
|
|
81
86
|
help: '/bpmn/task/task'
|
|
@@ -86,7 +91,7 @@ export default class BPMNTask extends BPMNControlBase {
|
|
|
86
91
|
}
|
|
87
92
|
render(ctx) {
|
|
88
93
|
const { left, top, width, height } = this.bounds;
|
|
89
|
-
const { callActivity } = this.state;
|
|
94
|
+
const { callActivity, interrupting } = this.state;
|
|
90
95
|
const radius = 9;
|
|
91
96
|
ctx.translate(left, top);
|
|
92
97
|
ctx.beginPath();
|
|
@@ -96,7 +101,14 @@ export default class BPMNTask extends BPMNControlBase {
|
|
|
96
101
|
ctx.arcTo(0, height, 0, 0, radius);
|
|
97
102
|
ctx.arcTo(0, 0, width, 0, radius);
|
|
98
103
|
this.drawFill(ctx);
|
|
99
|
-
|
|
104
|
+
if (callActivity) {
|
|
105
|
+
this.drawStroke(ctx, { lineWidth: 5 });
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
this.drawStroke(ctx, {
|
|
109
|
+
lineDash: interrupting ? 'dash' : 'solid'
|
|
110
|
+
});
|
|
111
|
+
}
|
|
100
112
|
ctx.beginPath();
|
|
101
113
|
const image = this.getImageElement();
|
|
102
114
|
if (image) {
|