@operato/scene-bpmn 8.0.0-beta.1 → 8.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.
Files changed (39) hide show
  1. package/package.json +5 -5
  2. package/CHANGELOG.md +0 -400
  3. package/src/base/bpmn-activity.ts +0 -32
  4. package/src/base/bpmn-container-base.ts +0 -201
  5. package/src/base/bpmn-control-base.ts +0 -201
  6. package/src/bpmn-comment.ts +0 -64
  7. package/src/bpmn-data-object.ts +0 -181
  8. package/src/bpmn-data-store.ts +0 -63
  9. package/src/bpmn-event.ts +0 -468
  10. package/src/bpmn-expanded-subprocess.ts +0 -207
  11. package/src/bpmn-flow.ts +0 -37
  12. package/src/bpmn-gateway.ts +0 -181
  13. package/src/bpmn-group.ts +0 -39
  14. package/src/bpmn-lane.ts +0 -125
  15. package/src/bpmn-message.ts +0 -57
  16. package/src/bpmn-pool.ts +0 -25
  17. package/src/bpmn-subprocess.ts +0 -323
  18. package/src/bpmn-task.ts +0 -479
  19. package/src/characteristics/loop.ts +0 -0
  20. package/src/editors/index.ts +0 -0
  21. package/src/groups/index.ts +0 -3
  22. package/src/groups/process.ts +0 -48
  23. package/src/index.ts +0 -13
  24. package/src/templates/bpmn-comment.ts +0 -24
  25. package/src/templates/bpmn-data-object.ts +0 -21
  26. package/src/templates/bpmn-data-store.ts +0 -19
  27. package/src/templates/bpmn-event.ts +0 -19
  28. package/src/templates/bpmn-expanded-subprocess.ts +0 -24
  29. package/src/templates/bpmn-flow.ts +0 -23
  30. package/src/templates/bpmn-gateway.ts +0 -19
  31. package/src/templates/bpmn-group.ts +0 -20
  32. package/src/templates/bpmn-lane.ts +0 -20
  33. package/src/templates/bpmn-message.ts +0 -21
  34. package/src/templates/bpmn-pool.ts +0 -18
  35. package/src/templates/bpmn-subprocess.ts +0 -18
  36. package/src/templates/bpmn-task.ts +0 -18
  37. package/src/templates/index.ts +0 -31
  38. package/tsconfig.json +0 -24
  39. package/tsconfig.tsbuildinfo +0 -1
