@bpmn-nova/studio 0.3.9-preview → 0.4.1
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/README.md +2 -2
- package/dist/canvas.js +97 -25
- package/dist/config.js +13 -0
- package/dist/context-menu.js +41 -32
- package/dist/controller.js +45 -19
- package/dist/flow-tree.d.ts +4 -0
- package/dist/flow-tree.js +14 -0
- package/dist/index.d.ts +47 -2
- package/dist/index.js +1 -0
- package/dist/interactions.js +6 -1
- package/dist/modules/bpmn-model/index.d.ts +2 -1
- package/dist/modules/bpmn-model/index.js +12 -10
- package/dist/modules/core/gateway.js +16 -13
- package/dist/modules/core/index.d.ts +6 -4
- package/dist/modules/core/model.js +12 -7
- package/dist/modules/designer/index.d.ts +5 -1
- package/dist/modules/designer/index.js +36 -15
- package/dist/modules/export-svg/index.d.ts +12 -5
- package/dist/modules/export-svg/preview.js +34 -24
- package/dist/modules/export-svg/render.js +102 -50
- package/dist/modules/flow-tree/controller.js +364 -0
- package/dist/modules/flow-tree/index.d.ts +248 -0
- package/dist/modules/flow-tree/index.js +5 -0
- package/dist/modules/flow-tree/operations.js +484 -0
- package/dist/modules/flow-tree/sample.js +445 -0
- package/dist/modules/flow-tree/schema.js +588 -0
- package/dist/modules/flow-tree/validate.js +125 -0
- package/dist/modules/flow-tree-bpmn/compiler.js +547 -0
- package/dist/modules/flow-tree-bpmn/decompiler.js +524 -0
- package/dist/modules/flow-tree-bpmn/expression.js +135 -0
- package/dist/modules/flow-tree-bpmn/index.d.ts +53 -0
- package/dist/modules/flow-tree-bpmn/index.js +14 -0
- package/dist/modules/flow-tree-renderer/canvas.js +1003 -0
- package/dist/modules/flow-tree-renderer/export-svg.js +325 -0
- package/dist/modules/flow-tree-renderer/index.d.ts +143 -0
- package/dist/modules/flow-tree-renderer/index.js +3 -0
- package/dist/modules/flow-tree-renderer/shell.js +970 -0
- package/dist/modules/i18n/index.d.ts +647 -0
- package/dist/modules/i18n/index.js +247 -0
- package/dist/modules/i18n/locales/en-US.js +1222 -0
- package/dist/modules/i18n/locales/zh-CN.js +1204 -0
- package/dist/modules/icons/index.js +23 -0
- package/dist/modules/node-presentation/index.d.ts +3 -2
- package/dist/modules/node-presentation/index.js +14 -11
- package/dist/modules/palette/index.d.ts +6 -1
- package/dist/modules/palette/index.js +26 -8
- package/dist/modules/palette/panel.js +44 -6
- package/dist/modules/properties/index.d.ts +2 -1
- package/dist/modules/properties/index.js +2 -2
- package/dist/modules/properties-activiti/index.js +84 -59
- package/dist/modules/properties-bpmn/index.js +151 -128
- package/dist/modules/properties-core/index.d.ts +9 -3
- package/dist/modules/properties-core/index.js +16 -4
- package/dist/modules/properties-flow-tree/index.d.ts +56 -0
- package/dist/modules/properties-flow-tree/index.js +2 -0
- package/dist/modules/properties-flow-tree/panel.js +1136 -0
- package/dist/modules/properties-flow-tree/widgets.js +625 -0
- package/dist/modules/properties-flowable/index.js +55 -34
- package/dist/modules/properties-renderer/index.d.ts +5 -1
- package/dist/modules/properties-renderer/index.js +110 -42
- package/dist/modules/renderer-svg/index.d.ts +6 -2
- package/dist/modules/renderer-svg/index.js +113 -38
- package/dist/modules/runtime/index.d.ts +33 -5
- package/dist/modules/runtime/index.js +97 -73
- package/dist/modules/runtime/time.js +89 -4
- package/dist/modules/runtime/visits.js +6 -4
- package/dist/modules/theme/index.d.ts +5 -2
- package/dist/modules/theme/index.js +8 -4
- package/dist/modules/viewer/index.d.ts +28 -7
- package/dist/modules/viewer/index.js +223 -58
- package/dist/modules/viewer/runtime-content.js +26 -20
- package/dist/modules/viewer/runtime-trace.js +43 -25
- package/dist/modules/viewer/timeline.js +103 -36
- package/dist/shell.js +258 -75
- package/dist/sidebars.js +3 -1
- package/dist/styles.css +2371 -2
- package/llms-full.txt +586 -47
- package/llms.txt +6 -5
- package/package.json +7 -3
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { NODE_DEFINITIONS, resolveGatewayRole, resolveSwimlaneLabelPlacement } from '../core/index.js';
|
|
2
|
+
import { resolveI18n } from '../i18n/index.js';
|
|
2
3
|
import { propertyEntry, propertyGroup } from '../properties-core/index.js';
|
|
3
4
|
|
|
4
5
|
const activityKinds = new Set(['task', 'container']);
|
|
5
6
|
const eventRefs = {
|
|
6
|
-
message: { resource: 'messages',
|
|
7
|
-
signal: { resource: 'signals',
|
|
8
|
-
error: { resource: 'errors',
|
|
9
|
-
escalation: { resource: 'escalations',
|
|
7
|
+
message: { resource: 'messages', labelKey: 'properties.bpmn.eventRefMessage' },
|
|
8
|
+
signal: { resource: 'signals', labelKey: 'properties.bpmn.eventRefSignal' },
|
|
9
|
+
error: { resource: 'errors', labelKey: 'properties.bpmn.eventRefError' },
|
|
10
|
+
escalation: { resource: 'escalations', labelKey: 'properties.bpmn.eventRefEscalation' },
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
function nodeTypeOptions(context) {
|
|
14
|
+
const i18n = resolveI18n(context);
|
|
13
15
|
const currentKind = context.definition?.kind;
|
|
14
16
|
const compatible = currentKind === 'event' || currentKind === 'boundary'
|
|
15
17
|
? ['event', 'boundary']
|
|
@@ -20,17 +22,18 @@ function nodeTypeOptions(context) {
|
|
|
20
22
|
.filter(([type, def]) => type !== 'generic'
|
|
21
23
|
&& compatible.includes(def.kind)
|
|
22
24
|
&& context.studio?.canChangeNodeType?.(context.element?.id, type) !== false)
|
|
23
|
-
.map(([value, def]) => ({ value, label: def.label }));
|
|
25
|
+
.map(([value, def]) => ({ value, label: i18n.elementTypeLabel(value, def.label) }));
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
function idValidator(value, context) {
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
+
const i18n = resolveI18n(context);
|
|
30
|
+
if (!value) return i18n.t('properties.validators.idRequired');
|
|
31
|
+
if (!/^[A-Za-z_][A-Za-z0-9_.-]*$/.test(value)) return i18n.t('properties.validators.idInvalid');
|
|
29
32
|
const model = context.model;
|
|
30
33
|
const processConflict = context.kind !== 'process' && model.id === value;
|
|
31
34
|
const nodeConflict = model.nodes.some((item) => item.id === value && !(context.kind === 'node' && item === context.element));
|
|
32
35
|
const edgeConflict = model.edges.some((item) => item.id === value && !(context.kind === 'edge' && item === context.element));
|
|
33
|
-
if (processConflict || nodeConflict || edgeConflict) return '
|
|
36
|
+
if (processConflict || nodeConflict || edgeConflict) return i18n.t('properties.validators.idDuplicate');
|
|
34
37
|
return null;
|
|
35
38
|
}
|
|
36
39
|
|
|
@@ -38,16 +41,17 @@ const basicProvider = {
|
|
|
38
41
|
id: 'bpmn-basic',
|
|
39
42
|
priority: 1000,
|
|
40
43
|
getGroups(context) {
|
|
44
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
41
45
|
if (context.kind === 'process') {
|
|
42
46
|
return [propertyGroup({
|
|
43
|
-
id: 'basic', label: '
|
|
47
|
+
id: 'basic', label: t('properties.bpmn.basicGroup'), collapsible: false,
|
|
44
48
|
entries: [
|
|
45
|
-
propertyEntry({ id: 'process-name', label: '
|
|
46
|
-
propertyEntry({ id: 'process-id', label: 'Process ID', path: 'id', required: true, validate: idValidator, note: '
|
|
49
|
+
propertyEntry({ id: 'process-name', label: t('properties.bpmn.processName'), path: 'name', required: true }),
|
|
50
|
+
propertyEntry({ id: 'process-id', label: 'Process ID', path: 'id', required: true, validate: idValidator, note: t('properties.bpmn.processIdNote'), level: 'developer' }),
|
|
47
51
|
propertyEntry({ id: 'namespace', label: 'Target Namespace', path: 'targetNamespace', placeholder: 'urn:company:workflow', level: 'developer' }),
|
|
48
|
-
propertyEntry({ id: 'executable', type: 'switch', label: '
|
|
52
|
+
propertyEntry({ id: 'executable', type: 'switch', label: t('properties.bpmn.executable'), path: 'isExecutable' }),
|
|
49
53
|
propertyEntry({
|
|
50
|
-
id: 'engine', type: 'select', label: '
|
|
54
|
+
id: 'engine', type: 'select', label: t('properties.bpmn.engine'),
|
|
51
55
|
options: [{ value: 'flowable', label: 'Flowable' }, { value: 'activiti', label: 'Activiti' }],
|
|
52
56
|
getValue: (ctx) => ctx.model.engine,
|
|
53
57
|
setValue: (ctx, value) => ctx.studio.setEngine(value),
|
|
@@ -57,22 +61,21 @@ const basicProvider = {
|
|
|
57
61
|
}
|
|
58
62
|
if (context.kind === 'edge') {
|
|
59
63
|
return [propertyGroup({
|
|
60
|
-
id: 'basic', label: context.element.type === 'sequenceFlow' ? '
|
|
64
|
+
id: 'basic', label: t(context.element.type === 'sequenceFlow' ? 'properties.bpmn.branchDefGroup' : 'properties.bpmn.edgeInfoGroup'), collapsible: false,
|
|
61
65
|
entries: [
|
|
62
|
-
propertyEntry({ id: 'edge-name', label: '
|
|
66
|
+
propertyEntry({ id: 'edge-name', label: t('properties.bpmn.name'), path: 'name', placeholder: t('properties.bpmn.edgeNamePlaceholder') }),
|
|
63
67
|
propertyEntry({ id: 'edge-id', label: 'Flow ID', path: 'id', required: true, validate: idValidator }),
|
|
64
68
|
propertyEntry({ id: 'edge-type', type: 'readonly', label: 'BPMN Type', getValue: (ctx) => ctx.element.type === 'messageFlow' ? 'bpmn:MessageFlow' : ctx.element.type === 'association' ? 'bpmn:Association' : 'bpmn:SequenceFlow' }),
|
|
65
69
|
],
|
|
66
70
|
})];
|
|
67
71
|
}
|
|
68
|
-
const def = context.definition;
|
|
69
72
|
return [propertyGroup({
|
|
70
|
-
id: 'basic', label: '
|
|
73
|
+
id: 'basic', label: t('properties.bpmn.basicGroup'), collapsible: false,
|
|
71
74
|
entries: [
|
|
72
|
-
propertyEntry({ id: 'name', label: '
|
|
75
|
+
propertyEntry({ id: 'name', label: t('properties.bpmn.name'), path: 'name', required: true }),
|
|
73
76
|
propertyEntry({ id: 'id', label: 'Element ID', path: 'id', required: true, validate: idValidator, level: 'developer' }),
|
|
74
77
|
propertyEntry({
|
|
75
|
-
id: 'node-type', type: 'select', label: '
|
|
78
|
+
id: 'node-type', type: 'select', label: t('properties.bpmn.nodeType'), options: nodeTypeOptions,
|
|
76
79
|
getValue: (ctx) => ctx.element.type,
|
|
77
80
|
setValue: (ctx, value) => ctx.designer.changeNodeType(ctx.element.id, value),
|
|
78
81
|
}),
|
|
@@ -86,11 +89,12 @@ const documentationProvider = {
|
|
|
86
89
|
id: 'bpmn-documentation',
|
|
87
90
|
priority: 200,
|
|
88
91
|
getGroups(context) {
|
|
92
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
89
93
|
return [propertyGroup({
|
|
90
|
-
id: 'documentation', label: '
|
|
94
|
+
id: 'documentation', label: t('properties.bpmn.documentationGroup'), collapsed: true, position: { append: true },
|
|
91
95
|
entries: [propertyEntry({
|
|
92
96
|
id: 'documentation', type: 'textarea', label: 'Documentation', path: context.kind === 'process' ? 'properties.documentation' : 'properties.documentation',
|
|
93
|
-
placeholder: '
|
|
97
|
+
placeholder: t('properties.bpmn.documentationPlaceholder'), rows: 5,
|
|
94
98
|
})],
|
|
95
99
|
})];
|
|
96
100
|
},
|
|
@@ -100,51 +104,52 @@ const processProvider = {
|
|
|
100
104
|
id: 'bpmn-process',
|
|
101
105
|
priority: 800,
|
|
102
106
|
appliesTo: { kind: 'process' },
|
|
103
|
-
getGroups() {
|
|
107
|
+
getGroups(context) {
|
|
108
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
104
109
|
return [
|
|
105
110
|
propertyGroup({
|
|
106
|
-
id: 'process-start-permissions', label: '
|
|
111
|
+
id: 'process-start-permissions', label: t('properties.bpmn.startPermissionsGroup'), collapsed: true, position: { after: 'basic' },
|
|
107
112
|
entries: [
|
|
108
|
-
propertyEntry({ id: 'starter-users', type: 'tags', label: '
|
|
109
|
-
propertyEntry({ id: 'starter-groups', type: 'tags', label: '
|
|
113
|
+
propertyEntry({ id: 'starter-users', type: 'tags', label: t('properties.bpmn.starterUsers'), path: 'properties.candidateStarterUsers', placeholder: 'user1,user2' }),
|
|
114
|
+
propertyEntry({ id: 'starter-groups', type: 'tags', label: t('properties.bpmn.starterGroups'), path: 'properties.candidateStarterGroups', placeholder: 'manager,finance' }),
|
|
110
115
|
],
|
|
111
116
|
}),
|
|
112
117
|
propertyGroup({
|
|
113
|
-
id: 'global-resources', label: '
|
|
114
|
-
description: '
|
|
118
|
+
id: 'global-resources', label: t('properties.bpmn.globalResourcesGroup'), collapsed: true, position: { after: 'process-start-permissions' },
|
|
119
|
+
description: t('properties.bpmn.globalResourcesDesc'),
|
|
115
120
|
entries: [
|
|
116
|
-
propertyEntry({ id: 'messages', type: 'table', label: 'Messages', path: 'resources.messages', rowLabel: '
|
|
117
|
-
propertyEntry({ id: 'signals', type: 'table', label: 'Signals', path: 'resources.signals', rowLabel: '
|
|
118
|
-
propertyEntry({ id: 'errors', type: 'table', label: 'Errors', path: 'resources.errors', rowLabel: '
|
|
119
|
-
propertyEntry({ id: 'escalations', type: 'table', label: 'Escalations', path: 'resources.escalations', rowLabel: '
|
|
121
|
+
propertyEntry({ id: 'messages', type: 'table', label: 'Messages', path: 'resources.messages', rowLabel: t('properties.bpmn.messageRowLabel'), defaultRow: () => ({ id: `Message_${Date.now().toString(36)}`, name: t('properties.bpmn.messageDefaultName') }), columns: [{ key: 'id', label: 'ID' }, { key: 'name', label: t('properties.bpmn.name') }] }),
|
|
122
|
+
propertyEntry({ id: 'signals', type: 'table', label: 'Signals', path: 'resources.signals', rowLabel: t('properties.bpmn.signalRowLabel'), defaultRow: () => ({ id: `Signal_${Date.now().toString(36)}`, name: t('properties.bpmn.signalDefaultName') }), columns: [{ key: 'id', label: 'ID' }, { key: 'name', label: t('properties.bpmn.name') }] }),
|
|
123
|
+
propertyEntry({ id: 'errors', type: 'table', label: 'Errors', path: 'resources.errors', rowLabel: t('properties.bpmn.errorRowLabel'), defaultRow: () => ({ id: `Error_${Date.now().toString(36)}`, name: t('properties.bpmn.errorDefaultName'), errorCode: 'BUSINESS_ERROR' }), columns: [{ key: 'id', label: 'ID' }, { key: 'name', label: t('properties.bpmn.name') }, { key: 'errorCode', label: 'Error Code' }] }),
|
|
124
|
+
propertyEntry({ id: 'escalations', type: 'table', label: 'Escalations', path: 'resources.escalations', rowLabel: t('properties.bpmn.escalationRowLabel'), defaultRow: () => ({ id: `Escalation_${Date.now().toString(36)}`, name: t('properties.bpmn.escalationDefaultName'), escalationCode: 'ESCALATE' }), columns: [{ key: 'id', label: 'ID' }, { key: 'name', label: t('properties.bpmn.name') }, { key: 'escalationCode', label: 'Code' }] }),
|
|
120
125
|
],
|
|
121
126
|
}),
|
|
122
127
|
propertyGroup({
|
|
123
|
-
id: 'namespaces', label: '
|
|
124
|
-
description: '
|
|
128
|
+
id: 'namespaces', label: t('properties.bpmn.namespacesGroup'), collapsed: true, position: { after: 'global-resources' },
|
|
129
|
+
description: t('properties.bpmn.namespacesDesc'),
|
|
125
130
|
entries: [propertyEntry({
|
|
126
131
|
id: 'namespace-table', type: 'table', label: 'Namespace Declarations',
|
|
127
132
|
getValue: (ctx) => Object.entries(ctx.model.namespaceDeclarations || {}).map(([name, uri]) => ({ name, uri })),
|
|
128
133
|
setValue: (ctx, rows) => ctx.designer.updateProcess({ namespaceDeclarations: Object.fromEntries((rows || []).filter((row) => row.name && row.uri).map((row) => [row.name.startsWith('xmlns:') ? row.name : `xmlns:${row.name}`, row.uri])) }),
|
|
129
|
-
rowLabel: '
|
|
134
|
+
rowLabel: t('properties.bpmn.namespaceRowLabel'), defaultRow: () => ({ name: 'xmlns:company', uri: 'urn:company:bpmn-extension' }), columns: [{ key: 'name', label: 'Prefix' }, { key: 'uri', label: 'URI' }],
|
|
130
135
|
})],
|
|
131
136
|
}),
|
|
132
137
|
propertyGroup({
|
|
133
|
-
id: 'canvas-display', label: '
|
|
138
|
+
id: 'canvas-display', label: t('properties.bpmn.canvasDisplayGroup'), position: { after: 'basic' },
|
|
134
139
|
entries: [
|
|
135
|
-
propertyEntry({ id: 'show-grid', type: 'switch', label: '
|
|
136
|
-
propertyEntry({ id: 'grid-size', type: 'range', label: '
|
|
137
|
-
propertyEntry({ id: 'snap-to-grid', type: 'switch', label: '
|
|
138
|
-
propertyEntry({ id: 'alignment-guides', type: 'switch', label: '
|
|
140
|
+
propertyEntry({ id: 'show-grid', type: 'switch', label: t('properties.bpmn.showGrid'), path: 'settings.showGrid', defaultValue: true }),
|
|
141
|
+
propertyEntry({ id: 'grid-size', type: 'range', label: t('properties.bpmn.gridSize'), path: 'settings.gridSize', defaultValue: 16, min: 8, max: 40, step: 4, unit: 'px' }),
|
|
142
|
+
propertyEntry({ id: 'snap-to-grid', type: 'switch', label: t('properties.bpmn.snapToGrid'), path: 'settings.snapToGrid', defaultValue: false }),
|
|
143
|
+
propertyEntry({ id: 'alignment-guides', type: 'switch', label: t('properties.bpmn.alignmentGuides'), path: 'settings.alignmentGuides', defaultValue: true, note: t('properties.bpmn.alignmentGuidesNote') }),
|
|
139
144
|
],
|
|
140
145
|
}),
|
|
141
146
|
propertyGroup({
|
|
142
|
-
id: 'nova-layout', label: '
|
|
147
|
+
id: 'nova-layout', label: t('properties.bpmn.layoutGroup'), position: { after: 'canvas-display' },
|
|
143
148
|
entries: [
|
|
144
|
-
propertyEntry({ id: 'direction', type: 'select', label: '
|
|
145
|
-
propertyEntry({ id: 'density', type: 'select', label: '
|
|
146
|
-
propertyEntry({ id: 'edge-style', type: 'select', label: '
|
|
147
|
-
propertyEntry({ id: 'beautify', type: 'action', label: '
|
|
149
|
+
propertyEntry({ id: 'direction', type: 'select', label: t('properties.bpmn.defaultDirection'), path: 'settings.direction', options: [['horizontal', t('properties.bpmn.directionHorizontal')], ['vertical', t('properties.bpmn.directionVertical')]] }),
|
|
150
|
+
propertyEntry({ id: 'density', type: 'select', label: t('properties.bpmn.layoutDensity'), path: 'settings.layoutDensity', options: [['compact', t('shell.density.compact')], ['balanced', t('shell.density.balanced')], ['spacious', t('shell.density.spacious')]], note: t('properties.bpmn.layoutDensityNote') }),
|
|
151
|
+
propertyEntry({ id: 'edge-style', type: 'select', label: t('properties.bpmn.defaultEdgeStyle'), path: 'settings.edgeStyle', options: [['rounded', t('properties.bpmn.edgeStyleRounded')], ['smooth', t('properties.bpmn.edgeStyleSmooth')], ['straight', t('properties.bpmn.edgeStyleStraight')]] }),
|
|
152
|
+
propertyEntry({ id: 'beautify', type: 'action', label: t('properties.bpmn.beautifyEntryLabel'), actionLabel: t('properties.bpmn.beautifyActionLabel'), iconId: 'ui.magic', action: (ctx) => ctx.designer.beautify({ direction: ctx.model.settings?.direction, density: ctx.model.settings?.layoutDensity, edgeStyle: ctx.model.settings?.edgeStyle }) }),
|
|
148
153
|
],
|
|
149
154
|
}),
|
|
150
155
|
];
|
|
@@ -156,15 +161,16 @@ const sequenceFlowProvider = {
|
|
|
156
161
|
priority: 850,
|
|
157
162
|
appliesTo: (ctx) => ctx.kind === 'edge' && (ctx.element.type || 'sequenceFlow') === 'sequenceFlow',
|
|
158
163
|
getGroups(context) {
|
|
164
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
159
165
|
const source = context.model.nodes.find((node) => node.id === context.element.source);
|
|
160
166
|
const sourceDef = NODE_DEFINITIONS[source?.type] || {};
|
|
161
167
|
return [
|
|
162
168
|
propertyGroup({
|
|
163
|
-
id: 'condition', label: '
|
|
169
|
+
id: 'condition', label: t('properties.bpmn.conditionGroup'), position: { after: 'basic' },
|
|
164
170
|
entries: [
|
|
165
|
-
propertyEntry({ id: 'condition-expression', type: 'expression', label: '
|
|
171
|
+
propertyEntry({ id: 'condition-expression', type: 'expression', label: t('properties.bpmn.conditionExpression'), path: 'condition', placeholder: '${amount >= 50000}', note: source?.type === 'parallelGateway' ? t('properties.bpmn.conditionParallelNote') : t('properties.bpmn.conditionDefaultNote'), visible: (ctx) => source?.type === 'parallelGateway' ? ctx.profile === 'developer' : sourceDef.kind === 'gateway' || !!context.element.condition }),
|
|
166
172
|
propertyEntry({
|
|
167
|
-
id: 'default-flow', type: 'switch', label: '
|
|
173
|
+
id: 'default-flow', type: 'switch', label: t('properties.bpmn.defaultFlow'), getValue: (ctx) => !!ctx.element.isDefault,
|
|
168
174
|
setValue: (ctx, value) => {
|
|
169
175
|
const patches = [];
|
|
170
176
|
if (value) {
|
|
@@ -173,17 +179,17 @@ const sequenceFlowProvider = {
|
|
|
173
179
|
patches.push({ id: ctx.element.id, patch: { isDefault: !!value } });
|
|
174
180
|
ctx.designer.updateEdges(patches);
|
|
175
181
|
},
|
|
176
|
-
note: source?.type === 'parallelGateway' ? '
|
|
182
|
+
note: source?.type === 'parallelGateway' ? t('properties.bpmn.defaultFlowParallelNote') : '',
|
|
177
183
|
visible: (ctx) => ['exclusiveGateway', 'inclusiveGateway', 'complexGateway'].includes(source?.type) || (source?.type === 'parallelGateway' && ctx.profile === 'developer'),
|
|
178
184
|
}),
|
|
179
185
|
],
|
|
180
186
|
}),
|
|
181
187
|
propertyGroup({
|
|
182
|
-
id: 'nova-edge-style', label: '
|
|
188
|
+
id: 'nova-edge-style', label: t('properties.bpmn.edgeStyleGroup'), collapsed: true, position: { after: 'condition' },
|
|
183
189
|
entries: [
|
|
184
|
-
propertyEntry({ id: 'route-style', type: 'select', label: '
|
|
185
|
-
propertyEntry({ id: 'corner-radius', type: 'range', label: '
|
|
186
|
-
propertyEntry({ id: 'reset-route', type: 'action', label: '
|
|
190
|
+
propertyEntry({ id: 'route-style', type: 'select', label: t('properties.bpmn.routeStyle'), path: 'routeStyle', options: [['rounded', t('properties.bpmn.edgeStyleRounded')], ['smooth', t('properties.bpmn.edgeStyleSmooth')], ['straight', t('properties.bpmn.edgeStyleStraight')]] }),
|
|
191
|
+
propertyEntry({ id: 'corner-radius', type: 'range', label: t('properties.bpmn.cornerRadius'), path: 'cornerRadius', min: 0, max: 28, step: 1, unit: 'px' }),
|
|
192
|
+
propertyEntry({ id: 'reset-route', type: 'action', label: t('properties.bpmn.resetRouteLabel'), actionLabel: t('properties.bpmn.resetRouteActionLabel'), iconId: 'ui.routeSmooth', action: (ctx) => ctx.designer.resetEdgeRoute(ctx.element.id) }),
|
|
187
193
|
],
|
|
188
194
|
}),
|
|
189
195
|
];
|
|
@@ -194,12 +200,13 @@ const activityProvider = {
|
|
|
194
200
|
id: 'bpmn-activity',
|
|
195
201
|
priority: 700,
|
|
196
202
|
appliesTo: (ctx) => ctx.kind === 'node' && activityKinds.has(ctx.definition?.kind),
|
|
197
|
-
getGroups() {
|
|
203
|
+
getGroups(context) {
|
|
204
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
198
205
|
return [
|
|
199
206
|
propertyGroup({
|
|
200
|
-
id: 'multi-instance', label: '
|
|
207
|
+
id: 'multi-instance', label: t('properties.bpmn.multiInstanceGroup'), collapsed: true, position: { after: 'basic' },
|
|
201
208
|
entries: [
|
|
202
|
-
propertyEntry({ id: 'loop-type', type: 'select', label: '
|
|
209
|
+
propertyEntry({ id: 'loop-type', type: 'select', label: t('properties.bpmn.loopType'), path: 'properties.loopType', options: [['none', t('properties.bpmn.loopNone')], ['standard', t('properties.bpmn.loopStandard')], ['parallel', t('properties.bpmn.loopParallel')], ['sequential', t('properties.bpmn.loopSequential')]] }),
|
|
203
210
|
propertyEntry({ id: 'loop-condition', type: 'expression', label: 'Loop Condition', path: 'properties.loopCondition', placeholder: '${retry == true}', visible: (ctx) => ctx.get('properties.loopType') === 'standard' }),
|
|
204
211
|
propertyEntry({ id: 'loop-test-before', type: 'switch', label: 'Test Before', path: 'properties.testBefore', visible: (ctx) => ctx.get('properties.loopType') === 'standard' }),
|
|
205
212
|
propertyEntry({ id: 'loop-maximum', type: 'number', label: 'Loop Maximum', path: 'properties.loopMaximum', min: 0, visible: (ctx) => ctx.get('properties.loopType') === 'standard' }),
|
|
@@ -208,7 +215,7 @@ const activityProvider = {
|
|
|
208
215
|
propertyEntry({ id: 'element-index-variable', label: 'Element Index Variable', path: 'properties.elementIndexVariable', placeholder: 'index', visible: (ctx) => ['parallel', 'sequential'].includes(ctx.get('properties.loopType')) }),
|
|
209
216
|
propertyEntry({ id: 'loop-cardinality', type: 'expression', label: 'Loop Cardinality', path: 'properties.loopCardinality', placeholder: '${3}', visible: (ctx) => ['parallel', 'sequential'].includes(ctx.get('properties.loopType')) }),
|
|
210
217
|
propertyEntry({ id: 'completion-condition', type: 'expression', label: 'Completion Condition', path: 'properties.completionCondition', placeholder: '${nrOfCompletedInstances >= 2}', visible: (ctx) => ['parallel', 'sequential'].includes(ctx.get('properties.loopType')) }),
|
|
211
|
-
propertyEntry({ id: 'compensation', type: 'switch', label: '
|
|
218
|
+
propertyEntry({ id: 'compensation', type: 'switch', label: t('properties.bpmn.isForCompensation'), path: 'properties.isForCompensation' }),
|
|
212
219
|
],
|
|
213
220
|
}),
|
|
214
221
|
];
|
|
@@ -217,39 +224,46 @@ const activityProvider = {
|
|
|
217
224
|
|
|
218
225
|
const scriptProvider = {
|
|
219
226
|
id: 'bpmn-script-task', priority: 720, appliesTo: { kind: 'node', nodeType: 'scriptTask' },
|
|
220
|
-
getGroups() {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
227
|
+
getGroups(context) {
|
|
228
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
229
|
+
return [propertyGroup({ id: 'script', label: t('properties.bpmn.scriptGroup'), position: { after: 'basic' }, entries: [
|
|
230
|
+
propertyEntry({ id: 'script-format', label: 'Script Format', path: 'properties.scriptFormat', placeholder: 'javascript / groovy' }),
|
|
231
|
+
propertyEntry({ id: 'script-body', type: 'code', label: 'Script', path: 'properties.script', rows: 9, placeholder: '// script body' }),
|
|
232
|
+
propertyEntry({ id: 'script-result', label: 'Result Variable', path: 'properties.resultVariable', placeholder: 'result' }),
|
|
233
|
+
] })];
|
|
234
|
+
},
|
|
225
235
|
};
|
|
226
236
|
|
|
227
237
|
const callActivityProvider = {
|
|
228
238
|
id: 'bpmn-call-activity', priority: 720, appliesTo: { kind: 'node', nodeType: 'callActivity' },
|
|
229
|
-
getGroups() {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
239
|
+
getGroups(context) {
|
|
240
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
241
|
+
return [propertyGroup({ id: 'call-activity', label: t('properties.bpmn.callActivityGroup'), position: { after: 'basic' }, entries: [
|
|
242
|
+
propertyEntry({ id: 'called-element', type: 'process-select', label: 'Called Element', path: 'properties.calledElement', placeholder: 'Process_Sub_1', dataProvider: 'processes', allowCustom: true }),
|
|
243
|
+
propertyEntry({ id: 'called-business-key', type: 'expression', label: 'Business Key', path: 'properties.businessKey', placeholder: '${businessKey}' }),
|
|
244
|
+
propertyEntry({ id: 'inherit-business-key', type: 'switch', label: t('properties.bpmn.inheritBusinessKey'), path: 'properties.inheritBusinessKey' }),
|
|
245
|
+
propertyEntry({ id: 'inherit-variables', type: 'switch', label: t('properties.bpmn.inheritVariables'), path: 'properties.inheritVariables' }),
|
|
246
|
+
propertyEntry({ id: 'input-mapping', type: 'table', label: t('properties.bpmn.inputMapping'), path: 'properties.inParameters', rowLabel: t('properties.bpmn.inputMappingRow'), defaultRow: () => ({ source: '', sourceExpression: '', target: '' }), columns: [{ key: 'source', label: 'Source' }, { key: 'sourceExpression', label: 'Expression' }, { key: 'target', label: 'Target' }] }),
|
|
247
|
+
propertyEntry({ id: 'output-mapping', type: 'table', label: t('properties.bpmn.outputMapping'), path: 'properties.outParameters', rowLabel: t('properties.bpmn.outputMappingRow'), defaultRow: () => ({ source: '', sourceExpression: '', target: '' }), columns: [{ key: 'source', label: 'Source' }, { key: 'sourceExpression', label: 'Expression' }, { key: 'target', label: 'Target' }] }),
|
|
248
|
+
] })];
|
|
249
|
+
},
|
|
237
250
|
};
|
|
238
251
|
|
|
239
252
|
const messageTaskProvider = {
|
|
240
253
|
id: 'bpmn-message-task', priority: 725,
|
|
241
254
|
appliesTo: (ctx) => ctx.kind === 'node' && ['sendTask', 'receiveTask'].includes(ctx.element.type),
|
|
242
255
|
getGroups(context) {
|
|
256
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
243
257
|
const entries = [
|
|
244
258
|
propertyEntry({
|
|
245
259
|
id: 'message-ref', type: 'resource-select', label: 'Message Ref', path: 'properties.messageRef', resource: 'messages', allowCustom: true,
|
|
246
260
|
options: (ctx) => (ctx.model.resources?.messages || []).map((item) => ({ value: item.id, label: `${item.name || item.id} · ${item.id}` })),
|
|
247
|
-
placeholder: '
|
|
261
|
+
placeholder: t('properties.bpmn.messageRefPlaceholder'),
|
|
248
262
|
}),
|
|
249
263
|
propertyEntry({ id: 'operation-ref', label: 'Operation Ref', path: 'properties.operationRef', placeholder: 'Operation_1' }),
|
|
250
264
|
];
|
|
251
265
|
if (context.element.type === 'receiveTask') entries.push(propertyEntry({ id: 'instantiate-receive', type: 'switch', label: 'Instantiate', path: 'properties.instantiate' }));
|
|
252
|
-
return [propertyGroup({ id: 'message-task', label: context.element.type === 'sendTask' ? '
|
|
266
|
+
return [propertyGroup({ id: 'message-task', label: t(context.element.type === 'sendTask' ? 'properties.bpmn.messageSendGroup' : 'properties.bpmn.messageReceiveGroup'), position: { after: 'basic' }, entries })];
|
|
253
267
|
},
|
|
254
268
|
};
|
|
255
269
|
|
|
@@ -257,6 +271,7 @@ const subProcessProvider = {
|
|
|
257
271
|
id: 'bpmn-sub-process', priority: 710,
|
|
258
272
|
appliesTo: (ctx) => ctx.kind === 'node' && ctx.definition?.kind === 'container',
|
|
259
273
|
getGroups(context) {
|
|
274
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
260
275
|
const entries = [];
|
|
261
276
|
if (context.element.type === 'eventSubProcess') entries.push(propertyEntry({ id: 'triggered-by-event', type: 'readonly', label: 'Triggered By Event', value: 'true' }));
|
|
262
277
|
if (context.element.type === 'adHocSubProcess') entries.push(
|
|
@@ -265,36 +280,40 @@ const subProcessProvider = {
|
|
|
265
280
|
propertyEntry({ id: 'adhoc-cancel', type: 'switch', label: 'Cancel Remaining Instances', path: 'properties.cancelRemainingInstances' }),
|
|
266
281
|
);
|
|
267
282
|
if (!entries.length) return [];
|
|
268
|
-
return [propertyGroup({ id: 'sub-process', label: '
|
|
283
|
+
return [propertyGroup({ id: 'sub-process', label: t('properties.bpmn.subProcessGroup'), position: { after: 'basic' }, entries })];
|
|
269
284
|
},
|
|
270
285
|
};
|
|
271
286
|
|
|
272
287
|
const gatewayProvider = {
|
|
273
288
|
id: 'bpmn-gateway', priority: 760, appliesTo: { kind: 'node', elementKind: 'gateway' },
|
|
274
289
|
getGroups(context) {
|
|
275
|
-
const
|
|
290
|
+
const i18n = resolveI18n(context);
|
|
291
|
+
const t = (key, params) => i18n.t(key, params);
|
|
292
|
+
const role = resolveGatewayRole(context.model, context.element, { i18n });
|
|
276
293
|
const isParallel = context.element.type === 'parallelGateway';
|
|
277
294
|
const entries = [];
|
|
278
295
|
if (isParallel && context.profile === 'business') entries.push(propertyEntry({
|
|
279
|
-
id: 'parallel-role', type: 'select', label: '
|
|
296
|
+
id: 'parallel-role', type: 'select', label: t('properties.bpmn.parallelRole'), path: 'properties.gatewayDirection',
|
|
280
297
|
options: (ctx) => [
|
|
281
|
-
['Unspecified', '
|
|
282
|
-
|
|
298
|
+
['Unspecified', t('properties.bpmn.parallelRoleAuto')],
|
|
299
|
+
['Diverging', t('elementTypes.parallelDiverging')],
|
|
300
|
+
['Converging', t('elementTypes.parallelConverging')],
|
|
301
|
+
...(ctx.element.properties?.gatewayDirection === 'Mixed' ? [['Mixed', t('properties.bpmn.parallelRoleMixedDev')]] : []),
|
|
283
302
|
],
|
|
284
|
-
note: role.effective === 'Converging' ? '
|
|
303
|
+
note: role.effective === 'Converging' ? t('properties.bpmn.parallelConvergingNote') : '',
|
|
285
304
|
}));
|
|
286
|
-
if (context.profile === 'developer' || !isParallel) entries.push(propertyEntry({ id: 'gateway-direction', type: 'select', label: 'Gateway Direction', path: 'properties.gatewayDirection', options: [['Unspecified', 'Unspecified'], ['Diverging', '
|
|
305
|
+
if (context.profile === 'developer' || !isParallel) entries.push(propertyEntry({ id: 'gateway-direction', type: 'select', label: 'Gateway Direction', path: 'properties.gatewayDirection', options: [['Unspecified', 'Unspecified'], ['Diverging', t('properties.bpmn.gatewayDirectionDiverging')], ['Converging', t('properties.bpmn.gatewayDirectionConverging')], ['Mixed', 'Mixed']] }));
|
|
287
306
|
if (context.element.type === 'eventBasedGateway') entries.push(
|
|
288
307
|
propertyEntry({ id: 'instantiate', type: 'switch', label: 'Instantiate', path: 'properties.instantiate' }),
|
|
289
308
|
propertyEntry({ id: 'event-gateway-type', type: 'select', label: 'Event Gateway Type', path: 'properties.eventGatewayType', options: [['Exclusive', 'Exclusive'], ['Parallel', 'Parallel']] }),
|
|
290
309
|
);
|
|
291
310
|
if (context.element.type === 'complexGateway') entries.push(propertyEntry({ id: 'activation-condition', type: 'expression', label: 'Activation Condition', path: 'properties.activationCondition' }));
|
|
292
311
|
const groups = [];
|
|
293
|
-
if (entries.length) groups.push(propertyGroup({ id: 'gateway', label: '
|
|
312
|
+
if (entries.length) groups.push(propertyGroup({ id: 'gateway', label: t('properties.bpmn.gatewayGroup'), position: { after: 'basic' }, entries }));
|
|
294
313
|
if (!isParallel) {
|
|
295
314
|
groups.push(propertyGroup({
|
|
296
|
-
id: 'gateway-branches', label:
|
|
297
|
-
description: '
|
|
315
|
+
id: 'gateway-branches', label: t('properties.bpmn.gatewayBranchesGroup', { count: role.outgoing.length }), collapsed: false, position: { after: 'gateway' },
|
|
316
|
+
description: t('properties.bpmn.gatewayBranchesDesc'),
|
|
298
317
|
entries: [propertyEntry({
|
|
299
318
|
id: 'branches', type: 'branchList', label: '',
|
|
300
319
|
getValue: () => role.outgoing.map((edge) => ({ id: edge.id, name: edge.name || '', condition: edge.condition || '', isDefault: !!edge.isDefault, target: edge.target })),
|
|
@@ -315,8 +334,8 @@ const gatewayProvider = {
|
|
|
315
334
|
let structureAfter = 'gateway';
|
|
316
335
|
if (role.effective === 'Diverging') {
|
|
317
336
|
groups.push(propertyGroup({
|
|
318
|
-
id: 'gateway-branches', label:
|
|
319
|
-
description: '
|
|
337
|
+
id: 'gateway-branches', label: t('properties.bpmn.parallelOutgoingGroup', { count: role.outgoing.length }), collapsed: false, position: { after: 'gateway' },
|
|
338
|
+
description: t('properties.bpmn.parallelOutgoingDesc'),
|
|
320
339
|
entries: [
|
|
321
340
|
propertyEntry({
|
|
322
341
|
id: 'branches', type: 'branchList', label: '', fields: ['name'],
|
|
@@ -324,35 +343,34 @@ const gatewayProvider = {
|
|
|
324
343
|
setValue: (ctx, rows) => ctx.designer.updateEdges(rows.map((row) => ({ id: row.id, patch: { name: row.name } }))),
|
|
325
344
|
selectRow: (ctx, row) => ctx.designer.select({ kind: 'edge', id: row.id }),
|
|
326
345
|
}),
|
|
327
|
-
propertyEntry({ id: 'connect-parallel-branch', type: 'action', label: '
|
|
346
|
+
propertyEntry({ id: 'connect-parallel-branch', type: 'action', label: t('properties.bpmn.connectExistingNode'), actionLabel: t('properties.bpmn.connectParallelBranch'), iconId: 'ui.connect', action: (ctx) => ctx.designer.startConnect(ctx.element.id) }),
|
|
328
347
|
],
|
|
329
348
|
}));
|
|
330
349
|
structureAfter = 'gateway-branches';
|
|
331
350
|
} else {
|
|
332
351
|
const isJoin = role.effective === 'Converging';
|
|
333
352
|
groups.push(propertyGroup({
|
|
334
|
-
id: 'parallel-incoming', label:
|
|
335
|
-
description: isJoin ? '
|
|
336
|
-
entries: [propertyEntry({ id: 'incoming-flows', type: 'flow-list', label: '', relation: 'source', emptyText: '
|
|
353
|
+
id: 'parallel-incoming', label: t(isJoin ? 'properties.bpmn.parallelJoinIncomingGroup' : 'properties.bpmn.parallelIncomingGroup', { count: role.incoming.length }), collapsed: false, position: { after: 'gateway' },
|
|
354
|
+
description: t(isJoin ? 'properties.bpmn.parallelConvergingNote' : 'properties.bpmn.parallelIncomingAmbiguousDesc'),
|
|
355
|
+
entries: [propertyEntry({ id: 'incoming-flows', type: 'flow-list', label: '', relation: 'source', emptyText: t('properties.bpmn.parallelIncomingEmpty'), getValue: () => role.incoming })],
|
|
337
356
|
}));
|
|
338
357
|
groups.push(propertyGroup({
|
|
339
|
-
id: 'parallel-outgoing', label:
|
|
340
|
-
description: isJoin ? '
|
|
358
|
+
id: 'parallel-outgoing', label: t(isJoin ? 'properties.bpmn.parallelJoinOutgoingGroup' : 'properties.bpmn.parallelOutgoingAmbiguousGroup', { count: role.outgoing.length }), collapsed: false, position: { after: 'parallel-incoming' },
|
|
359
|
+
description: t(isJoin ? 'properties.bpmn.parallelJoinOutgoingDesc' : 'properties.bpmn.parallelOutgoingAmbiguousDesc'),
|
|
341
360
|
entries: [
|
|
342
|
-
propertyEntry({ id: 'outgoing-flows', type: 'flow-list', label: '', relation: 'target', emptyText: '
|
|
343
|
-
...(isJoin && role.outgoing.length === 0 ? [propertyEntry({ id: 'connect-parallel-next', type: 'action', label: '
|
|
361
|
+
propertyEntry({ id: 'outgoing-flows', type: 'flow-list', label: '', relation: 'target', emptyText: t('properties.bpmn.parallelOutgoingEmpty'), getValue: () => role.outgoing }),
|
|
362
|
+
...(isJoin && role.outgoing.length === 0 ? [propertyEntry({ id: 'connect-parallel-next', type: 'action', label: t('properties.bpmn.connectParallelNext'), actionLabel: t('properties.bpmn.connectParallelNext'), iconId: 'ui.connect', action: (ctx) => ctx.designer.startConnect(ctx.element.id) })] : []),
|
|
344
363
|
],
|
|
345
364
|
}));
|
|
346
365
|
structureAfter = 'parallel-outgoing';
|
|
347
366
|
}
|
|
348
367
|
|
|
349
|
-
const statusLabels = { valid: '结构正常', incomplete: '结构未完成', conflict: '结构冲突', ambiguous: '角色待判断' };
|
|
350
368
|
groups.push(propertyGroup({
|
|
351
|
-
id: 'parallel-structure', label: '
|
|
369
|
+
id: 'parallel-structure', label: t('properties.bpmn.parallelStructureGroup'), collapsed: false, position: { after: structureAfter },
|
|
352
370
|
entries: [
|
|
353
|
-
propertyEntry({ id: 'parallel-structure-summary', type: 'readonly', label: '
|
|
354
|
-
propertyEntry({ id: 'parallel-structure-status', type: 'readonly', label: '
|
|
355
|
-
...(role.issues.length ? [propertyEntry({ id: 'parallel-structure-issues', type: 'readonly', label: '
|
|
371
|
+
propertyEntry({ id: 'parallel-structure-summary', type: 'readonly', label: t('properties.bpmn.parallelStructureSummaryLabel'), value: t('properties.bpmn.parallelStructureSummaryValue', { incoming: role.incoming.length, outgoing: role.outgoing.length }) }),
|
|
372
|
+
propertyEntry({ id: 'parallel-structure-status', type: 'readonly', label: t('properties.bpmn.parallelStructureStatusLabel'), variant: role.status, value: t(`canvas.gatewayRoleStatus.${role.status}`) }),
|
|
373
|
+
...(role.issues.length ? [propertyEntry({ id: 'parallel-structure-issues', type: 'readonly', label: t('properties.bpmn.parallelStructureIssuesLabel'), variant: role.status, value: role.issues.join(t('common.issueSeparator')) })] : []),
|
|
356
374
|
],
|
|
357
375
|
}));
|
|
358
376
|
return groups;
|
|
@@ -363,19 +381,20 @@ const eventProvider = {
|
|
|
363
381
|
id: 'bpmn-events', priority: 750,
|
|
364
382
|
appliesTo: (ctx) => ctx.kind === 'node' && ['event', 'boundary'].includes(ctx.definition?.kind),
|
|
365
383
|
getGroups(context) {
|
|
384
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
366
385
|
const def = context.definition;
|
|
367
386
|
const entries = [];
|
|
368
387
|
if (def.eventDefinition === 'timer') entries.push(
|
|
369
|
-
propertyEntry({ id: 'timer-type', type: 'select', label: '
|
|
370
|
-
propertyEntry({ id: 'timer-value', type: 'expression', label: '
|
|
388
|
+
propertyEntry({ id: 'timer-type', type: 'select', label: t('properties.bpmn.timerType'), path: 'properties.timerType', options: [['duration', 'Duration'], ['date', 'Date'], ['cycle', 'Cycle']] }),
|
|
389
|
+
propertyEntry({ id: 'timer-value', type: 'expression', label: t('properties.bpmn.timerValue'), path: 'properties.timerValue', placeholder: 'PT1H / 2026-08-26T09:00 / R3/PT10M' }),
|
|
371
390
|
);
|
|
372
|
-
if (def.eventDefinition === 'conditional') entries.push(propertyEntry({ id: 'event-condition', type: 'expression', label: '
|
|
391
|
+
if (def.eventDefinition === 'conditional') entries.push(propertyEntry({ id: 'event-condition', type: 'expression', label: t('properties.bpmn.conditionExpression'), path: 'properties.condition', placeholder: '${approved == true}' }));
|
|
373
392
|
if (eventRefs[def.eventDefinition]) {
|
|
374
393
|
const meta = eventRefs[def.eventDefinition];
|
|
375
394
|
entries.push(propertyEntry({
|
|
376
|
-
id: 'event-ref', type: 'resource-select', label: meta.
|
|
395
|
+
id: 'event-ref', type: 'resource-select', label: t(meta.labelKey), path: 'properties.eventRef', resource: meta.resource, allowCustom: true,
|
|
377
396
|
options: (ctx) => (ctx.model.resources?.[meta.resource] || []).map((item) => ({ value: item.id, label: `${item.name || item.id} · ${item.id}` })),
|
|
378
|
-
placeholder: '
|
|
397
|
+
placeholder: t('properties.bpmn.eventRefPlaceholder'),
|
|
379
398
|
}));
|
|
380
399
|
}
|
|
381
400
|
if (def.eventDefinition === 'link') entries.push(propertyEntry({ id: 'link-name', label: 'Link Name', path: 'properties.eventRef', placeholder: 'Link_A' }));
|
|
@@ -386,12 +405,12 @@ const eventProvider = {
|
|
|
386
405
|
if ((def.eventStage === 'start' || (def.eventStage === 'intermediate' && def.eventRole === 'catch')) && ['message', 'signal'].includes(def.eventDefinition)) {
|
|
387
406
|
entries.push(propertyEntry({ id: 'parallel-multiple', type: 'switch', label: 'Parallel Multiple', path: 'properties.parallelMultiple' }));
|
|
388
407
|
}
|
|
389
|
-
if (!entries.length) entries.push(propertyEntry({ id: 'event-info', type: 'readonly', label: '
|
|
390
|
-
const groups = [propertyGroup({ id: 'event-definition', label: '
|
|
408
|
+
if (!entries.length) entries.push(propertyEntry({ id: 'event-info', type: 'readonly', label: t('properties.bpmn.eventDefinition'), getValue: () => def.eventDefinition ? def.eventDefinition : 'None' }));
|
|
409
|
+
const groups = [propertyGroup({ id: 'event-definition', label: t('properties.bpmn.eventDefinition'), position: { after: 'basic' }, entries })];
|
|
391
410
|
if (def.kind === 'boundary') groups.push(propertyGroup({
|
|
392
|
-
id: 'boundary', label: '
|
|
393
|
-
propertyEntry({ id: 'attached-to', type: 'node-select', label: '
|
|
394
|
-
propertyEntry({ id: 'cancel-activity', type: 'switch', label: '
|
|
411
|
+
id: 'boundary', label: t('properties.bpmn.boundaryGroup'), position: { after: 'event-definition' }, entries: [
|
|
412
|
+
propertyEntry({ id: 'attached-to', type: 'node-select', label: t('properties.bpmn.attachedToRef'), path: 'properties.attachedToRef', nodeFilter: (node) => activityKinds.has(NODE_DEFINITIONS[node.type]?.kind) }),
|
|
413
|
+
propertyEntry({ id: 'cancel-activity', type: 'switch', label: t('properties.bpmn.cancelActivity'), path: 'properties.cancelActivity' }),
|
|
395
414
|
],
|
|
396
415
|
}));
|
|
397
416
|
return groups;
|
|
@@ -402,60 +421,61 @@ const artifactProvider = {
|
|
|
402
421
|
id: 'bpmn-artifacts', priority: 730,
|
|
403
422
|
appliesTo: (ctx) => ctx.kind === 'node' && ['data', 'dataStore', 'annotation', 'group', 'participant', 'lane'].includes(ctx.definition?.kind),
|
|
404
423
|
getGroups(context) {
|
|
424
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
405
425
|
const type = context.element.type;
|
|
406
426
|
const entries = [];
|
|
407
|
-
if (type === 'textAnnotation') entries.push(propertyEntry({ id: 'annotation-text', type: 'textarea', label: '
|
|
427
|
+
if (type === 'textAnnotation') entries.push(propertyEntry({ id: 'annotation-text', type: 'textarea', label: t('properties.bpmn.annotationText'), path: 'properties.text', rows: 6 }), propertyEntry({ id: 'annotation-format', label: 'Text Format', path: 'properties.textFormat', placeholder: 'text/plain' }));
|
|
408
428
|
if (type === 'dataObjectReference') entries.push(propertyEntry({ id: 'data-object-ref', label: 'Data Object Ref', path: 'properties.dataObjectRef' }), propertyEntry({ id: 'data-state', label: 'Data State', path: 'properties.dataState' }));
|
|
409
429
|
if (type === 'dataStoreReference') entries.push(propertyEntry({ id: 'data-store-ref', label: 'Data Store Ref', path: 'properties.dataStoreRef' }), propertyEntry({ id: 'data-state', label: 'Data State', path: 'properties.dataState' }));
|
|
410
430
|
if (type === 'participant') entries.push(
|
|
411
431
|
propertyEntry({
|
|
412
|
-
id: 'swimlane-label-placement', type: 'select', label: '
|
|
413
|
-
options: [['side', '
|
|
414
|
-
note: '
|
|
432
|
+
id: 'swimlane-label-placement', type: 'select', label: t('properties.bpmn.swimlaneLabelPlacement'), path: 'properties.swimlaneLabelPlacement', defaultValue: 'side',
|
|
433
|
+
options: [['side', t('properties.bpmn.swimlaneSide')], ['top', t('properties.bpmn.swimlaneTop')]],
|
|
434
|
+
note: t('properties.bpmn.swimlanePoolNote'),
|
|
415
435
|
}),
|
|
416
436
|
propertyEntry({ id: 'process-ref', label: 'Process Ref', path: 'properties.processRef' }),
|
|
417
437
|
);
|
|
418
438
|
if (type === 'lane') entries.push(
|
|
419
439
|
context.element.containerId
|
|
420
440
|
? propertyEntry({
|
|
421
|
-
id: 'swimlane-label-placement-inherited', type: 'readonly', label: '
|
|
422
|
-
getValue: (ctx) => resolveSwimlaneLabelPlacement(ctx.model, ctx.element) === 'top' ? '
|
|
423
|
-
note: '
|
|
441
|
+
id: 'swimlane-label-placement-inherited', type: 'readonly', label: t('properties.bpmn.swimlaneLabelPlacement'),
|
|
442
|
+
getValue: (ctx) => resolveI18n(ctx).t(resolveSwimlaneLabelPlacement(ctx.model, ctx.element) === 'top' ? 'properties.bpmn.swimlaneTopInherited' : 'properties.bpmn.swimlaneSideInherited'),
|
|
443
|
+
note: t('properties.bpmn.swimlaneLaneInheritedNote'),
|
|
424
444
|
})
|
|
425
445
|
: propertyEntry({
|
|
426
|
-
id: 'swimlane-label-placement', type: 'select', label: '
|
|
427
|
-
options: [['side', '
|
|
428
|
-
note: '
|
|
446
|
+
id: 'swimlane-label-placement', type: 'select', label: t('properties.bpmn.swimlaneLabelPlacement'), path: 'properties.swimlaneLabelPlacement', defaultValue: 'side',
|
|
447
|
+
options: [['side', t('properties.bpmn.swimlaneSide')], ['top', t('properties.bpmn.swimlaneTop')]],
|
|
448
|
+
note: t('properties.bpmn.swimlaneLaneLocalNote'),
|
|
429
449
|
}),
|
|
430
|
-
propertyEntry({ id: 'lane-members', type: 'node-list', label: '
|
|
450
|
+
propertyEntry({ id: 'lane-members', type: 'node-list', label: t('properties.bpmn.laneMembers'), getValue: (ctx) => ctx.element.properties?.flowNodeRefs || [], note: t('properties.bpmn.laneMembersNote') }),
|
|
431
451
|
);
|
|
432
452
|
if (type === 'group') entries.push(propertyEntry({ id: 'category-value', label: 'Category Value', path: 'properties.categoryValue', placeholder: context.element.name }));
|
|
433
|
-
return entries.length ? [propertyGroup({ id: 'artifact', label: '
|
|
453
|
+
return entries.length ? [propertyGroup({ id: 'artifact', label: t('properties.bpmn.artifactGroup'), position: { after: 'basic' }, entries })] : [];
|
|
434
454
|
},
|
|
435
455
|
};
|
|
436
456
|
|
|
437
|
-
|
|
438
|
-
|
|
439
457
|
const nonSequenceEdgeProvider = {
|
|
440
458
|
id: 'bpmn-non-sequence-edge', priority: 845,
|
|
441
459
|
appliesTo: (ctx) => ctx.kind === 'edge' && ['messageFlow', 'association'].includes(ctx.element.type),
|
|
442
460
|
getGroups(context) {
|
|
461
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
443
462
|
const entries = context.element.type === 'messageFlow'
|
|
444
463
|
? [propertyEntry({
|
|
445
464
|
id: 'message-flow-ref', type: 'resource-select', label: 'Message Ref', path: 'properties.messageRef', resource: 'messages', allowCustom: true,
|
|
446
465
|
options: (ctx) => (ctx.model.resources?.messages || []).map((item) => ({ value: item.id, label: `${item.name || item.id} · ${item.id}` })),
|
|
447
466
|
})]
|
|
448
467
|
: [propertyEntry({ id: 'association-direction', type: 'select', label: 'Association Direction', path: 'properties.associationDirection', options: [['None', 'None'], ['One', 'One'], ['Both', 'Both']] })];
|
|
449
|
-
return [propertyGroup({ id: 'edge-semantics', label: context.element.type === 'messageFlow' ? '
|
|
468
|
+
return [propertyGroup({ id: 'edge-semantics', label: t(context.element.type === 'messageFlow' ? 'edgeTypes.messageFlow' : 'edgeTypes.association'), position: { after: 'basic' }, entries })];
|
|
450
469
|
},
|
|
451
470
|
};
|
|
452
471
|
|
|
453
472
|
const extensionElementsProvider = {
|
|
454
473
|
id: 'bpmn-extension-elements', priority: 110,
|
|
455
474
|
getGroups(context) {
|
|
475
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
456
476
|
return [propertyGroup({
|
|
457
477
|
id: 'extension-elements', label: 'Extension Elements', collapsed: true, position: { append: true },
|
|
458
|
-
description: '
|
|
478
|
+
description: t('properties.bpmn.extensionElementsDesc'),
|
|
459
479
|
entries: [propertyEntry({
|
|
460
480
|
id: 'raw-extension-elements', type: 'table', label: 'Raw XML',
|
|
461
481
|
getValue: (ctx) => (ctx.get('extensionElements', []) || []).map((xml) => ({ xml })),
|
|
@@ -469,15 +489,16 @@ const extensionElementsProvider = {
|
|
|
469
489
|
const extensionAttributesProvider = {
|
|
470
490
|
id: 'bpmn-extension-attributes', priority: 120,
|
|
471
491
|
getGroups(context) {
|
|
492
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
472
493
|
const rootPath = 'properties.extensionAttributes';
|
|
473
494
|
return [propertyGroup({
|
|
474
|
-
id: 'extension-attributes', label: '
|
|
475
|
-
description: '
|
|
495
|
+
id: 'extension-attributes', label: t('properties.bpmn.extensionAttributesGroup'), collapsed: true, position: { append: true },
|
|
496
|
+
description: t('properties.bpmn.extensionAttributesDesc'),
|
|
476
497
|
entries: [propertyEntry({
|
|
477
498
|
id: 'extension-attribute-table', type: 'table', label: 'Custom Attributes',
|
|
478
499
|
getValue: (ctx) => Object.entries(ctx.get(rootPath, {}) || {}).map(([name, value]) => ({ name, value })),
|
|
479
500
|
setValue: (ctx, rows) => ctx.set(rootPath, Object.fromEntries((rows || []).filter((row) => row.name).map((row) => [row.name, row.value || '']))),
|
|
480
|
-
rowLabel: '
|
|
501
|
+
rowLabel: t('properties.bpmn.extensionAttributeRow'), defaultRow: () => ({ name: 'company:property', value: '' }), columns: [{ key: 'name', label: 'QName' }, { key: 'value', label: 'Value' }],
|
|
481
502
|
})],
|
|
482
503
|
})];
|
|
483
504
|
},
|
|
@@ -486,13 +507,15 @@ const extensionAttributesProvider = {
|
|
|
486
507
|
const destructiveActionsProvider = {
|
|
487
508
|
id: 'bpmn-actions', priority: 20,
|
|
488
509
|
appliesTo: (ctx) => ctx.kind === 'node' || ctx.kind === 'edge',
|
|
489
|
-
getGroups() {
|
|
510
|
+
getGroups(context) {
|
|
511
|
+
const t = (key, params) => resolveI18n(context).t(key, params);
|
|
490
512
|
return [propertyGroup({
|
|
491
|
-
id: 'element-actions', label: '
|
|
492
|
-
entries: [propertyEntry({ id: 'delete-element', type: 'action', label: '
|
|
513
|
+
id: 'element-actions', label: t('properties.bpmn.elementActionsGroup'), collapsed: true, position: { append: true },
|
|
514
|
+
entries: [propertyEntry({ id: 'delete-element', type: 'action', label: t('properties.bpmn.deleteElementLabel'), actionLabel: t('properties.bpmn.deleteElementAction'), variant: 'danger', action: (ctx) => ctx.studio.commands.remove() })],
|
|
493
515
|
})];
|
|
494
516
|
},
|
|
495
517
|
};
|
|
518
|
+
|
|
496
519
|
export const bpmnPropertiesProviders = [
|
|
497
520
|
basicProvider,
|
|
498
521
|
processProvider,
|