camunda-bpmn-js 5.16.0 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-modeler.development.js +18839 -15666
- package/dist/base-modeler.production.min.js +45 -45
- package/dist/base-navigated-viewer.development.js +1958 -1314
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +1221 -599
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +11497 -7207
- package/dist/camunda-cloud-modeler.production.min.js +47 -47
- package/dist/camunda-cloud-navigated-viewer.development.js +1850 -1171
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +1842 -1185
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +9052 -4379
- package/dist/camunda-platform-modeler.production.min.js +45 -45
- package/dist/camunda-platform-navigated-viewer.development.js +1839 -1183
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +1818 -1184
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/index.js +1 -0
- package/lib/base/Modeler.js +12 -0
- package/lib/base/NavigatedViewer.js +10 -0
- package/lib/base/Viewer.js +10 -0
- package/lib/camunda-cloud/ElementTemplatesValidator.js +10 -0
- package/lib/camunda-cloud/Modeler.js +10 -0
- package/lib/camunda-cloud/NavigatedViewer.js +10 -0
- package/lib/camunda-cloud/Viewer.js +10 -0
- package/lib/camunda-cloud/features/external-resources/README.md +1 -1
- package/lib/camunda-cloud/features/external-resources/ResourceLoader.d.ts +9 -0
- package/lib/camunda-cloud/features/external-resources/ResourceLoader.js +10 -0
- package/lib/camunda-cloud/features/external-resources/Resources.d.ts +9 -0
- package/lib/camunda-cloud/features/external-resources/Resources.js +10 -0
- package/lib/camunda-cloud/features/external-resources/cmd/ComposedCommandHandler.d.ts +9 -0
- package/lib/camunda-cloud/features/external-resources/cmd/ComposedCommandHandler.js +10 -0
- package/lib/camunda-cloud/features/external-resources/cmd/index.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/decision/AppendMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/decision/CreateMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/decision/ReplaceMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/decision/createElement.d.ts +15 -5
- package/lib/camunda-cloud/features/external-resources/handlers/decision/createElement.js +29 -4
- package/lib/camunda-cloud/features/external-resources/handlers/decision/index.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/decision/replaceElement.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/decision/searchTerms.d.ts +9 -0
- package/lib/camunda-cloud/features/external-resources/handlers/decision/searchTerms.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/form/AppendMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/form/CreateMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/form/ReplaceMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/form/createElement.d.ts +15 -1
- package/lib/camunda-cloud/features/external-resources/handlers/form/createElement.js +28 -3
- package/lib/camunda-cloud/features/external-resources/handlers/form/index.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/form/replaceElement.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/form/searchTerms.d.ts +9 -0
- package/lib/camunda-cloud/features/external-resources/handlers/form/searchTerms.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/process/AppendMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/process/CreateMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/process/ReplaceMenuProvider.js +11 -1
- package/lib/camunda-cloud/features/external-resources/handlers/process/createElement.d.ts +14 -5
- package/lib/camunda-cloud/features/external-resources/handlers/process/createElement.js +35 -4
- package/lib/camunda-cloud/features/external-resources/handlers/process/index.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/process/replaceElement.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/process/searchTerms.d.ts +9 -0
- package/lib/camunda-cloud/features/external-resources/handlers/process/searchTerms.js +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/AppendMenuProvider.d.ts +6 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/AppendMenuProvider.js +41 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/CreateMenuProvider.d.ts +6 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/CreateMenuProvider.js +41 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/ReplaceMenuProvider.d.ts +6 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/ReplaceMenuProvider.js +41 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/constants.d.ts +12 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/constants.js +14 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/createElement.d.ts +14 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/createElement.js +61 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/index.d.ts +8 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/index.js +20 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/replaceElement.d.ts +15 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/replaceElement.js +59 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/searchTerms.d.ts +10 -0
- package/lib/camunda-cloud/features/external-resources/handlers/rpa/searchTerms.js +11 -0
- package/lib/camunda-cloud/features/external-resources/handlers/util/BaseAppendMenuProvider.d.ts +21 -4
- package/lib/camunda-cloud/features/external-resources/handlers/util/BaseAppendMenuProvider.js +26 -8
- package/lib/camunda-cloud/features/external-resources/handlers/util/BaseCreateMenuProvider.d.ts +19 -3
- package/lib/camunda-cloud/features/external-resources/handlers/util/BaseCreateMenuProvider.js +24 -7
- package/lib/camunda-cloud/features/external-resources/handlers/util/BaseReplaceMenuProvider.d.ts +6 -2
- package/lib/camunda-cloud/features/external-resources/handlers/util/BaseReplaceMenuProvider.js +19 -6
- package/lib/camunda-cloud/features/external-resources/index.d.ts +4 -0
- package/lib/camunda-cloud/features/external-resources/index.js +13 -1
- package/lib/camunda-cloud/features/popup-menu/CamundaDetailsPopupMenuProvider.js +10 -0
- package/lib/camunda-cloud/features/popup-menu/index.js +10 -0
- package/lib/camunda-cloud/util/commonModules.js +10 -0
- package/lib/camunda-platform/Modeler.js +10 -0
- package/lib/camunda-platform/NavigatedViewer.js +10 -0
- package/lib/camunda-platform/Viewer.js +10 -0
- package/lib/camunda-platform/util/commonModules.js +10 -0
- package/lib/util/ExtensionElementsUtil.js +10 -0
- package/package.json +21 -20
package/lib/camunda-cloud/features/external-resources/handlers/process/CreateMenuProvider.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
1
11
|
import { createElement } from './createElement.js';
|
|
2
12
|
import { searchTerms } from './searchTerms.js';
|
|
3
13
|
import { BaseCreateMenuProvider } from '../util/BaseCreateMenuProvider.js';
|
|
@@ -12,7 +22,7 @@ export class CreateMenuProvider extends BaseCreateMenuProvider {
|
|
|
12
22
|
resourceType: 'bpmnProcess',
|
|
13
23
|
groupName: 'Processes',
|
|
14
24
|
className: 'bpmn-icon-call-activity',
|
|
15
|
-
createElement
|
|
25
|
+
createElement,
|
|
16
26
|
search: searchTerms
|
|
17
27
|
});
|
|
18
28
|
}
|
package/lib/camunda-cloud/features/external-resources/handlers/process/ReplaceMenuProvider.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
1
11
|
import { replaceElement } from './replaceElement.js';
|
|
2
12
|
import { searchTerms } from './searchTerms.js';
|
|
3
13
|
import { BaseReplaceMenuProvider } from '../util/BaseReplaceMenuProvider.js';
|
|
@@ -12,7 +22,7 @@ export class ReplaceMenuProvider extends BaseReplaceMenuProvider {
|
|
|
12
22
|
resourceType: 'bpmnProcess',
|
|
13
23
|
groupName: 'Processes',
|
|
14
24
|
className: 'bpmn-icon-call-activity',
|
|
15
|
-
replaceElement
|
|
25
|
+
replaceElement,
|
|
16
26
|
search: searchTerms
|
|
17
27
|
});
|
|
18
28
|
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Create a new BPMN element for the given process resource.
|
|
2
12
|
*
|
|
3
13
|
* @param resource
|
|
4
|
-
* @param
|
|
14
|
+
* @param injector
|
|
15
|
+
*
|
|
16
|
+
* @returns
|
|
5
17
|
*/
|
|
6
|
-
export function createElement(
|
|
7
|
-
resource: CallActivity,
|
|
8
|
-
bpmnFactory: import("bpmn-js/lib/features/modeling/BpmnFactory").default
|
|
9
|
-
): any;
|
|
18
|
+
export function createElement(resource: CallActivity, injector: import("didi").Injector): import("bpmn-js/lib/model/Types").ModdleElement;
|
|
10
19
|
export type CallActivity = {
|
|
11
20
|
type: "bpmnProcess";
|
|
12
21
|
name: string;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
1
11
|
/**
|
|
2
12
|
* @typedef {{
|
|
3
13
|
* type: 'bpmnProcess',
|
|
@@ -7,15 +17,28 @@
|
|
|
7
17
|
*/
|
|
8
18
|
|
|
9
19
|
/**
|
|
20
|
+
* Create a new BPMN element for the given process resource.
|
|
10
21
|
*
|
|
11
22
|
* @param {CallActivity} resource
|
|
12
|
-
* @param {import('
|
|
23
|
+
* @param {import('didi').Injector} injector
|
|
24
|
+
*
|
|
25
|
+
* @returns {import('bpmn-js/lib/model/Types').ModdleElement}
|
|
13
26
|
*/
|
|
14
|
-
export function createElement(resource,
|
|
15
|
-
return createCallActivity(resource,
|
|
27
|
+
export function createElement(resource, injector) {
|
|
28
|
+
return createCallActivity(resource, injector);
|
|
16
29
|
}
|
|
17
30
|
|
|
18
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Create a new BPMN Call Activity for the given process resource.
|
|
33
|
+
*
|
|
34
|
+
* @param {CallActivity} resource
|
|
35
|
+
* @param {import('didi').Injector} injector
|
|
36
|
+
*
|
|
37
|
+
* @returns {import('bpmn-js/lib/model/Types').ModdleElement}
|
|
38
|
+
*/
|
|
39
|
+
function createCallActivity(resource, injector) {
|
|
40
|
+
const bpmnFactory = injector.get('bpmnFactory');
|
|
41
|
+
|
|
19
42
|
const calledElement = createCalledElement(resource, bpmnFactory);
|
|
20
43
|
const extensionElements = bpmnFactory.create('bpmn:ExtensionElements', {
|
|
21
44
|
values: [
|
|
@@ -29,6 +52,14 @@ function createCallActivity(resource, bpmnFactory) {
|
|
|
29
52
|
});
|
|
30
53
|
}
|
|
31
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Create a zeebe:CalledElement for the given process resource.
|
|
57
|
+
*
|
|
58
|
+
* @param {CallActivity} resource
|
|
59
|
+
* @param {import('bpmn-js/lib/features/modeling/BpmnFactory').default} bpmnFactory
|
|
60
|
+
*
|
|
61
|
+
* @returns {import('bpmn-js/lib/model/Types').ModdleElement}
|
|
62
|
+
*/
|
|
32
63
|
function createCalledElement(resource, bpmnFactory) {
|
|
33
64
|
return bpmnFactory.create('zeebe:CalledElement', {
|
|
34
65
|
processId: resource.processId
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
1
11
|
import { CreateMenuProvider } from './CreateMenuProvider';
|
|
2
12
|
import { AppendMenuProvider } from './AppendMenuProvider';
|
|
3
13
|
import { ReplaceMenuProvider } from './ReplaceMenuProvider';
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
1
11
|
import { getBusinessObject, is } from 'bpmn-js/lib/util/ModelUtil';
|
|
2
12
|
|
|
3
13
|
/**
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
1
10
|
export const searchTerms: string;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
1
11
|
export const searchTerms = [
|
|
2
12
|
'resource',
|
|
3
13
|
'bpmn',
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export class AppendMenuProvider extends BaseAppendMenuProvider {
|
|
2
|
+
static $inject: string[];
|
|
3
|
+
constructor(injector: any);
|
|
4
|
+
getPopupMenuEntries(element: any): import("diagram-js/lib/features/popup-menu/PopupMenuProvider.js").PopupMenuEntries;
|
|
5
|
+
}
|
|
6
|
+
import { BaseAppendMenuProvider } from '../util/BaseAppendMenuProvider.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { BaseAppendMenuProvider } from '../util/BaseAppendMenuProvider.js';
|
|
12
|
+
import { RPA_ICON, RPA_TEMPLATE_ID } from './constants.js';
|
|
13
|
+
import { createElement } from './createElement.js';
|
|
14
|
+
import { searchTerms } from './searchTerms.js';
|
|
15
|
+
|
|
16
|
+
export class AppendMenuProvider extends BaseAppendMenuProvider {
|
|
17
|
+
static $inject = [ 'injector' ];
|
|
18
|
+
|
|
19
|
+
constructor(injector) {
|
|
20
|
+
super(injector, {
|
|
21
|
+
resourceType: 'rpa',
|
|
22
|
+
groupName: 'RPA Scripts',
|
|
23
|
+
className: 'bpmn-icon-rpa-script',
|
|
24
|
+
createElement,
|
|
25
|
+
search: searchTerms,
|
|
26
|
+
imageUrl: RPA_ICON
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
this._elementTemplates = injector.get('elementTemplates');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getPopupMenuEntries(element) {
|
|
33
|
+
const templates = this._elementTemplates.getLatest(RPA_TEMPLATE_ID);
|
|
34
|
+
|
|
35
|
+
if (!templates || templates.length === 0) {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return super.getPopupMenuEntries(element);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export class CreateMenuProvider extends BaseCreateMenuProvider {
|
|
2
|
+
static $inject: string[];
|
|
3
|
+
constructor(injector: any);
|
|
4
|
+
getPopupMenuEntries(element: any): import("diagram-js/lib/features/popup-menu/PopupMenuProvider.js").PopupMenuEntries;
|
|
5
|
+
}
|
|
6
|
+
import { BaseCreateMenuProvider } from '../util/BaseCreateMenuProvider.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { BaseCreateMenuProvider } from '../util/BaseCreateMenuProvider.js';
|
|
12
|
+
import { RPA_ICON, RPA_TEMPLATE_ID } from './constants.js';
|
|
13
|
+
import { createElement } from './createElement.js';
|
|
14
|
+
import { searchTerms } from './searchTerms.js';
|
|
15
|
+
|
|
16
|
+
export class CreateMenuProvider extends BaseCreateMenuProvider {
|
|
17
|
+
static $inject = [ 'injector' ];
|
|
18
|
+
|
|
19
|
+
constructor(injector) {
|
|
20
|
+
super(injector, {
|
|
21
|
+
resourceType: 'rpa',
|
|
22
|
+
groupName: 'RPA Scripts',
|
|
23
|
+
className: 'bpmn-icon-rpa-script',
|
|
24
|
+
createElement,
|
|
25
|
+
search: searchTerms,
|
|
26
|
+
imageUrl: RPA_ICON
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
this._elementTemplates = injector.get('elementTemplates');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getPopupMenuEntries(element) {
|
|
33
|
+
const templates = this._elementTemplates.getLatest(RPA_TEMPLATE_ID);
|
|
34
|
+
|
|
35
|
+
if (!templates || templates.length === 0) {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return super.getPopupMenuEntries(element);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export class ReplaceMenuProvider extends BaseReplaceMenuProvider {
|
|
2
|
+
static $inject: string[];
|
|
3
|
+
constructor(injector: any);
|
|
4
|
+
getPopupMenuEntries(element: any): import("diagram-js/lib/features/popup-menu/PopupMenuProvider.js").PopupMenuEntries;
|
|
5
|
+
}
|
|
6
|
+
import { BaseReplaceMenuProvider } from '../util/BaseReplaceMenuProvider.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { BaseReplaceMenuProvider } from '../util/BaseReplaceMenuProvider.js';
|
|
12
|
+
import { RPA_ICON, RPA_TEMPLATE_ID } from './constants.js';
|
|
13
|
+
import { replaceElement } from './replaceElement.js';
|
|
14
|
+
import { searchTerms } from './searchTerms.js';
|
|
15
|
+
|
|
16
|
+
export class ReplaceMenuProvider extends BaseReplaceMenuProvider {
|
|
17
|
+
static $inject = [ 'injector' ];
|
|
18
|
+
|
|
19
|
+
constructor(injector) {
|
|
20
|
+
super(injector, {
|
|
21
|
+
resourceType: 'rpa',
|
|
22
|
+
groupName: 'RPA Scripts',
|
|
23
|
+
className: 'bpmn-icon-rpa-script',
|
|
24
|
+
replaceElement,
|
|
25
|
+
search: searchTerms,
|
|
26
|
+
imageUrl: RPA_ICON
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
this._elementTemplates = injector.get('elementTemplates');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getPopupMenuEntries(element) {
|
|
33
|
+
const templates = this._elementTemplates.getLatest(RPA_TEMPLATE_ID);
|
|
34
|
+
|
|
35
|
+
if (!templates || templates.length === 0) {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return super.getPopupMenuEntries(element);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
export const RPA_TEMPLATE_ID: "camunda.connectors.rpa";
|
|
11
|
+
export const RPA_MAIN_SCRIPT_LINK_NAME: "RPAScript";
|
|
12
|
+
export const RPA_ICON: "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM+CiAgPHRpdGxlPmJvdDwvdGl0bGU+CiAgPHJlY3QgeD0iMTgiIHk9IjEwIiB3aWR0aD0iMiIgaGVpZ2h0PSIyIi8+CiAgPHJlY3QgeD0iMTIiIHk9IjEwIiB3aWR0aD0iMiIgaGVpZ2h0PSIyIi8+CiAgPHBhdGggZD0iTTI2LDIwSDIxVjE4aDFhMi4wMDIzLDIuMDAyMywwLDAsMCwyLTJWMTJoMlYxMEgyNFY4YTIuMDAyMywyLjAwMjMsMCwwLDAtMi0ySDIwVjJIMThWNkgxNFYySDEyVjZIMTBBMi4wMDIzLDIuMDAyMywwLDAsMCw4LDh2Mkg2djJIOHY0YTIuMDAyMywyLjAwMjMsMCwwLDAsMiwyaDF2Mkg2YTIuMDAyMywyLjAwMjMsMCwwLDAtMiwydjhINlYyMkgyNnY4aDJWMjJBMi4wMDIzLDIuMDAyMywwLDAsMCwyNiwyMFpNMTAsOEgyMnY4SDEwWm0zLDEwaDZ2MkgxM1oiLz4KICA8cmVjdCBpZD0iX1RyYW5zcGFyZW50X1JlY3RhbmdsZV8iIGRhdGEtbmFtZT0iJmx0O1RyYW5zcGFyZW50IFJlY3RhbmdsZSZndDsiIGNsYXNzPSJjbHMtMSIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi8+Cjwvc3ZnPgo=";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const RPA_TEMPLATE_ID = 'camunda.connectors.rpa';
|
|
12
|
+
export const RPA_MAIN_SCRIPT_LINK_NAME = 'RPAScript';
|
|
13
|
+
|
|
14
|
+
export const RPA_ICON = 'data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM+CiAgPHRpdGxlPmJvdDwvdGl0bGU+CiAgPHJlY3QgeD0iMTgiIHk9IjEwIiB3aWR0aD0iMiIgaGVpZ2h0PSIyIi8+CiAgPHJlY3QgeD0iMTIiIHk9IjEwIiB3aWR0aD0iMiIgaGVpZ2h0PSIyIi8+CiAgPHBhdGggZD0iTTI2LDIwSDIxVjE4aDFhMi4wMDIzLDIuMDAyMywwLDAsMCwyLTJWMTJoMlYxMEgyNFY4YTIuMDAyMywyLjAwMjMsMCwwLDAtMi0ySDIwVjJIMThWNkgxNFYySDEyVjZIMTBBMi4wMDIzLDIuMDAyMywwLDAsMCw4LDh2Mkg2djJIOHY0YTIuMDAyMywyLjAwMjMsMCwwLDAsMiwyaDF2Mkg2YTIuMDAyMywyLjAwMjMsMCwwLDAtMiwydjhINlYyMkgyNnY4aDJWMjJBMi4wMDIzLDIuMDAyMywwLDAsMCwyNiwyMFpNMTAsOEgyMnY4SDEwWm0zLDEwaDZ2MkgxM1oiLz4KICA8cmVjdCBpZD0iX1RyYW5zcGFyZW50X1JlY3RhbmdsZV8iIGRhdGEtbmFtZT0iJmx0O1RyYW5zcGFyZW50IFJlY3RhbmdsZSZndDsiIGNsYXNzPSJjbHMtMSIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi8+Cjwvc3ZnPgo=';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a new BPMN element for the given RPA resource.
|
|
3
|
+
*
|
|
4
|
+
* @param resource
|
|
5
|
+
* @param injector
|
|
6
|
+
*
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export function createElement(resource: RPA, injector: import("didi").Injector): import("bpmn-js/lib/model/Types").ModdleElement;
|
|
10
|
+
export type RPA = {
|
|
11
|
+
type: "rpa";
|
|
12
|
+
name: string;
|
|
13
|
+
scriptId: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { getBusinessObject, is } from 'bpmn-js/lib/util/ModelUtil';
|
|
12
|
+
import { RPA_MAIN_SCRIPT_LINK_NAME, RPA_TEMPLATE_ID } from './constants';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {{
|
|
16
|
+
* type: 'rpa',
|
|
17
|
+
* name: string,
|
|
18
|
+
* scriptId: string
|
|
19
|
+
* }} RPA
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Create a new BPMN element for the given RPA resource.
|
|
24
|
+
*
|
|
25
|
+
* @param {RPA} resource
|
|
26
|
+
* @param {import('didi').Injector} injector
|
|
27
|
+
*
|
|
28
|
+
* @returns {import('bpmn-js/lib/model/Types').ModdleElement}
|
|
29
|
+
*/
|
|
30
|
+
export function createElement(resource, injector) {
|
|
31
|
+
return createRPATask(resource, injector);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Create an RPA task for the given RPA resource. Uses the latest RPA template
|
|
36
|
+
* to create the task.
|
|
37
|
+
*
|
|
38
|
+
* @param {RPA} resource
|
|
39
|
+
* @param {import('didi').Injector} injector
|
|
40
|
+
*
|
|
41
|
+
* @returns {import('bpmn-js/lib/model/Types').ModdleElement}
|
|
42
|
+
*/
|
|
43
|
+
function createRPATask(resource, injector) {
|
|
44
|
+
const elementTemplates = injector.get('elementTemplates');
|
|
45
|
+
|
|
46
|
+
const templates = elementTemplates.getLatest(RPA_TEMPLATE_ID);
|
|
47
|
+
|
|
48
|
+
const RPATask = elementTemplates.createElement(templates[0]);
|
|
49
|
+
|
|
50
|
+
const bo = getBusinessObject(RPATask);
|
|
51
|
+
const extensionElements = bo.get('extensionElements');
|
|
52
|
+
const linkedResources = extensionElements.get('values').find((el) => is(el, 'zeebe:LinkedResources'));
|
|
53
|
+
|
|
54
|
+
const mainScript = linkedResources.values.find((el) => el.linkName === RPA_MAIN_SCRIPT_LINK_NAME);
|
|
55
|
+
|
|
56
|
+
mainScript.set('resourceId', resource.scriptId);
|
|
57
|
+
|
|
58
|
+
bo.set('name', resource.name);
|
|
59
|
+
|
|
60
|
+
return bo;
|
|
61
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const RPAHandlerModule: {
|
|
2
|
+
'resources.RPAHandler.create': (string | typeof CreateMenuProvider)[];
|
|
3
|
+
'resources.RPAHandler.append': (string | typeof AppendMenuProvider)[];
|
|
4
|
+
'resources.RPAHandler.replace': (string | typeof ReplaceMenuProvider)[];
|
|
5
|
+
};
|
|
6
|
+
import { CreateMenuProvider } from './CreateMenuProvider';
|
|
7
|
+
import { AppendMenuProvider } from './AppendMenuProvider';
|
|
8
|
+
import { ReplaceMenuProvider } from './ReplaceMenuProvider';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { CreateMenuProvider } from './CreateMenuProvider';
|
|
12
|
+
import { AppendMenuProvider } from './AppendMenuProvider';
|
|
13
|
+
import { ReplaceMenuProvider } from './ReplaceMenuProvider';
|
|
14
|
+
|
|
15
|
+
export const RPAHandlerModule = {
|
|
16
|
+
__init__: [ 'resources.RPAHandler.create', 'resources.RPAHandler.append', 'resources.RPAHandler.replace' ],
|
|
17
|
+
'resources.RPAHandler.create': [ 'type', CreateMenuProvider ],
|
|
18
|
+
'resources.RPAHandler.append': [ 'type', AppendMenuProvider ],
|
|
19
|
+
'resources.RPAHandler.replace': [ 'type', ReplaceMenuProvider ]
|
|
20
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param element
|
|
3
|
+
* @param resource
|
|
4
|
+
* @param injector
|
|
5
|
+
*/
|
|
6
|
+
export function replaceElement(
|
|
7
|
+
element: import("diagram-js/lib/model").Element,
|
|
8
|
+
resource: RPA,
|
|
9
|
+
injector: import("didi").Injector
|
|
10
|
+
): void;
|
|
11
|
+
export type RPA = {
|
|
12
|
+
type: "rpa";
|
|
13
|
+
name: string;
|
|
14
|
+
scriptId: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { getBusinessObject, is } from 'bpmn-js/lib/util/ModelUtil';
|
|
12
|
+
import { RPA_MAIN_SCRIPT_LINK_NAME, RPA_TEMPLATE_ID } from './constants';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {{
|
|
16
|
+
* type: 'rpa',
|
|
17
|
+
* name: string,
|
|
18
|
+
* scriptId: string
|
|
19
|
+
* }} RPA
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param {import('diagram-js/lib/model').Element} element
|
|
24
|
+
* @param {RPA} resource
|
|
25
|
+
* @param {import('didi').Injector} injector
|
|
26
|
+
*/
|
|
27
|
+
export function replaceElement(element, resource, injector) {
|
|
28
|
+
const modeling = injector.get('modeling'),
|
|
29
|
+
commandStack = injector.get('commandStack');
|
|
30
|
+
|
|
31
|
+
commandStack.execute('external-resources.composed-command', {
|
|
32
|
+
command: replace
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function replace() {
|
|
36
|
+
const elementTemplates = injector.get('elementTemplates');
|
|
37
|
+
|
|
38
|
+
const templates = elementTemplates.getLatest(RPA_TEMPLATE_ID);
|
|
39
|
+
|
|
40
|
+
const RPATask = elementTemplates.applyTemplate(element, templates[0]);
|
|
41
|
+
|
|
42
|
+
modeling.updateProperties(RPATask, {
|
|
43
|
+
name: resource.name
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const bo = getBusinessObject(RPATask);
|
|
47
|
+
|
|
48
|
+
const extensionElements = bo.get('extensionElements');
|
|
49
|
+
const linkedResources = extensionElements.get('values').find((el) => is(el, 'zeebe:LinkedResources'));
|
|
50
|
+
|
|
51
|
+
const mainScript = linkedResources.get('values').find((el) => el.get('linkName') === RPA_MAIN_SCRIPT_LINK_NAME);
|
|
52
|
+
|
|
53
|
+
modeling.updateModdleProperties(RPATask, mainScript, {
|
|
54
|
+
resourceId: resource.scriptId
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return RPATask;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
export const searchTerms: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const searchTerms = [ 'resource', 'RPA', 'Script', 'Robotic', 'Automation' ].join(' ');
|
package/lib/camunda-cloud/features/external-resources/handlers/util/BaseAppendMenuProvider.d.ts
CHANGED
|
@@ -1,18 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information regarding copyright
|
|
5
|
+
* ownership.
|
|
6
|
+
*
|
|
7
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
8
|
+
* except in compliance with the MIT License.
|
|
9
|
+
*/
|
|
1
10
|
export class BaseAppendMenuProvider {
|
|
2
11
|
/**
|
|
3
|
-
*
|
|
4
12
|
* @param injector
|
|
5
13
|
* @param config
|
|
6
14
|
*/
|
|
7
15
|
constructor(injector: import("didi").Injector, config: Config);
|
|
8
16
|
|
|
9
|
-
/**
|
|
10
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @param element
|
|
19
|
+
*
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
getPopupMenuEntries(element: ModdleElement): PopupMenuEntries;
|
|
11
23
|
}
|
|
24
|
+
|
|
25
|
+
type Injector = import("didi").Injector;
|
|
26
|
+
type ModdleElement = import("bpmn-js/lib/model/Types").ModdleElement;
|
|
27
|
+
type PopupMenuEntries = import("diagram-js/lib/features/popup-menu/PopupMenuProvider").PopupMenuEntries;
|
|
28
|
+
|
|
12
29
|
export type Config = {
|
|
13
30
|
resourceType: string;
|
|
14
31
|
className: string;
|
|
15
32
|
groupName: string;
|
|
16
|
-
createElement:
|
|
33
|
+
createElement: (resource: any, injector: Injector) => ModdleElement;
|
|
17
34
|
search?: string;
|
|
18
35
|
};
|