@@ -1,323 +0,0 @@
1
- import { Component, ComponentNature, Properties } from '@hatiolab/things-scene'
2
-
3
- import BPMNControlBase from './base/bpmn-control-base'
4
-
5
- const NATURE: ComponentNature = {
6
- mutable: false,
7
- resizable: true,
8
- rotatable: false,
9
- properties: [
10
- {
11
- type: 'checkbox',
12
- label: 'loop',
13
- name: 'loop'
14
- },
15
- {
16
- type: 'checkbox',
17
- label: 'multi-instance',
18
- name: 'multiInstance'
19
- },
20
- {
21
- type: 'checkbox',
22
- label: 'compensation',
23
- name: 'compensation'
24
- },
25
- {
26
- type: 'checkbox',
27
- label: 'adhoc',
28
- name: 'adhoc'
29
- },
30
- {
31
- type: 'checkbox',
32
- label: 'call-activity',
33
- name: 'callActivity'
34
- },
35
- {
36
- type: 'checkbox',
37
- label: 'transaction',
38
- name: 'transaction'
39
- },
40
- {
41
- type: 'checkbox',
42
- label: 'interrupting',
43
- name: 'interrupting'
44
- },
45
- {
46
- type: 'select',
47
- label: 'trigger-event',
48
- name: 'triggerEvent',
49
- property: {
50
- options: [
51
- {
52
- display: '',
53
- value: ''
54
- },
55
- {
56
- display: 'message',
57
- value: 'message'
58
- },
59
- {
60
- display: 'timer',
61
- value: 'timer'
62
- },
63
- {
64
- display: 'error',
65
- value: 'error'
66
- },
67
- {
68
- display: 'escalation',
69
- value: 'escalation'
70
- },
71
- {
72
- display: 'cancel',
73
- value: 'cancel'
74
- },
75
- {
76
- display: 'compensation',
77
- value: 'compensation'
78
- },
79
- {
80
- display: 'conditional',
81
- value: 'conditional'
82
- },
83
- {
84
- display: 'link',
85
- value: 'link'
86
- },
87
- {
88
- display: 'signal',
89
- value: 'signal'
90
- },
91
- {
92
- display: 'terminate',
93
- value: 'terminate'
94
- },
95
- {
96
- display: 'multiple',
97
- value: 'multiple'
98
- },
99
- {
100
- display: 'parallel multiple',
101
- value: 'parallel-multiple'
102
- }
103
- ]
104
- }
105
- },
106
- {
107
- // TODO this property might be an array
108
- type: 'select',
109
- label: 'boundary-event',
110
- name: 'boundaryEvent',
111
- property: {
112
- options: [
113
- {
114
- display: '',
115
- value: ''
116
- },
117
- {
118
- display: 'message',
119
- value: 'message'
120
- },
121
- {
122
- display: 'timer',
123
- value: 'timer'
124
- },
125
- {
126
- display: 'error',
127
- value: 'error'
128
- },
129
- {
130
- display: 'escalation',
131
- value: 'escalation'
132
- },
133
- {
134
- display: 'cancel',
135
- value: 'cancel'
136
- },
137
- {
138
- display: 'compensation',
139
- value: 'compensation'
140
- },
141
- {
142
- display: 'conditional',
143
- value: 'conditional'
144
- },
145
- {
146
- display: 'link',
147
- value: 'link'
148
- },
149
- {
150
- display: 'signal',
151
- value: 'signal'
152
- },
153
- {
154
- display: 'terminate',
155
- value: 'terminate'
156
- },
157
- {
158
- display: 'multiple',
159
- value: 'multiple'
160
- },
161
- {
162
- display: 'parallel multiple',
163
- value: 'parallel-multiple'
164
- }
165
- ]
166
- }
167
- }
168
- ],
169
- help: '/bpmn/subprocess/subprocess'
170
- }
171
-
172
- export default class BPMNSubprocess extends BPMNControlBase {
173
- private markerImages?: HTMLImageElement[]
174
-
175
- static get nature() {
176
- return NATURE
177
- }
178
-
179
- render(ctx: CanvasRenderingContext2D) {
180
- var { left, top, width, height } = this.bounds
181
- const { callActivity, interrupting, transaction } = this.state
182
-
183
- ctx.translate(left, top)
184
- ctx.beginPath()
185
-
186
- var radius = 10
187
-
188
- ctx.moveTo(radius, 0)
189
- ctx.arcTo(width, 0, width, height, radius)
190
- ctx.arcTo(width, height, 0, height, radius)
191
- ctx.arcTo(0, height, 0, 0, radius)
192
- ctx.arcTo(0, 0, width, 0, radius)
193
-
194
- if (transaction) {
195
- const LINEGAP = 3
196
- radius -= LINEGAP
197
-
198
- ctx.moveTo(radius + LINEGAP, LINEGAP)
199
- ctx.arcTo(width - LINEGAP, LINEGAP, width - LINEGAP, height - LINEGAP, radius)
200
- ctx.arcTo(width - LINEGAP, height - LINEGAP, LINEGAP, height, radius)
201
- ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius)
202
- ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius)
203
- }
204
-
205
- ctx.translate(-left, -top)
206
-
207
- this.drawFill(ctx)
208
-
209
- if (callActivity) {
210
- this.drawStroke(ctx, { lineWidth: 5 })
211
- } else {
212
- this.drawStroke(ctx, {
213
- lineWidth: transaction ? 1 : 2,
214
- lineDash: interrupting ? 'dash' : 'solid'
215
- })
216
- }
217
-
218
- ctx.beginPath()
219
-
220
- const images = this.getMarkerImages() || []
221
- const start = left + (width - images.length * 16) / 2
222
-
223
- images.forEach((image, index) => {
224
- this.drawImage(ctx, image, start + index * 16, top + height - 16, 16, 16)
225
- })
226
- }
227
-
228
- onchange(after: Properties, before: Properties) {
229
- if (['loop', 'multiInstance', 'adhoc', 'compensation', 'strokeStyle'].find(prop => prop in after)) {
230
- delete this.markerImages
231
- }
232
- }
233
-
234
- getMarkerImages(): HTMLImageElement[] | null | undefined {
235
- if (!this.markerImages) {
236
- const { strokeStyle } = this.state
237
-
238
- this.markerImages = Object.keys(MARKERS)
239
- .filter(key => key === 'subprocess' || this.state[key])
240
- .map(key => {
241
- let image = new Image()
242
- image.src =
243
- 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(MARKERS[key].replace(/{{strokeColor}}/g, strokeStyle))
244
- return image
245
- })
246
- }
247
-
248
- return this.markerImages
249
- }
250
- }
251
-
252
- Component.register('bpmn-subprocess', BPMNSubprocess)
253
-
254
- const MARKERS: { [type: string]: string } = {
255
- loop: `
256
- <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"
257
- viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
258
- <style type="text/css">
259
- .st0{fill:{{strokeColor}};}
260
- </style>
261
- <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
262
- s3,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"/>
263
- </svg>
264
- `,
265
- multiInstance: `
266
- <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"
267
- viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
268
- <style type="text/css">
269
- .st0{fill:{{strokeColor}};}
270
- </style>
271
- <g>
272
- <rect x="5.5" y="1.9" class="st0" width="3.3" height="25.3"/>
273
- <rect x="15.9" y="1.9" class="st0" width="3.3" height="25.3"/>
274
- <rect x="26.2" y="1.9" class="st0" width="3.3" height="25.3"/>
275
- </g>
276
- </svg>
277
- `,
278
- compensation: `
279
- <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"
280
- viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
281
- <style type="text/css">
282
- .st0{fill:{{strokeColor}};}
283
- </style>
284
- <g>
285
- <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
286
- L5.5,14.7L5.5,14.7z"/>
287
- </g>
288
- <g>
289
- <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
290
- L16.9,14.7L16.9,14.7L16.9,14.7z"/>
291
- </g>
292
- </svg>
293
- `,
294
- subprocess: `
295
- <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"
296
- viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
297
- <style type="text/css">
298
- .st0{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-miterlimit:10;}
299
- .st1{fill:{{strokeColor}};}
300
- </style>
301
- <rect x="5.5" y="2.5" class="st0" width="24" height="24"/>
302
- <g>
303
- <g>
304
- <rect x="16.4" y="6" class="st1" width="2.1" height="17"/>
305
- </g>
306
- <g>
307
- <rect x="9" y="13.4" class="st1" width="17" height="2.1"/>
308
- </g>
309
- </g>
310
- </svg>
311
- `,
312
- adhoc: `
313
- <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"
314
- viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
315
- <style type="text/css">
316
- .st0{fill:{{strokeColor}};}
317
- </style>
318
- <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
319
- c-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
320
- c2,0,3.8-0.6,5.3-1.8v-6.9C29.4,10.1,29.3,10.2,29.2,10.3z"/>
321
- </svg>
322
- `
323
- }