@camunda/task-testing 0.2.3 → 0.2.4
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/LICENSE +20 -20
- package/README.md +34 -34
- package/dist/index.js +276 -321
- package/dist/index.js.map +1 -1
- package/package.json +91 -91
package/dist/index.js
CHANGED
|
@@ -33,8 +33,8 @@ class ElementConfig extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
33
33
|
this._injector = injector;
|
|
34
34
|
this._elementVariables = elementVariables;
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* @type {import('./types').Config}
|
|
36
|
+
/**
|
|
37
|
+
* @type {import('./types').Config}
|
|
38
38
|
*/
|
|
39
39
|
this._config = {
|
|
40
40
|
...DEFAULT_CONFIG,
|
|
@@ -108,9 +108,9 @@ class ElementConfig extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
108
108
|
return this._config.input[element.id];
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/**
|
|
112
|
-
* @param {import('./types').Element} element
|
|
113
|
-
* @returns {import('./types').ElementOutput}
|
|
111
|
+
/**
|
|
112
|
+
* @param {import('./types').Element} element
|
|
113
|
+
* @returns {import('./types').ElementOutput}
|
|
114
114
|
*/
|
|
115
115
|
getOutputConfigForElement(element) {
|
|
116
116
|
if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.isAny)(element, SUPPORTED_ELEMENT_TYPES)) {
|
|
@@ -127,12 +127,12 @@ class ElementConfig extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
/**
|
|
131
|
-
* Get input parameters from a BPMN element.
|
|
132
|
-
*
|
|
133
|
-
* @param {import('./types').Element} element
|
|
134
|
-
*
|
|
135
|
-
* @returns {import('./types').ModdleElement[]}
|
|
130
|
+
/**
|
|
131
|
+
* Get input parameters from a BPMN element.
|
|
132
|
+
*
|
|
133
|
+
* @param {import('./types').Element} element
|
|
134
|
+
*
|
|
135
|
+
* @returns {import('./types').ModdleElement[]}
|
|
136
136
|
*/
|
|
137
137
|
function getInputParameters(element) {
|
|
138
138
|
const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(element);
|
|
@@ -151,20 +151,20 @@ function getInputParameters(element) {
|
|
|
151
151
|
return ioMapping.get('inputParameters');
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
/**
|
|
155
|
-
* Unflatten an object with dot notation keys into a nested object.
|
|
156
|
-
*
|
|
157
|
-
* Example:
|
|
158
|
-
*
|
|
159
|
-
* ```
|
|
160
|
-
* unflatten({
|
|
161
|
-
* 'foo.bar': 'baz'
|
|
162
|
-
* }) // returns { foo: { bar: 'baz' } }
|
|
163
|
-
* ```
|
|
164
|
-
*
|
|
165
|
-
* @param {Object} obj
|
|
166
|
-
*
|
|
167
|
-
* @returns {Object}
|
|
154
|
+
/**
|
|
155
|
+
* Unflatten an object with dot notation keys into a nested object.
|
|
156
|
+
*
|
|
157
|
+
* Example:
|
|
158
|
+
*
|
|
159
|
+
* ```
|
|
160
|
+
* unflatten({
|
|
161
|
+
* 'foo.bar': 'baz'
|
|
162
|
+
* }) // returns { foo: { bar: 'baz' } }
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* @param {Object} obj
|
|
166
|
+
*
|
|
167
|
+
* @returns {Object}
|
|
168
168
|
*/
|
|
169
169
|
function unflatten(obj) {
|
|
170
170
|
const result = {};
|
|
@@ -183,16 +183,16 @@ function unflatten(obj) {
|
|
|
183
183
|
return result;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
/**
|
|
187
|
-
* Create default input config for a BPMN element.
|
|
188
|
-
*
|
|
189
|
-
* @todo Only simple input parameter sources can be handled until
|
|
190
|
-
* https://github.com/bpmn-io/internal-docs/issues/1218 is implemented.
|
|
191
|
-
*
|
|
192
|
-
* @param {import('./types').Element} element
|
|
193
|
-
* @param {import('./types').Variable[]} variablesForElement
|
|
194
|
-
*
|
|
195
|
-
* @returns {string}
|
|
186
|
+
/**
|
|
187
|
+
* Create default input config for a BPMN element.
|
|
188
|
+
*
|
|
189
|
+
* @todo Only simple input parameter sources can be handled until
|
|
190
|
+
* https://github.com/bpmn-io/internal-docs/issues/1218 is implemented.
|
|
191
|
+
*
|
|
192
|
+
* @param {import('./types').Element} element
|
|
193
|
+
* @param {import('./types').Variable[]} variablesForElement
|
|
194
|
+
*
|
|
195
|
+
* @returns {string}
|
|
196
196
|
*/
|
|
197
197
|
function createDefaultInputConfig(element, variablesForElement) {
|
|
198
198
|
const inputParameters = getInputParameters(element);
|
|
@@ -234,18 +234,18 @@ function createDefaultInputConfig(element, variablesForElement) {
|
|
|
234
234
|
return JSON.stringify(unflatten(foundVariables), null, 2);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
/**
|
|
238
|
-
* Get the name from a source string.
|
|
239
|
-
*
|
|
240
|
-
* @example
|
|
241
|
-
*
|
|
242
|
-
* getNameFromSource('=foo') // 'foo'
|
|
243
|
-
* getNameFromSource('=foo + bar') // null
|
|
244
|
-
* getNameFromSource('= 1 + 2') // null
|
|
245
|
-
*
|
|
246
|
-
* @param {string} source
|
|
247
|
-
*
|
|
248
|
-
* @returns {string|null}
|
|
237
|
+
/**
|
|
238
|
+
* Get the name from a source string.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
*
|
|
242
|
+
* getNameFromSource('=foo') // 'foo'
|
|
243
|
+
* getNameFromSource('=foo + bar') // null
|
|
244
|
+
* getNameFromSource('= 1 + 2') // null
|
|
245
|
+
*
|
|
246
|
+
* @param {string} source
|
|
247
|
+
*
|
|
248
|
+
* @returns {string|null}
|
|
249
249
|
*/
|
|
250
250
|
function getNameFromSource(source) {
|
|
251
251
|
if (source && isFeel(source)) {
|
|
@@ -257,36 +257,36 @@ function getNameFromSource(source) {
|
|
|
257
257
|
return null;
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
/**
|
|
261
|
-
* Check if a source string is a FEEL expression.
|
|
262
|
-
*
|
|
263
|
-
* @example
|
|
264
|
-
*
|
|
265
|
-
* isFeel('=foo') // true
|
|
266
|
-
* isFeel('= 1 + 2') // true
|
|
267
|
-
* isFeel('foo') // false
|
|
268
|
-
*
|
|
269
|
-
* @param {string} source
|
|
270
|
-
*
|
|
271
|
-
* @returns {boolean}
|
|
260
|
+
/**
|
|
261
|
+
* Check if a source string is a FEEL expression.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
*
|
|
265
|
+
* isFeel('=foo') // true
|
|
266
|
+
* isFeel('= 1 + 2') // true
|
|
267
|
+
* isFeel('foo') // false
|
|
268
|
+
*
|
|
269
|
+
* @param {string} source
|
|
270
|
+
*
|
|
271
|
+
* @returns {boolean}
|
|
272
272
|
*/
|
|
273
273
|
function isFeel(source) {
|
|
274
274
|
return !!source && source.startsWith('=');
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
/**
|
|
278
|
-
* Check if a source string is a boolean FEEL expression.
|
|
279
|
-
*
|
|
280
|
-
* @example
|
|
281
|
-
*
|
|
282
|
-
* isBoolean('=true') // true
|
|
283
|
-
* isBoolean('= false') // true
|
|
284
|
-
* isBoolean('=foo') // false
|
|
285
|
-
* isBoolean('=1 + 2') // false
|
|
286
|
-
*
|
|
287
|
-
* @param {string} source
|
|
288
|
-
*
|
|
289
|
-
* @return {boolean}
|
|
277
|
+
/**
|
|
278
|
+
* Check if a source string is a boolean FEEL expression.
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
*
|
|
282
|
+
* isBoolean('=true') // true
|
|
283
|
+
* isBoolean('= false') // true
|
|
284
|
+
* isBoolean('=foo') // false
|
|
285
|
+
* isBoolean('=1 + 2') // false
|
|
286
|
+
*
|
|
287
|
+
* @param {string} source
|
|
288
|
+
*
|
|
289
|
+
* @return {boolean}
|
|
290
290
|
*/
|
|
291
291
|
function isBoolean(source) {
|
|
292
292
|
return !!source && /^=\s*(true|false)\s*$/i.test(source);
|
|
@@ -352,33 +352,33 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
352
352
|
/* harmony export */ });
|
|
353
353
|
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! events */ "./node_modules/events/events.js");
|
|
354
354
|
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);
|
|
355
|
-
/**
|
|
356
|
-
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
357
|
-
* under one or more contributor license agreements. See the NOTICE file
|
|
358
|
-
* distributed with this work for additional information regarding copyright
|
|
359
|
-
* ownership.
|
|
360
|
-
*
|
|
361
|
-
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
362
|
-
* except in compliance with the MIT License.
|
|
355
|
+
/**
|
|
356
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
357
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
358
|
+
* distributed with this work for additional information regarding copyright
|
|
359
|
+
* ownership.
|
|
360
|
+
*
|
|
361
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
362
|
+
* except in compliance with the MIT License.
|
|
363
363
|
*/
|
|
364
364
|
|
|
365
365
|
|
|
366
366
|
const INTERVAL_MS = 1000;
|
|
367
367
|
|
|
368
|
-
/**
|
|
369
|
-
* @import { TaskExecutionApi, TaskExecutionResult, TaskExecutionError, TaskExecutionStatus } from './types';
|
|
368
|
+
/**
|
|
369
|
+
* @import { TaskExecutionApi, TaskExecutionResult, TaskExecutionError, TaskExecutionStatus } from './types';
|
|
370
370
|
*/
|
|
371
371
|
|
|
372
|
-
/**
|
|
373
|
-
* Emits:
|
|
374
|
-
* - `taskExecution.status.changed` with one of {@link TaskExecutionStatus}
|
|
375
|
-
* - `taskExecution.finished` with {@link TaskExecutionResult}
|
|
376
|
-
* - `taskExecution.error` with {@link TaskExecutionError}
|
|
372
|
+
/**
|
|
373
|
+
* Emits:
|
|
374
|
+
* - `taskExecution.status.changed` with one of {@link TaskExecutionStatus}
|
|
375
|
+
* - `taskExecution.finished` with {@link TaskExecutionResult}
|
|
376
|
+
* - `taskExecution.error` with {@link TaskExecutionError}
|
|
377
377
|
*/
|
|
378
378
|
class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
379
|
-
/**
|
|
380
|
-
* @param {Object} injector
|
|
381
|
-
* @param {TaskExecutionApi} api
|
|
379
|
+
/**
|
|
380
|
+
* @param {Object} injector
|
|
381
|
+
* @param {TaskExecutionApi} api
|
|
382
382
|
*/
|
|
383
383
|
constructor(injector, api) {
|
|
384
384
|
super();
|
|
@@ -391,21 +391,18 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
391
391
|
this._status = 'idle';
|
|
392
392
|
const eventBus = injector.get('eventBus');
|
|
393
393
|
eventBus.on(['selection.changed', 'commandStack.changed'], () => {
|
|
394
|
-
if (this._status !== 'idle') {
|
|
395
|
-
console.log('Interrupting task execution in TaskExecution');
|
|
396
|
-
this.emit('taskExecution.interrupted');
|
|
397
|
-
}
|
|
398
394
|
this.cancelTaskExecution();
|
|
395
|
+
this.emit('taskExecution.interrupted');
|
|
399
396
|
});
|
|
400
397
|
}
|
|
401
398
|
|
|
402
|
-
/**
|
|
403
|
-
* Start task execution.
|
|
404
|
-
*
|
|
405
|
-
* @param {string} elementId
|
|
406
|
-
* @param {Object} variables
|
|
407
|
-
*
|
|
408
|
-
* @returns {Promise<void>}
|
|
399
|
+
/**
|
|
400
|
+
* Start task execution.
|
|
401
|
+
*
|
|
402
|
+
* @param {string} elementId
|
|
403
|
+
* @param {Object} variables
|
|
404
|
+
*
|
|
405
|
+
* @returns {Promise<void>}
|
|
409
406
|
*/
|
|
410
407
|
async executeTask(elementId, variables) {
|
|
411
408
|
this._changeStatus('deploying');
|
|
@@ -499,8 +496,8 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
499
496
|
this._interval = setInterval(intervalCallback, INTERVAL_MS);
|
|
500
497
|
}
|
|
501
498
|
|
|
502
|
-
/**
|
|
503
|
-
* Cancel current task execution, clean up and change status to `idle`.
|
|
499
|
+
/**
|
|
500
|
+
* Cancel current task execution, clean up and change status to `idle`.
|
|
504
501
|
*/
|
|
505
502
|
async cancelTaskExecution() {
|
|
506
503
|
// TODO: Proper clean up:
|
|
@@ -514,11 +511,11 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
514
511
|
this._changeStatus('idle');
|
|
515
512
|
}
|
|
516
513
|
|
|
517
|
-
/**
|
|
518
|
-
* Emit `taskExecution.error` event.
|
|
519
|
-
*
|
|
520
|
-
* @param {string} message
|
|
521
|
-
* @param {any} [response]
|
|
514
|
+
/**
|
|
515
|
+
* Emit `taskExecution.error` event.
|
|
516
|
+
*
|
|
517
|
+
* @param {string} message
|
|
518
|
+
* @param {any} [response]
|
|
522
519
|
*/
|
|
523
520
|
_emitError(message, response) {
|
|
524
521
|
/** @type {import('./types').TaskExecutionError} */
|
|
@@ -539,12 +536,12 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
539
536
|
}
|
|
540
537
|
}
|
|
541
538
|
|
|
542
|
-
/**
|
|
543
|
-
* Get the process ID from the deployment response.
|
|
544
|
-
*
|
|
545
|
-
* @param {import('./types').DeploymentResponse} [response]
|
|
546
|
-
*
|
|
547
|
-
* @returns {string|null} The process ID or null if not found.
|
|
539
|
+
/**
|
|
540
|
+
* Get the process ID from the deployment response.
|
|
541
|
+
*
|
|
542
|
+
* @param {import('./types').DeploymentResponse} [response]
|
|
543
|
+
*
|
|
544
|
+
* @returns {string|null} The process ID or null if not found.
|
|
548
545
|
*/
|
|
549
546
|
function getProcessId(response) {
|
|
550
547
|
if (!response) {
|
|
@@ -561,12 +558,12 @@ function getProcessId(response) {
|
|
|
561
558
|
return null;
|
|
562
559
|
}
|
|
563
560
|
|
|
564
|
-
/**
|
|
565
|
-
* Get the process instance key from the response.
|
|
566
|
-
*
|
|
567
|
-
* @param {import('./types').StartInstanceResponse} [response]
|
|
568
|
-
*
|
|
569
|
-
* @returns {string|null} The process instance key or null if not found.
|
|
561
|
+
/**
|
|
562
|
+
* Get the process instance key from the response.
|
|
563
|
+
*
|
|
564
|
+
* @param {import('./types').StartInstanceResponse} [response]
|
|
565
|
+
*
|
|
566
|
+
* @returns {string|null} The process instance key or null if not found.
|
|
570
567
|
*/
|
|
571
568
|
function getProcessInstanceKey(response) {
|
|
572
569
|
if (!response) {
|
|
@@ -770,21 +767,21 @@ function InputEditor({
|
|
|
770
767
|
value
|
|
771
768
|
}));
|
|
772
769
|
|
|
773
|
-
/**
|
|
774
|
-
* @type {import('@codemirror/autocomplete').Completion[]}
|
|
770
|
+
/**
|
|
771
|
+
* @type {import('@codemirror/autocomplete').Completion[]}
|
|
775
772
|
*/
|
|
776
773
|
const result = [...variablesForElementAutocompletions, ...outputVariablesAutocompletions];
|
|
777
774
|
return result;
|
|
778
775
|
}, [allOutputs, variablesForElement]);
|
|
779
776
|
const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
780
777
|
|
|
781
|
-
/**
|
|
782
|
-
* @type {ReturnType<typeof useState<EditorView>>}
|
|
778
|
+
/**
|
|
779
|
+
* @type {ReturnType<typeof useState<EditorView>>}
|
|
783
780
|
*/
|
|
784
781
|
const [editorView, setEditorView] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
785
782
|
|
|
786
|
-
/**
|
|
787
|
-
* @type {ReturnType<typeof useState<string?>>}
|
|
783
|
+
/**
|
|
784
|
+
* @type {ReturnType<typeof useState<string?>>}
|
|
788
785
|
*/
|
|
789
786
|
const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
790
787
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
@@ -892,19 +889,19 @@ function getAllOutputVariables(allOutputs) {
|
|
|
892
889
|
return allOutputVariables;
|
|
893
890
|
}
|
|
894
891
|
|
|
895
|
-
/**
|
|
896
|
-
* Get a string representation of the type of a value.
|
|
897
|
-
*
|
|
898
|
-
* @example
|
|
899
|
-
*
|
|
900
|
-
* getDetail('foo') // String
|
|
901
|
-
* getDetail(1337) // Number
|
|
902
|
-
* getDetail(true) // Boolean
|
|
903
|
-
* getDetail({}) // Object
|
|
904
|
-
*
|
|
905
|
-
* @param {any} value
|
|
906
|
-
*
|
|
907
|
-
* @return {string}
|
|
892
|
+
/**
|
|
893
|
+
* Get a string representation of the type of a value.
|
|
894
|
+
*
|
|
895
|
+
* @example
|
|
896
|
+
*
|
|
897
|
+
* getDetail('foo') // String
|
|
898
|
+
* getDetail(1337) // Number
|
|
899
|
+
* getDetail(true) // Boolean
|
|
900
|
+
* getDetail({}) // Object
|
|
901
|
+
*
|
|
902
|
+
* @param {any} value
|
|
903
|
+
*
|
|
904
|
+
* @return {string}
|
|
908
905
|
*/
|
|
909
906
|
function getDetail(value) {
|
|
910
907
|
const type = typeof value;
|
|
@@ -949,17 +946,17 @@ const TASK_EXECUTION_STATUS_LABEL = {
|
|
|
949
946
|
executing: 'Waiting for task to be completed...'
|
|
950
947
|
};
|
|
951
948
|
|
|
952
|
-
/**
|
|
953
|
-
* @param {Object} props
|
|
954
|
-
* @param {boolean} props.isConnectionConfigured
|
|
955
|
-
* @param {string} [props.configureConnectionBannerTitle]
|
|
956
|
-
* @param {string} [props.configureConnectionBannerDescription]
|
|
957
|
-
* @param {string} [props.configureConnectionLabel]
|
|
958
|
-
* @param {Function} [props.onConfigureConnection]
|
|
959
|
-
* @param {boolean} props.isTaskExecuting
|
|
960
|
-
* @param {import('../../types').ElementOutput} props.output
|
|
961
|
-
* @param {Function} props.onResetOutput
|
|
962
|
-
* @param {import('../../types').TaskExecutionStatus} props.taskExecutionStatus
|
|
949
|
+
/**
|
|
950
|
+
* @param {Object} props
|
|
951
|
+
* @param {boolean} props.isConnectionConfigured
|
|
952
|
+
* @param {string} [props.configureConnectionBannerTitle]
|
|
953
|
+
* @param {string} [props.configureConnectionBannerDescription]
|
|
954
|
+
* @param {string} [props.configureConnectionLabel]
|
|
955
|
+
* @param {Function} [props.onConfigureConnection]
|
|
956
|
+
* @param {boolean} props.isTaskExecuting
|
|
957
|
+
* @param {import('../../types').ElementOutput} props.output
|
|
958
|
+
* @param {Function} props.onResetOutput
|
|
959
|
+
* @param {import('../../types').TaskExecutionStatus} props.taskExecutionStatus
|
|
963
960
|
*/
|
|
964
961
|
function Output({
|
|
965
962
|
isConnectionConfigured,
|
|
@@ -1061,7 +1058,7 @@ function OutputBanner({
|
|
|
1061
1058
|
} : {};
|
|
1062
1059
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
|
|
1063
1060
|
title: "Task execution failed",
|
|
1064
|
-
description: `Incident: ${output.incident.
|
|
1061
|
+
description: `Incident: ${output.incident.type}`,
|
|
1065
1062
|
...action
|
|
1066
1063
|
});
|
|
1067
1064
|
}
|
|
@@ -1137,14 +1134,14 @@ function OutputVariables({
|
|
|
1137
1134
|
});
|
|
1138
1135
|
}
|
|
1139
1136
|
|
|
1140
|
-
/**
|
|
1141
|
-
*
|
|
1142
|
-
* @param {Object} props
|
|
1143
|
-
* @param {string} props.title
|
|
1144
|
-
* @param {string} props.description
|
|
1145
|
-
* @param {string} [props.actionLabel]
|
|
1146
|
-
* @param {string} [props.actionUrl]
|
|
1147
|
-
* @param {Function} [props.onActionClick]
|
|
1137
|
+
/**
|
|
1138
|
+
*
|
|
1139
|
+
* @param {Object} props
|
|
1140
|
+
* @param {string} props.title
|
|
1141
|
+
* @param {string} props.description
|
|
1142
|
+
* @param {string} [props.actionLabel]
|
|
1143
|
+
* @param {string} [props.actionUrl]
|
|
1144
|
+
* @param {Function} [props.onActionClick]
|
|
1148
1145
|
*/
|
|
1149
1146
|
function ErrorBanner({
|
|
1150
1147
|
title,
|
|
@@ -1155,33 +1152,35 @@ function ErrorBanner({
|
|
|
1155
1152
|
}) {
|
|
1156
1153
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
1157
1154
|
className: "output__error",
|
|
1158
|
-
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.
|
|
1159
|
-
className: "output__error--
|
|
1160
|
-
children:
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1155
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
1156
|
+
className: "output__error--icon",
|
|
1157
|
+
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.ErrorFilled, {})
|
|
1158
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
1159
|
+
className: "output__error--content",
|
|
1160
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
1161
|
+
className: "output__error--title",
|
|
1162
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
|
1163
|
+
children: title
|
|
1164
|
+
}), actionLabel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
|
|
1165
1165
|
href: actionUrl,
|
|
1166
1166
|
onClick: () => onActionClick(),
|
|
1167
1167
|
children: actionLabel
|
|
1168
|
+
})]
|
|
1169
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
1170
|
+
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
|
1171
|
+
children: description
|
|
1168
1172
|
})
|
|
1169
1173
|
})]
|
|
1170
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
1171
|
-
className: "output__error--content",
|
|
1172
|
-
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
|
1173
|
-
children: description
|
|
1174
|
-
})
|
|
1175
1174
|
})]
|
|
1176
1175
|
});
|
|
1177
1176
|
}
|
|
1178
1177
|
|
|
1179
|
-
/**
|
|
1180
|
-
* Print the details of an incident.
|
|
1181
|
-
*
|
|
1182
|
-
* @param {Object} incident
|
|
1183
|
-
*
|
|
1184
|
-
* @returns {string}
|
|
1178
|
+
/**
|
|
1179
|
+
* Print the details of an incident.
|
|
1180
|
+
*
|
|
1181
|
+
* @param {Object} incident
|
|
1182
|
+
*
|
|
1183
|
+
* @returns {string}
|
|
1185
1184
|
*/
|
|
1186
1185
|
function printIncident(incident) {
|
|
1187
1186
|
let text = '';
|
|
@@ -1191,16 +1190,16 @@ function printIncident(incident) {
|
|
|
1191
1190
|
return text;
|
|
1192
1191
|
}
|
|
1193
1192
|
|
|
1194
|
-
/**
|
|
1195
|
-
* Capitalize a string, adding spaces before capital letters.
|
|
1196
|
-
*
|
|
1197
|
-
* @example
|
|
1198
|
-
*
|
|
1199
|
-
* capitalize('fooBar'); // Foo Bar
|
|
1200
|
-
*
|
|
1201
|
-
* @param {string} string
|
|
1202
|
-
*
|
|
1203
|
-
* @returns {string}
|
|
1193
|
+
/**
|
|
1194
|
+
* Capitalize a string, adding spaces before capital letters.
|
|
1195
|
+
*
|
|
1196
|
+
* @example
|
|
1197
|
+
*
|
|
1198
|
+
* capitalize('fooBar'); // Foo Bar
|
|
1199
|
+
*
|
|
1200
|
+
* @param {string} string
|
|
1201
|
+
*
|
|
1202
|
+
* @returns {string}
|
|
1204
1203
|
*/
|
|
1205
1204
|
function capitalize(string) {
|
|
1206
1205
|
return string.replace(/([A-Z])/g, ' $1').replace(/^./, match => match.toUpperCase());
|
|
@@ -1239,8 +1238,8 @@ function OutputEditor({
|
|
|
1239
1238
|
}) {
|
|
1240
1239
|
const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1241
1240
|
|
|
1242
|
-
/**
|
|
1243
|
-
* @type {ReturnType<typeof useState<EditorView>>}
|
|
1241
|
+
/**
|
|
1242
|
+
* @type {ReturnType<typeof useState<EditorView>>}
|
|
1244
1243
|
*/
|
|
1245
1244
|
const [editorView, setEditorView] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
1246
1245
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
@@ -1337,21 +1336,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1337
1336
|
|
|
1338
1337
|
const NO_ELEMENT_TEXT = 'Select a task to start testing';
|
|
1339
1338
|
|
|
1340
|
-
/**
|
|
1341
|
-
* @param {Object} props
|
|
1342
|
-
* @param {Object} props.injector
|
|
1343
|
-
* @param {import('../../types').TaskExecutionApi} props.api
|
|
1344
|
-
* @param {boolean} props.isConnectionConfigured
|
|
1345
|
-
* @param {string} [props.configureConnectionBannerTitle]
|
|
1346
|
-
* @param {string} [props.configureConnectionBannerDescription]
|
|
1347
|
-
* @param {string} [props.configureConnectionLabel]
|
|
1348
|
-
* @param {Function} [props.onConfigureConnection]
|
|
1349
|
-
* @param {import('../../types').Config|undefined} [props.config]
|
|
1350
|
-
* @param {Function} [props.onConfigChanged=() => {}]
|
|
1351
|
-
* @param {string} [props.operateBaseUrl]
|
|
1352
|
-
* @param {Function} [props.
|
|
1353
|
-
* @param {Function} [props.
|
|
1354
|
-
* @param {Function} [props.onTaskExecutionInterrupted=() => {}]
|
|
1339
|
+
/**
|
|
1340
|
+
* @param {Object} props
|
|
1341
|
+
* @param {Object} props.injector
|
|
1342
|
+
* @param {import('../../types').TaskExecutionApi} props.api
|
|
1343
|
+
* @param {boolean} props.isConnectionConfigured
|
|
1344
|
+
* @param {string} [props.configureConnectionBannerTitle]
|
|
1345
|
+
* @param {string} [props.configureConnectionBannerDescription]
|
|
1346
|
+
* @param {string} [props.configureConnectionLabel]
|
|
1347
|
+
* @param {Function} [props.onConfigureConnection]
|
|
1348
|
+
* @param {import('../../types').Config|undefined} [props.config]
|
|
1349
|
+
* @param {Function} [props.onConfigChanged=() => {}]
|
|
1350
|
+
* @param {string} [props.operateBaseUrl]
|
|
1351
|
+
* @param {Function} [props.onTaskExecution=() => {}]
|
|
1352
|
+
* @param {Function} [props.onTaskExecutionInterrupted=() => {}]
|
|
1355
1353
|
*/
|
|
1356
1354
|
function TaskTesting({
|
|
1357
1355
|
injector,
|
|
@@ -1364,41 +1362,40 @@ function TaskTesting({
|
|
|
1364
1362
|
config,
|
|
1365
1363
|
onConfigChanged = () => {},
|
|
1366
1364
|
operateBaseUrl,
|
|
1367
|
-
|
|
1368
|
-
onTaskExecutionFinished = () => {},
|
|
1365
|
+
onTaskExecution = () => {},
|
|
1369
1366
|
onTaskExecutionInterrupted = () => {}
|
|
1370
1367
|
}) {
|
|
1371
|
-
/**
|
|
1372
|
-
* @type {React.RefObject<ElementVariables?>}
|
|
1368
|
+
/**
|
|
1369
|
+
* @type {React.RefObject<ElementVariables?>}
|
|
1373
1370
|
*/
|
|
1374
1371
|
const elementVariablesRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1375
1372
|
|
|
1376
|
-
/**
|
|
1377
|
-
* @type {React.RefObject<ElementConfig?>}
|
|
1373
|
+
/**
|
|
1374
|
+
* @type {React.RefObject<ElementConfig?>}
|
|
1378
1375
|
*/
|
|
1379
1376
|
const elementConfigRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1380
1377
|
const [variablesForElement, setVariablesForElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
|
1381
1378
|
|
|
1382
|
-
/**
|
|
1383
|
-
* @type {ReturnType<typeof useState<import('../../types').TaskExecutionStatus>>}
|
|
1379
|
+
/**
|
|
1380
|
+
* @type {ReturnType<typeof useState<import('../../types').TaskExecutionStatus>>}
|
|
1384
1381
|
*/
|
|
1385
1382
|
const [taskExecutionStatus, setTaskExecutionStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
1386
1383
|
|
|
1387
|
-
/**
|
|
1388
|
-
* @type {ReturnType<typeof useState<string>>}
|
|
1384
|
+
/**
|
|
1385
|
+
* @type {ReturnType<typeof useState<string>>}
|
|
1389
1386
|
*/
|
|
1390
1387
|
const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
1391
1388
|
|
|
1392
|
-
/**
|
|
1393
|
-
* @type {ReturnType<typeof useState<import('../../types').ElementOutput>>}
|
|
1389
|
+
/**
|
|
1390
|
+
* @type {ReturnType<typeof useState<import('../../types').ElementOutput>>}
|
|
1394
1391
|
*/
|
|
1395
1392
|
const [output, setOutput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
1396
1393
|
const [allOutputs, setAllOutputs] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
|
|
1397
1394
|
const [inputError, setInputError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
1398
1395
|
const element = (0,_hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_4__.useSelectedElement)(injector);
|
|
1399
1396
|
|
|
1400
|
-
/**
|
|
1401
|
-
* @type {React.RefObject<TaskExecution?>}
|
|
1397
|
+
/**
|
|
1398
|
+
* @type {React.RefObject<TaskExecution?>}
|
|
1402
1399
|
*/
|
|
1403
1400
|
const taskExecutionRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1404
1401
|
|
|
@@ -1477,9 +1474,9 @@ function TaskTesting({
|
|
|
1477
1474
|
});
|
|
1478
1475
|
};
|
|
1479
1476
|
|
|
1480
|
-
/**
|
|
1481
|
-
* @param {import('../../types').TaskExecutionStatus} status
|
|
1482
|
-
* @param {string} [processInstanceKey]
|
|
1477
|
+
/**
|
|
1478
|
+
* @param {import('../../types').TaskExecutionStatus} status
|
|
1479
|
+
* @param {string} [processInstanceKey]
|
|
1483
1480
|
*/
|
|
1484
1481
|
const handleStatusChange = (status, processInstanceKey) => {
|
|
1485
1482
|
setTaskExecutionStatus(status);
|
|
@@ -1502,22 +1499,17 @@ function TaskTesting({
|
|
|
1502
1499
|
...output,
|
|
1503
1500
|
operateUrl
|
|
1504
1501
|
});
|
|
1505
|
-
onTaskExecutionFinished(element, output);
|
|
1506
|
-
};
|
|
1507
|
-
const handleInterrupted = () => {
|
|
1508
|
-
console.log('interrrrrrupted');
|
|
1509
|
-
onTaskExecutionInterrupted();
|
|
1510
1502
|
};
|
|
1511
1503
|
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur = taskExecutionRef.current) === null || _taskExecutionRef$cur === void 0 || _taskExecutionRef$cur.on('taskExecution.finished', handleFinished);
|
|
1512
1504
|
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur2 = taskExecutionRef.current) === null || _taskExecutionRef$cur2 === void 0 || _taskExecutionRef$cur2.on('taskExecution.status.changed', handleStatusChange);
|
|
1513
1505
|
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur3 = taskExecutionRef.current) === null || _taskExecutionRef$cur3 === void 0 || _taskExecutionRef$cur3.on('taskExecution.error', handleError);
|
|
1514
|
-
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur4 = taskExecutionRef.current) === null || _taskExecutionRef$cur4 === void 0 || _taskExecutionRef$cur4.on('taskExecution.interrupted',
|
|
1506
|
+
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur4 = taskExecutionRef.current) === null || _taskExecutionRef$cur4 === void 0 || _taskExecutionRef$cur4.on('taskExecution.interrupted', () => onTaskExecutionInterrupted());
|
|
1515
1507
|
return () => {
|
|
1516
1508
|
if (taskExecutionRef.current) {
|
|
1517
1509
|
taskExecutionRef.current.off('taskExecution.finished', handleFinished);
|
|
1518
1510
|
taskExecutionRef.current.off('taskExecution.status.changed', handleStatusChange);
|
|
1519
1511
|
taskExecutionRef.current.off('taskExecution.error', handleError);
|
|
1520
|
-
taskExecutionRef.current.off('taskExecution.interrupted',
|
|
1512
|
+
taskExecutionRef.current.off('taskExecution.interrupted', () => onTaskExecutionInterrupted());
|
|
1521
1513
|
}
|
|
1522
1514
|
};
|
|
1523
1515
|
}, [element]);
|
|
@@ -1551,17 +1543,14 @@ function TaskTesting({
|
|
|
1551
1543
|
if (!isConnectionConfigured || inputError || !element || !taskExecutionRef.current || !elementConfigRef.current) {
|
|
1552
1544
|
return;
|
|
1553
1545
|
}
|
|
1554
|
-
onTaskExecutionStarted(element);
|
|
1555
1546
|
const inputConfig = await elementConfigRef.current.getInputConfigForElement(element);
|
|
1556
1547
|
elementConfigRef.current.setOutputConfigForElement(element, null);
|
|
1557
1548
|
taskExecutionRef.current.executeTask(element.id, JSON.parse(inputConfig));
|
|
1549
|
+
onTaskExecution();
|
|
1558
1550
|
};
|
|
1559
1551
|
const handleCancelTaskExecution = () => {
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
if (output !== null && output !== void 0 && output.operateUrl && Object.keys(output).length === 1) {
|
|
1563
|
-
var _elementConfigRef$cur7;
|
|
1564
|
-
elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur7 = elementConfigRef.current) === null || _elementConfigRef$cur7 === void 0 || _elementConfigRef$cur7.setOutputConfigForElement(element, null);
|
|
1552
|
+
if (taskExecutionRef.current) {
|
|
1553
|
+
taskExecutionRef.current.cancelTaskExecution();
|
|
1565
1554
|
}
|
|
1566
1555
|
};
|
|
1567
1556
|
const handleResetOutput = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
|
|
@@ -1601,11 +1590,8 @@ function TaskTesting({
|
|
|
1601
1590
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
|
|
1602
1591
|
className: "task-testing__container--header",
|
|
1603
1592
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
|
|
1604
|
-
className: "task-
|
|
1605
|
-
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
|
|
1606
|
-
className: "task-type",
|
|
1607
|
-
children: (0,_utils_element__WEBPACK_IMPORTED_MODULE_10__.getType)(element)
|
|
1608
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
|
|
1593
|
+
className: "task-name",
|
|
1594
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Chemistry, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
|
|
1609
1595
|
children: (0,_utils_element__WEBPACK_IMPORTED_MODULE_10__.getName)(element)
|
|
1610
1596
|
})]
|
|
1611
1597
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tooltip, {
|
|
@@ -1782,11 +1768,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1782
1768
|
|
|
1783
1769
|
const SUPPORTED_ELEMENT_TYPES = ['bpmn:Task'];
|
|
1784
1770
|
|
|
1785
|
-
/**
|
|
1786
|
-
* Get currently selected BPMN element, if it is a single `bpmn:Task`.
|
|
1787
|
-
*
|
|
1788
|
-
* @param {Object} injector
|
|
1789
|
-
* @return {Object|null} Selected BPMN element or null
|
|
1771
|
+
/**
|
|
1772
|
+
* Get currently selected BPMN element, if it is a single `bpmn:Task`.
|
|
1773
|
+
*
|
|
1774
|
+
* @param {Object} injector
|
|
1775
|
+
* @return {Object|null} Selected BPMN element or null
|
|
1790
1776
|
*/
|
|
1791
1777
|
function useSelectedElement(injector) {
|
|
1792
1778
|
const [selectedElement, setSelectedElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
@@ -1884,21 +1870,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1884
1870
|
|
|
1885
1871
|
|
|
1886
1872
|
|
|
1887
|
-
/**
|
|
1888
|
-
* @typedef {import('@codemirror/autocomplete').Completion} Completion
|
|
1889
|
-
* @typedef {import('@codemirror/autocomplete').CompletionContext} CompletionContext
|
|
1890
|
-
* @typedef {import('@codemirror/autocomplete').CompletionResult} CompletionResult
|
|
1873
|
+
/**
|
|
1874
|
+
* @typedef {import('@codemirror/autocomplete').Completion} Completion
|
|
1875
|
+
* @typedef {import('@codemirror/autocomplete').CompletionContext} CompletionContext
|
|
1876
|
+
* @typedef {import('@codemirror/autocomplete').CompletionResult} CompletionResult
|
|
1891
1877
|
*/
|
|
1892
1878
|
|
|
1893
|
-
/**
|
|
1894
|
-
* @param {Completion[]} variables
|
|
1879
|
+
/**
|
|
1880
|
+
* @param {Completion[]} variables
|
|
1895
1881
|
*/
|
|
1896
1882
|
function getAutocompletionExtensions(variables) {
|
|
1897
1883
|
return [autoCompletionExtension(variables), startCompletionExtension()];
|
|
1898
1884
|
}
|
|
1899
1885
|
|
|
1900
|
-
/**
|
|
1901
|
-
* @param {Completion[]} variables
|
|
1886
|
+
/**
|
|
1887
|
+
* @param {Completion[]} variables
|
|
1902
1888
|
*/
|
|
1903
1889
|
function autoCompletionExtension(variables) {
|
|
1904
1890
|
return (0,_codemirror_autocomplete__WEBPACK_IMPORTED_MODULE_0__.autocompletion)({
|
|
@@ -1906,8 +1892,8 @@ function autoCompletionExtension(variables) {
|
|
|
1906
1892
|
});
|
|
1907
1893
|
}
|
|
1908
1894
|
|
|
1909
|
-
/**
|
|
1910
|
-
* Trigger autocompletion when the user goes into a new line.
|
|
1895
|
+
/**
|
|
1896
|
+
* Trigger autocompletion when the user goes into a new line.
|
|
1911
1897
|
*/
|
|
1912
1898
|
function startCompletionExtension() {
|
|
1913
1899
|
return _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.updateListener.of(update => {
|
|
@@ -1931,11 +1917,11 @@ function startCompletionExtension() {
|
|
|
1931
1917
|
});
|
|
1932
1918
|
}
|
|
1933
1919
|
|
|
1934
|
-
/**
|
|
1935
|
-
* @param {CompletionContext} context
|
|
1936
|
-
* @param {Array} variables
|
|
1937
|
-
*
|
|
1938
|
-
* @returns {CompletionResult | null}
|
|
1920
|
+
/**
|
|
1921
|
+
* @param {CompletionContext} context
|
|
1922
|
+
* @param {Array} variables
|
|
1923
|
+
*
|
|
1924
|
+
* @returns {CompletionResult | null}
|
|
1939
1925
|
*/
|
|
1940
1926
|
function autocomplete(context, variables) {
|
|
1941
1927
|
const {
|
|
@@ -2026,13 +2012,13 @@ function autocomplete(context, variables) {
|
|
|
2026
2012
|
};
|
|
2027
2013
|
}
|
|
2028
2014
|
|
|
2029
|
-
/**
|
|
2030
|
-
* Check if there is a property after the current position by looking for a `"` character.
|
|
2031
|
-
*
|
|
2032
|
-
* @param {*} state
|
|
2033
|
-
* @param {number} pos
|
|
2034
|
-
*
|
|
2035
|
-
* @returns {boolean}
|
|
2015
|
+
/**
|
|
2016
|
+
* Check if there is a property after the current position by looking for a `"` character.
|
|
2017
|
+
*
|
|
2018
|
+
* @param {*} state
|
|
2019
|
+
* @param {number} pos
|
|
2020
|
+
*
|
|
2021
|
+
* @returns {boolean}
|
|
2036
2022
|
*/
|
|
2037
2023
|
function hasPropertyAfter(state, pos) {
|
|
2038
2024
|
const textAfter = state.sliceDoc(pos).trimStart();
|
|
@@ -2049,18 +2035,17 @@ function hasPropertyAfter(state, pos) {
|
|
|
2049
2035
|
|
|
2050
2036
|
__webpack_require__.r(__webpack_exports__);
|
|
2051
2037
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2052
|
-
/* harmony export */ getName: () => (/* binding */ getName)
|
|
2053
|
-
/* harmony export */ getType: () => (/* binding */ getType)
|
|
2038
|
+
/* harmony export */ getName: () => (/* binding */ getName)
|
|
2054
2039
|
/* harmony export */ });
|
|
2055
2040
|
/* harmony import */ var bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bpmn-js/lib/util/ModelUtil */ "./node_modules/bpmn-js/lib/util/ModelUtil.js");
|
|
2056
2041
|
|
|
2057
2042
|
|
|
2058
|
-
/**
|
|
2059
|
-
* Get the name of a BPMN element.
|
|
2060
|
-
*
|
|
2061
|
-
* @param {import('../types').Element} element
|
|
2062
|
-
*
|
|
2063
|
-
* @returns {string}
|
|
2043
|
+
/**
|
|
2044
|
+
* Get the name of a BPMN element.
|
|
2045
|
+
*
|
|
2046
|
+
* @param {import('../types').Element} element
|
|
2047
|
+
*
|
|
2048
|
+
* @returns {string}
|
|
2064
2049
|
*/
|
|
2065
2050
|
function getName(element) {
|
|
2066
2051
|
const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getBusinessObject)(element);
|
|
@@ -2071,40 +2056,6 @@ function getName(element) {
|
|
|
2071
2056
|
return name;
|
|
2072
2057
|
}
|
|
2073
2058
|
|
|
2074
|
-
/**
|
|
2075
|
-
* Get the name of a BPMN element.
|
|
2076
|
-
*
|
|
2077
|
-
* @param {import('../types').Element} element
|
|
2078
|
-
*
|
|
2079
|
-
* @returns {string}
|
|
2080
|
-
*/
|
|
2081
|
-
function getType(element) {
|
|
2082
|
-
const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getBusinessObject)(element);
|
|
2083
|
-
const {
|
|
2084
|
-
$type: type
|
|
2085
|
-
} = businessObject;
|
|
2086
|
-
switch (type) {
|
|
2087
|
-
case 'bpmn:Task':
|
|
2088
|
-
return 'Task';
|
|
2089
|
-
case 'bpmn:UserTask':
|
|
2090
|
-
return 'User Task';
|
|
2091
|
-
case 'bpmn:ScriptTask':
|
|
2092
|
-
return 'Script Task';
|
|
2093
|
-
case 'bpmn:ServiceTask':
|
|
2094
|
-
return 'Service Task';
|
|
2095
|
-
case 'bpmn:BusinessRuleTask':
|
|
2096
|
-
return 'Business Rule Task';
|
|
2097
|
-
case 'bpmn:SendTask':
|
|
2098
|
-
return 'Send Task';
|
|
2099
|
-
case 'bpmn:ManualTask':
|
|
2100
|
-
return 'Manual Task';
|
|
2101
|
-
case 'bpmn:ReceiveTask':
|
|
2102
|
-
return 'Receive Task';
|
|
2103
|
-
default:
|
|
2104
|
-
return 'Task';
|
|
2105
|
-
}
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
2059
|
/***/ }),
|
|
2109
2060
|
|
|
2110
2061
|
/***/ "./node_modules/@bpmn-io/extract-process-variables/zeebe/index.mjs":
|
|
@@ -32622,12 +32573,10 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
|
|
|
32622
32573
|
gap: 12px;
|
|
32623
32574
|
width: 100%;
|
|
32624
32575
|
}
|
|
32625
|
-
.task-testing__container .task-testing__container--header .task-
|
|
32576
|
+
.task-testing__container .task-testing__container--header .task-name {
|
|
32626
32577
|
display: flex;
|
|
32627
|
-
gap: 6px;
|
|
32628
|
-
}
|
|
32629
|
-
.task-testing__container .task-testing__container--header .task-header .task-type {
|
|
32630
32578
|
font-weight: bold;
|
|
32579
|
+
gap: 6px;
|
|
32631
32580
|
}
|
|
32632
32581
|
.task-testing__container .task-testing__container--header .btn-execute {
|
|
32633
32582
|
width: 138px;
|
|
@@ -32711,7 +32660,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
|
|
|
32711
32660
|
}
|
|
32712
32661
|
.task-testing__container .output .output__error {
|
|
32713
32662
|
display: flex;
|
|
32714
|
-
flex-direction:
|
|
32663
|
+
flex-direction: row;
|
|
32715
32664
|
gap: 12px;
|
|
32716
32665
|
padding: 12px;
|
|
32717
32666
|
margin-bottom: 12px;
|
|
@@ -32719,17 +32668,23 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
|
|
|
32719
32668
|
border-left-width: 3px;
|
|
32720
32669
|
background-color: #fff1f1;
|
|
32721
32670
|
}
|
|
32722
|
-
.task-testing__container .output .output__error .output__error--
|
|
32671
|
+
.task-testing__container .output .output__error .output__error--content {
|
|
32723
32672
|
display: flex;
|
|
32724
|
-
flex-direction:
|
|
32725
|
-
|
|
32673
|
+
flex-direction: column;
|
|
32674
|
+
gap: 6px;
|
|
32675
|
+
flex-grow: 1;
|
|
32676
|
+
margin-top: 1px;
|
|
32677
|
+
}
|
|
32678
|
+
.task-testing__container .output .output__error .output__error--content .output__error--title {
|
|
32679
|
+
display: flex;
|
|
32680
|
+
justify-content: space-between;
|
|
32726
32681
|
font-weight: bold;
|
|
32727
32682
|
}
|
|
32728
|
-
.task-testing__container .output .output__error .output__error--title
|
|
32729
|
-
|
|
32683
|
+
.task-testing__container .output .output__error .output__error--content .output__error--title .cds--link {
|
|
32684
|
+
cursor: pointer;
|
|
32730
32685
|
}
|
|
32731
|
-
.task-testing__container .output .output__error .output__error--
|
|
32732
|
-
|
|
32686
|
+
.task-testing__container .output .output__error .output__error--icon svg {
|
|
32687
|
+
fill: #da1e28;
|
|
32733
32688
|
}
|
|
32734
32689
|
.task-testing__container .output .output__variables--empty {
|
|
32735
32690
|
height: 32px;
|
|
@@ -32814,7 +32769,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
|
|
|
32814
32769
|
}
|
|
32815
32770
|
.code__editor .code__editor-copy-button svg {
|
|
32816
32771
|
fill: #525252;
|
|
32817
|
-
}`, "",{"version":3,"sources":["webpack://./lib/style/style.scss"],"names":[],"mappings":"AAAA;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;EACA,aAAA;EACA,eAAA;AACF;AAEI;;EAEE,aAAA;EACA,mBAAA;EACA,QAAA;EACA,YAAA;AAAN;AAEM;;EACE,oBAAA;EACA,uBAAA;AACR;AAIE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,+BAAA;EACA,kBAAA;AAFJ;AAKE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,iBAAA;AAHJ;AAME;EACE,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,SAAA;EACA,WAAA;AAJJ;AAMI;EACE,aAAA;EACA,QAAA;AAJN;
|
|
32772
|
+
}`, "",{"version":3,"sources":["webpack://./lib/style/style.scss"],"names":[],"mappings":"AAAA;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;EACA,aAAA;EACA,eAAA;AACF;AAEI;;EAEE,aAAA;EACA,mBAAA;EACA,QAAA;EACA,YAAA;AAAN;AAEM;;EACE,oBAAA;EACA,uBAAA;AACR;AAIE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,+BAAA;EACA,kBAAA;AAFJ;AAKE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,iBAAA;AAHJ;AAME;EACE,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,SAAA;EACA,WAAA;AAJJ;AAMI;EACE,aAAA;EACA,iBAAA;EACA,QAAA;AAJN;AAOI;EACE,YAAA;AALN;AAQI;EACE,aAAA;AANN;AASI;EACE,aAAA;AAPN;AAUI;EACE,oBAAA;EACA,uBAAA;AARN;AAYE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAVJ;AAYI;EACE,aAAA;EACA,mBAAA;EACA,QAAA;AAVN;AAaI;EACE,cAAA;AAXN;AAeE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAbJ;AAeI;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;AAbN;AAgBI;EACE,cAAA;EACA,aAAA;EACA,mBAAA;EACA,QAAA;AAdN;AAgBM;EACE,aAAA;AAdR;AAiBM;EACE,aAAA;AAfR;AAkBM;EACE,aAAA;AAhBR;AAmBM;EACE,iBAAA;EACA,uBAAA;AAjBR;AAqBI;EACE,iBAAA;AAnBN;AAsBI;EACE,aAAA;EACA,sBAAA;EACA,YAAA;EACA,kBAAA;AApBN;AAsBM;EACE,oCAAA;AApBR;AAuBM;EACE,UAAA;EACA,yBAAA;AArBR;AAwBM;EACE,aAAA;AAtBR;AA0BM;EACE,aAAA;AAxBR;AA4BI;EACE,aAAA;EACA,mBAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,yBAAA;EACA,sBAAA;EACA,yBAAA;AA1BN;AA4BM;EACE,aAAA;EACA,sBAAA;EACA,QAAA;EACA,YAAA;EACA,eAAA;AA1BR;AA4BQ;EACE,aAAA;EACA,8BAAA;EACA,iBAAA;AA1BV;AA4BU;EACE,eAAA;AA1BZ;AA+BM;EACE,aAAA;AA7BR;AAiCI;EACE,YAAA;EACA,aAAA;EACA,mBAAA;EACA,cAAA;AA/BN;AAkCI;EACE,iBAAA;AAhCN;AAmCI;EACE,WAAA;AAjCN;AAoCI;EACE,qBAAA;EACA,YAAA;AAlCN;AAqCI;EACE,eAAA;AAnCN;;AAwCA;EACE,kBAAA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AArCF;AAuCE;EACE,0BAAA;EACA,oBAAA;AArCJ;AAwCE;EACE,kBAAA;EACA,YAAA;AAtCJ;AAwCI;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;AAtCN;AAwCM;EACE,YAAA;EACA,2CAAA;AAtCR;AAyCM;EACE,2BAAA;AAvCR;AA0CM;EACE,aAAA;AAxCR;AA2CM;EACE,aAAA;AAzCR;AA4CM;EACE,eAAA;AA1CR;AA6CM;EACE,YAAA;EACA,sBAAA;EACA,eAAA;EACA,gBAAA;EACA,qBAAA;AA3CR;AA6CQ;EACE,kBAAA;AA3CV;AA8CQ;EACE,eAAA;AA5CV;AAkDE;EACE,cAAA;EACA,eAAA;EACA,eAAA;AAhDJ;AAmDE;EACE,kBAAA;EACA,SAAA;EACA,WAAA;EACA,WAAA;AAjDJ;AAmDI;EACE,aAAA;AAjDN","sourcesContent":[".task-testing__container {\r\n display: flex;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n padding: 10px;\r\n font-size: 14px;\r\n\r\n &.task-testing__container--empty {\r\n .task-testing__container-no-config,\r\n .task-testing__container-no-element {\r\n display: flex;\r\n align-items: center;\r\n gap: 5px;\r\n height: 32px;\r\n\r\n .cds--inline-loading {\r\n inline-size: initial;\r\n min-block-size: initial;\r\n }\r\n }\r\n }\r\n\r\n .task-testing__container--left {\r\n width: 50%;\r\n display: flex;\r\n flex-direction: column;\r\n border-right: 1px solid #E0E0E0;\r\n padding-right: 6px;\r\n }\r\n\r\n .task-testing__container--right {\r\n width: 50%;\r\n display: flex;\r\n flex-direction: column;\r\n padding-left: 6px;\r\n }\r\n\r\n .task-testing__container--header {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n gap: 12px;\r\n width: 100%;\r\n\r\n .task-name {\r\n display: flex;\r\n font-weight: bold;\r\n gap: 6px;\r\n }\r\n\r\n .btn-execute {\r\n width: 138px;\r\n }\r\n\r\n .cds--popover-container:not(.has-error) .cds--popover {\r\n display: none;\r\n }\r\n\r\n .cds--tooltip-content {\r\n padding: 12px;\r\n }\r\n\r\n .cds--btn .cds--inline-loading {\r\n inline-size: initial;\r\n min-block-size: initial;\r\n }\r\n }\r\n\r\n .input {\r\n flex-grow: 1;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 5px;\r\n\r\n .input__header {\r\n display: flex;\r\n align-items: center;\r\n gap: 5px;\r\n }\r\n\r\n .input__header--title {\r\n color: #525252;\r\n }\r\n }\r\n\r\n .output {\r\n flex-grow: 1;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 5px;\r\n\r\n .output__header {\r\n display: flex;\r\n align-items: center;\r\n height: 32px;\r\n width: 100%;\r\n }\r\n\r\n .output__header--title {\r\n color: #525252;\r\n display: flex;\r\n align-items: center;\r\n gap: 6px;\r\n\r\n svg.output__status-icon--ready {\r\n fill: #0043ce;\r\n }\r\n\r\n svg.output__status-icon--success {\r\n fill: #24a148;\r\n }\r\n\r\n svg.output__status-icon--error {\r\n fill: #da1e28;\r\n }\r\n\r\n .cds--inline-loading {\r\n inline-size: 16px;\r\n min-block-size: initial;\r\n }\r\n }\r\n\r\n .output__header--button-operate {\r\n margin-left: auto;\r\n }\r\n\r\n .output__body {\r\n display: flex;\r\n flex-direction: column;\r\n flex-grow: 1;\r\n position: relative;\r\n\r\n .cds--tabs {\r\n --cds-layout-size-height-local: 32px;\r\n }\r\n \r\n .cds--tab-content {\r\n padding: 0;\r\n height: calc(100% - 20px);\r\n }\r\n\r\n .cds--tab-content:not([hidden]) {\r\n display: flex;\r\n }\r\n\r\n // Tooltip on Carbon Button with absolute position is broken.\r\n .cds--popover {\r\n display: none;\r\n }\r\n }\r\n\r\n .output__error {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 12px;\r\n padding: 12px;\r\n margin-bottom: 12px;\r\n border: 1px solid #da1e28;\r\n border-left-width: 3px;\r\n background-color: #fff1f1;\r\n\r\n .output__error--content {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 6px;\r\n flex-grow: 1;\r\n margin-top: 1px;\r\n\r\n .output__error--title {\r\n display: flex;\r\n justify-content: space-between;\r\n font-weight: bold;\r\n\r\n .cds--link {\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n\r\n .output__error--icon svg {\r\n fill: #da1e28;\r\n }\r\n }\r\n\r\n .output__variables--empty {\r\n height: 32px;\r\n display: flex;\r\n align-items: center;\r\n color: #525252;\r\n }\r\n\r\n .output__variables--empty-action {\r\n font-weight: bold;\r\n }\r\n\r\n .cds--snippet-container {\r\n width: 100%;\r\n }\r\n\r\n .cds--snippet {\r\n max-inline-size: 100%;\r\n height: 100%;\r\n }\r\n\r\n code {\r\n font-size: 14px;\r\n }\r\n }\r\n}\r\n\r\n.code__editor {\r\n position: relative;\r\n flex-grow: 1;\r\n display: flex;\r\n flex-direction: column;\r\n\r\n &.code__editor--error .code__editor-codemirror .code__editor-codemirror-inner .cm-editor {\r\n outline: 1px solid #da1e28;\r\n outline-offset: -1px;\r\n }\r\n\r\n .code__editor-codemirror {\r\n position: relative;\r\n flex-grow: 1;\r\n\r\n .code__editor-codemirror-inner {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n\r\n .cm-editor {\r\n height: 100%;\r\n background-color: var(--cds-layer, #f4f4f4);\r\n }\r\n\r\n .cm-scroller {\r\n overflow-y: auto !important;\r\n }\r\n\r\n .cm-content {\r\n padding: 15px;\r\n }\r\n\r\n .cm-focused {\r\n outline: none;\r\n }\r\n\r\n .cm-tooltip {\r\n font-size: 14px;\r\n }\r\n\r\n .info {\r\n padding: 5px;\r\n font-family: monospace;\r\n font-size: 12px;\r\n max-width: 300px;\r\n word-wrap: break-word;\r\n\r\n span {\r\n font-style: italic;\r\n }\r\n\r\n pre {\r\n margin-top: 5px;\r\n }\r\n }\r\n }\r\n }\r\n\r\n .code__editor-error {\r\n color: #da1e28;\r\n font-size: 13px;\r\n margin-top: 5px;\r\n }\r\n\r\n .code__editor-copy-button {\r\n position: absolute;\r\n top: 10px;\r\n right: 10px;\r\n z-index: 10;\r\n\r\n svg {\r\n fill: #525252;\r\n }\r\n }\r\n}"],"sourceRoot":""}]);
|
|
32818
32773
|
// Exports
|
|
32819
32774
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
32820
32775
|
|