@bpmnkit/core 1.9.0 → 1.10.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/agent-cards/bpmn.md +3 -3
- package/builder-reference.md +11 -9
- package/dist/bpmn/auto-layout.js +82 -26
- package/dist/bpmn/bpmn-builder.d.ts +84 -7
- package/dist/bpmn/bpmn-builder.js +313 -78
- package/dist/bpmn/bpmn-model.d.ts +2 -0
- package/dist/bpmn/bpmn-parser.js +68 -76
- package/dist/bpmn/bpmn-serializer.js +60 -19
- package/dist/bpmn/bpmnlint.js +4 -69
- package/dist/bpmn/builder-rules.d.ts +20 -0
- package/dist/bpmn/builder-rules.js +120 -0
- package/dist/bpmn/camunda-compat-data.d.ts +10 -148
- package/dist/bpmn/camunda-compat-data.js +16 -407
- package/dist/bpmn/camunda-compat-feel.d.ts +3 -0
- package/dist/bpmn/camunda-compat-feel.js +1 -1
- package/dist/bpmn/camunda-compat.js +7 -6
- package/dist/bpmn/camunda7/export.js +4 -1
- package/dist/bpmn/camunda7/juel.js +2 -1
- package/dist/bpmn/camunda7/migrate.d.ts +23 -0
- package/dist/bpmn/camunda7/migrate.js +75 -3
- package/dist/bpmn/compact-stream.js +2 -1
- package/dist/bpmn/compact.d.ts +80 -4
- package/dist/bpmn/compact.js +220 -38
- package/dist/bpmn/feel-condition.d.ts +9 -0
- package/dist/bpmn/feel-condition.js +19 -0
- package/dist/bpmn/full-operations.js +31 -4
- package/dist/bpmn/index.d.ts +13 -3
- package/dist/bpmn/index.js +16 -15
- package/dist/bpmn/operations.d.ts +4 -4
- package/dist/bpmn/operations.js +14 -2
- package/dist/bpmn/optimize/bpmnlint-rules.js +7 -40
- package/dist/bpmn/optimize/index.js +15 -1
- package/dist/bpmn/optimize/tasks.js +12 -3
- package/dist/bpmn/process-delta.d.ts +18 -0
- package/dist/bpmn/process-delta.js +20 -2
- package/dist/bpmn/process-text-writer.js +27 -1
- package/dist/bpmn/process-text.d.ts +9 -3
- package/dist/bpmn/process-text.js +122 -16
- package/dist/bpmn/stable-ids.d.ts +2 -0
- package/dist/bpmn/stable-ids.js +8 -0
- package/dist/bpmn/zeebe-extensions.js +2 -1
- package/dist/bpmn/zeebe-placement.js +6 -129
- package/dist/bpmn/zeebe-validate/context.d.ts +132 -0
- package/dist/bpmn/zeebe-validate/context.js +241 -0
- package/dist/bpmn/zeebe-validate/gate.d.ts +87 -0
- package/dist/bpmn/zeebe-validate/gate.js +492 -0
- package/dist/bpmn/zeebe-validate/index.d.ts +37 -0
- package/dist/bpmn/zeebe-validate/index.js +106 -0
- package/dist/bpmn/zeebe-validate/rules/events.d.ts +4 -0
- package/dist/bpmn/zeebe-validate/rules/events.js +580 -0
- package/dist/bpmn/zeebe-validate/rules/extensions.d.ts +4 -0
- package/dist/bpmn/zeebe-validate/rules/extensions.js +411 -0
- package/dist/bpmn/zeebe-validate/rules/gateways.d.ts +3 -0
- package/dist/bpmn/zeebe-validate/rules/gateways.js +296 -0
- package/dist/bpmn/zeebe-validate/rules/references.d.ts +3 -0
- package/dist/bpmn/zeebe-validate/rules/references.js +495 -0
- package/dist/bpmn/zeebe-validate/rules/structure.d.ts +3 -0
- package/dist/bpmn/zeebe-validate/rules/structure.js +629 -0
- package/dist/bpmn/zeebe-validate/rules/tasks.d.ts +4 -0
- package/dist/bpmn/zeebe-validate/rules/tasks.js +446 -0
- package/dist/bpmn/zeebe-validate/xml.d.ts +15 -0
- package/dist/bpmn/zeebe-validate/xml.js +1062 -0
- package/dist/bpmn/zeebe-validate/xsd.d.ts +19 -0
- package/dist/bpmn/zeebe-validate/xsd.js +350 -0
- package/dist/connectors/aliases.js +1 -0
- package/dist/connectors/apply-element.d.ts +5 -2
- package/dist/connectors/apply-element.js +6 -0
- package/dist/connectors/apply-many.d.ts +9 -2
- package/dist/connectors/apply-many.js +17 -2
- package/dist/connectors/apply.d.ts +4 -2
- package/dist/connectors/deployability.d.ts +27 -0
- package/dist/connectors/deployability.js +41 -0
- package/dist/connectors/index.d.ts +1 -0
- package/dist/connectors/lines.d.ts +10 -0
- package/dist/connectors/lines.js +13 -4
- package/dist/connectors/templates/generated.js +10101 -3188
- package/dist/dmn/dmn-model.d.ts +24 -4
- package/dist/dmn/dmn-parser.js +37 -3
- package/dist/dmn/dmn-serializer.js +48 -47
- package/dist/dmn/lint.js +4 -11
- package/dist/errors.d.ts +30 -1
- package/dist/errors.js +31 -0
- package/dist/form/form-model.d.ts +11 -0
- package/dist/form/form-parser.d.ts +1 -0
- package/dist/form/form-parser.js +48 -12
- package/dist/form/form-serializer.js +40 -17
- package/dist/form/lint.js +6 -40
- package/dist/generated/bpmn-elements.d.ts +5 -0
- package/dist/generated/bpmn-elements.js +151 -0
- package/dist/generated/camunda-compat-data.d.ts +148 -0
- package/dist/generated/camunda-compat-data.js +371 -0
- package/dist/generated/dmn-elements.d.ts +12 -0
- package/dist/generated/dmn-elements.js +45 -0
- package/dist/generated/form-elements.d.ts +5 -0
- package/dist/generated/form-elements.js +45 -0
- package/dist/generated/lint-rules.d.ts +17 -0
- package/dist/generated/lint-rules.js +116 -0
- package/dist/generated/zeebe-elements.d.ts +10 -0
- package/dist/generated/zeebe-elements.js +168 -0
- package/dist/generated/zeebe-rules.d.ts +25 -0
- package/dist/generated/zeebe-rules.js +202 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +4 -1
- package/dist/layout/annotations.js +21 -1
- package/dist/layout/orthogonal.js +9 -3
- package/dist/plan/compile.d.ts +26 -1
- package/dist/plan/compile.js +48 -6
- package/dist/plan/merge.d.ts +2 -1
- package/dist/plan/merge.js +13 -5
- package/package.json +2 -2
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { parseExpression } from "@bpmnkit/feel";
|
|
2
|
+
import { ZEEBE_LATEST_VERSION, ZEEBE_RULES, } from "../../generated/zeebe-rules.js";
|
|
3
|
+
import { CAMUNDA_COMPAT_VERSIONS } from "../camunda-compat-data.js";
|
|
4
|
+
import { normalizeCamundaVersion } from "../camunda-compat.js";
|
|
5
|
+
export const ZEEBE_NS = "http://camunda.org/schema/zeebe/1.0";
|
|
6
|
+
export const DEFAULT_ZEEBE_LIMITS = {
|
|
7
|
+
maxIdLength: 32768,
|
|
8
|
+
maxNameLength: 32768,
|
|
9
|
+
maxWorkerTypeLength: 32768,
|
|
10
|
+
};
|
|
11
|
+
function isContainer(el) {
|
|
12
|
+
return "flowElements" in el && Array.isArray(el.flowElements);
|
|
13
|
+
}
|
|
14
|
+
function scopeKind(el) {
|
|
15
|
+
if (el.type === "eventSubProcess")
|
|
16
|
+
return "eventSubProcess";
|
|
17
|
+
if (el.type === "subProcess" && el.triggeredByEvent === true)
|
|
18
|
+
return "eventSubProcess";
|
|
19
|
+
if (el.type === "adHocSubProcess")
|
|
20
|
+
return "adHocSubProcess";
|
|
21
|
+
if (el.type === "transaction")
|
|
22
|
+
return "transaction";
|
|
23
|
+
return "subProcess";
|
|
24
|
+
}
|
|
25
|
+
const RULE_INDEX = new Map(ZEEBE_RULES.map((r, i) => [r.name, i]));
|
|
26
|
+
const RULE_META = new Map(ZEEBE_RULES.map((r) => [r.name, r]));
|
|
27
|
+
function rank(version) {
|
|
28
|
+
return CAMUNDA_COMPAT_VERSIONS.indexOf(version);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Everything a check needs, built once per validation: the scopes (recursive),
|
|
32
|
+
* every flow node and sequence flow with its scope, the root elements by id,
|
|
33
|
+
* and the document order findings are sorted by.
|
|
34
|
+
*/
|
|
35
|
+
export class ZeebeContext {
|
|
36
|
+
defs;
|
|
37
|
+
/** The `major.minor` being validated for. */
|
|
38
|
+
version;
|
|
39
|
+
limits;
|
|
40
|
+
resolver;
|
|
41
|
+
scopes = [];
|
|
42
|
+
nodes = [];
|
|
43
|
+
flows = [];
|
|
44
|
+
nodeIndex = new Map();
|
|
45
|
+
flowIndex = new Map();
|
|
46
|
+
order = new Map();
|
|
47
|
+
findings = [];
|
|
48
|
+
constructor(defs, options = {}) {
|
|
49
|
+
this.defs = defs;
|
|
50
|
+
this.version = normalizeCamundaVersion(options.camundaVersion) ?? ZEEBE_LATEST_VERSION;
|
|
51
|
+
this.limits = { ...DEFAULT_ZEEBE_LIMITS, ...options.limits };
|
|
52
|
+
this.resolver = options.resolver;
|
|
53
|
+
for (const process of defs.processes) {
|
|
54
|
+
this.mark(process.id);
|
|
55
|
+
this.walk({
|
|
56
|
+
kind: "process",
|
|
57
|
+
id: process.id,
|
|
58
|
+
processId: process.id,
|
|
59
|
+
flowElements: process.flowElements,
|
|
60
|
+
sequenceFlows: process.sequenceFlows,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
for (const el of [...defs.messages, ...defs.errors, ...defs.signals, ...defs.escalations])
|
|
64
|
+
this.mark(el.id);
|
|
65
|
+
}
|
|
66
|
+
mark(id) {
|
|
67
|
+
if (!this.order.has(id))
|
|
68
|
+
this.order.set(id, this.order.size);
|
|
69
|
+
}
|
|
70
|
+
walk(scope) {
|
|
71
|
+
this.scopes.push(scope);
|
|
72
|
+
for (const node of scope.flowElements) {
|
|
73
|
+
const entry = { node, scope };
|
|
74
|
+
this.nodes.push(entry);
|
|
75
|
+
if (!this.nodeIndex.has(node.id))
|
|
76
|
+
this.nodeIndex.set(node.id, entry);
|
|
77
|
+
this.mark(node.id);
|
|
78
|
+
if (isContainer(node)) {
|
|
79
|
+
this.walk({
|
|
80
|
+
kind: scopeKind(node),
|
|
81
|
+
id: node.id,
|
|
82
|
+
processId: scope.processId,
|
|
83
|
+
container: node,
|
|
84
|
+
parent: scope,
|
|
85
|
+
flowElements: node.flowElements,
|
|
86
|
+
sequenceFlows: node.sequenceFlows,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
for (const flow of scope.sequenceFlows) {
|
|
91
|
+
const entry = { flow, scope };
|
|
92
|
+
this.flows.push(entry);
|
|
93
|
+
if (!this.flowIndex.has(flow.id))
|
|
94
|
+
this.flowIndex.set(flow.id, entry);
|
|
95
|
+
this.mark(flow.id);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** Whether the rule applies to the version being validated. */
|
|
99
|
+
applies(rule) {
|
|
100
|
+
const meta = RULE_META.get(rule);
|
|
101
|
+
if (meta === undefined)
|
|
102
|
+
return false;
|
|
103
|
+
const v = rank(this.version);
|
|
104
|
+
if (v < rank(meta.since))
|
|
105
|
+
return false;
|
|
106
|
+
return meta.until === undefined || v <= rank(meta.until);
|
|
107
|
+
}
|
|
108
|
+
node(id) {
|
|
109
|
+
return id === undefined ? undefined : this.nodeIndex.get(id);
|
|
110
|
+
}
|
|
111
|
+
flow(id) {
|
|
112
|
+
return id === undefined ? undefined : this.flowIndex.get(id);
|
|
113
|
+
}
|
|
114
|
+
/** Sequence flows whose `targetRef` is the node, as Zeebe's model computes them. */
|
|
115
|
+
incoming(nodeId) {
|
|
116
|
+
return this.flows.filter((f) => f.flow.targetRef === nodeId);
|
|
117
|
+
}
|
|
118
|
+
/** Sequence flows whose `sourceRef` is the node. */
|
|
119
|
+
outgoing(nodeId) {
|
|
120
|
+
return this.flows.filter((f) => f.flow.sourceRef === nodeId);
|
|
121
|
+
}
|
|
122
|
+
/** Boundary events attached to the activity. */
|
|
123
|
+
boundaries(activityId) {
|
|
124
|
+
return this.nodes.filter((n) => n.node.type === "boundaryEvent" && n.node.attachedToRef === activityId);
|
|
125
|
+
}
|
|
126
|
+
message(id) {
|
|
127
|
+
return id === undefined ? undefined : this.defs.messages.find((m) => m.id === localRef(id));
|
|
128
|
+
}
|
|
129
|
+
error(id) {
|
|
130
|
+
return id === undefined ? undefined : this.defs.errors.find((m) => m.id === localRef(id));
|
|
131
|
+
}
|
|
132
|
+
signal(id) {
|
|
133
|
+
return id === undefined ? undefined : this.defs.signals.find((m) => m.id === localRef(id));
|
|
134
|
+
}
|
|
135
|
+
escalation(id) {
|
|
136
|
+
return id === undefined ? undefined : this.defs.escalations.find((m) => m.id === localRef(id));
|
|
137
|
+
}
|
|
138
|
+
/** Whether an element name such as `zeebe:taskDefinition` is in the Zeebe namespace. */
|
|
139
|
+
isZeebe(name, local) {
|
|
140
|
+
const colon = name.indexOf(":");
|
|
141
|
+
if (colon < 0)
|
|
142
|
+
return false;
|
|
143
|
+
if (name.slice(colon + 1) !== local)
|
|
144
|
+
return false;
|
|
145
|
+
const prefix = name.slice(0, colon);
|
|
146
|
+
return ((this.defs.namespaces[prefix] ?? (prefix === "zeebe" ? ZEEBE_NS : undefined)) === ZEEBE_NS);
|
|
147
|
+
}
|
|
148
|
+
/** The `zeebe:<local>` children of an element's `extensionElements`. */
|
|
149
|
+
zeebe(el, local) {
|
|
150
|
+
return (el?.extensionElements ?? []).filter((x) => this.isZeebe(x.name, local));
|
|
151
|
+
}
|
|
152
|
+
/** The `zeebe:<local>` children of an XML element. */
|
|
153
|
+
zeebeChildren(el, local) {
|
|
154
|
+
return (el?.children ?? []).filter((x) => this.isZeebe(x.name, local));
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Reports a rule violation. Dropped when the rule does not apply to the
|
|
158
|
+
* version, so a check never tests the version itself.
|
|
159
|
+
*/
|
|
160
|
+
report(rule, elementId, message, suggestion, processId = this.processOf(elementId)) {
|
|
161
|
+
const meta = RULE_META.get(rule);
|
|
162
|
+
if (meta === undefined || !this.applies(rule))
|
|
163
|
+
return;
|
|
164
|
+
this.findings.push({
|
|
165
|
+
id: `zeebe/${rule}`,
|
|
166
|
+
category: "deploy",
|
|
167
|
+
severity: meta.severity,
|
|
168
|
+
message,
|
|
169
|
+
suggestion,
|
|
170
|
+
processId,
|
|
171
|
+
elementIds: [elementId],
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/** The process an element belongs to; root elements answer the first process. */
|
|
175
|
+
processOf(elementId) {
|
|
176
|
+
const node = this.nodeIndex.get(elementId) ?? this.flowIndex.get(elementId);
|
|
177
|
+
if (node !== undefined)
|
|
178
|
+
return node.scope.processId;
|
|
179
|
+
if (this.defs.processes.some((p) => p.id === elementId))
|
|
180
|
+
return elementId;
|
|
181
|
+
return this.defs.processes[0]?.id ?? "";
|
|
182
|
+
}
|
|
183
|
+
/** The findings, deduplicated and sorted by rule, then document order, then message. */
|
|
184
|
+
finish() {
|
|
185
|
+
const seen = new Set();
|
|
186
|
+
const unique = this.findings.filter((f) => {
|
|
187
|
+
const key = `${f.id}\u0000${f.elementIds.join(",")}\u0000${f.message}`;
|
|
188
|
+
if (seen.has(key))
|
|
189
|
+
return false;
|
|
190
|
+
seen.add(key);
|
|
191
|
+
return true;
|
|
192
|
+
});
|
|
193
|
+
const pos = (id) => (id === undefined ? undefined : this.order.get(id)) ?? Number.MAX_SAFE_INTEGER;
|
|
194
|
+
return unique.sort((a, b) => (RULE_INDEX.get(a.id.slice(6)) ?? 0) - (RULE_INDEX.get(b.id.slice(6)) ?? 0) ||
|
|
195
|
+
pos(a.elementIds[0]) - pos(b.elementIds[0]) ||
|
|
196
|
+
(a.message < b.message ? -1 : a.message > b.message ? 1 : 0));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* A reference with its QName prefix removed: Zeebe resolves `messageRef="bpmn:m"`
|
|
201
|
+
* to `m`. Ids are NCNames, so they never contain a colon themselves.
|
|
202
|
+
*/
|
|
203
|
+
export function localRef(ref) {
|
|
204
|
+
const colon = ref.lastIndexOf(":");
|
|
205
|
+
return colon < 0 ? ref : ref.slice(colon + 1);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Whether a Zeebe expression attribute is an expression rather than a static value:
|
|
209
|
+
* Zeebe's `FeelExpressionLanguage` matches the whole text against `=(.+)`, so a
|
|
210
|
+
* leading space or a lone `=` makes it static.
|
|
211
|
+
*/
|
|
212
|
+
export function isExpression(text) {
|
|
213
|
+
return text.length > 1 && text.startsWith("=");
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The FEEL parse error of an expression attribute, or `undefined` when it parses
|
|
217
|
+
* or is a static value. Only the part after `=` is FEEL.
|
|
218
|
+
*/
|
|
219
|
+
export function feelError(text) {
|
|
220
|
+
if (!isExpression(text))
|
|
221
|
+
return undefined;
|
|
222
|
+
const body = text.slice(1);
|
|
223
|
+
const { errors } = parseExpression(body);
|
|
224
|
+
return errors.length === 0 ? undefined : (errors[0]?.message ?? "invalid FEEL");
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Zeebe's message for a FEEL parse failure, up to the parser's own detail, which
|
|
228
|
+
* differs between feel-scala and @bpmnkit/feel.
|
|
229
|
+
*/
|
|
230
|
+
export function feelFailure(text) {
|
|
231
|
+
return `failed to parse expression '${text.slice(1)}'`;
|
|
232
|
+
}
|
|
233
|
+
/** Zeebe's message for a static value where an expression is required. */
|
|
234
|
+
export function staticValueMessage(text) {
|
|
235
|
+
return `Expected expression but found static value '${text}'. An expression must start with '=' (e.g. '=${text}').`;
|
|
236
|
+
}
|
|
237
|
+
/** An attribute value, or `undefined` when absent or blank (Zeebe's "present and not empty"). */
|
|
238
|
+
export function nonEmpty(value) {
|
|
239
|
+
return value === undefined || value.trim() === "" ? undefined : value;
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { BpmnDefinitions } from "../bpmn-model.js";
|
|
2
|
+
import type { OptimizationFinding } from "../optimize/types.js";
|
|
3
|
+
import { type ValidateDeployableOptions } from "./context.js";
|
|
4
|
+
/** Options for {@link assertDeployable}. */
|
|
5
|
+
export interface AssertDeployableOptions extends ValidateDeployableOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Fill the documented {@link PLACEHOLDERS} where a required value is missing,
|
|
8
|
+
* instead of refusing the model (default `false`).
|
|
9
|
+
*/
|
|
10
|
+
placeholders?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** The fields {@link assertDeployable} can fill with a placeholder. */
|
|
13
|
+
export type PlaceholderField = "jobType" | "messageName" | "correlationKey" | "signalName" | "errorCode" | "escalationCode" | "timer" | "calledElement" | "decisionId" | "condition";
|
|
14
|
+
/** One placeholder value {@link assertDeployable} wrote. */
|
|
15
|
+
export interface PlaceholderFill {
|
|
16
|
+
/** The element that got the value (a flow node, sequence flow or root message/signal/escalation). */
|
|
17
|
+
elementId: string;
|
|
18
|
+
field: PlaceholderField;
|
|
19
|
+
/** What was written. */
|
|
20
|
+
value: string;
|
|
21
|
+
/** The `zeebe/*` rule the value satisfies. */
|
|
22
|
+
rule: string;
|
|
23
|
+
}
|
|
24
|
+
/** What {@link assertDeployable} returns for a model Zeebe accepts. */
|
|
25
|
+
export interface DeployableResult {
|
|
26
|
+
/** The input when nothing was filled, else a filled copy; the input is never mutated. */
|
|
27
|
+
definitions: BpmnDefinitions;
|
|
28
|
+
/** The values filled, in the order they were written; empty unless `placeholders: true`. */
|
|
29
|
+
placeholders: PlaceholderFill[];
|
|
30
|
+
/** Findings below severity `error`. */
|
|
31
|
+
warnings: OptimizationFinding[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Every placeholder value, by field. `<elementId>` stands for the id of the element
|
|
35
|
+
* that gets the value. Values are deterministic so the same input always fills the
|
|
36
|
+
* same way; none of them makes the model do anything useful at runtime.
|
|
37
|
+
*/
|
|
38
|
+
export declare const PLACEHOLDERS: Readonly<Record<PlaceholderField, {
|
|
39
|
+
readonly value: string;
|
|
40
|
+
readonly where: string;
|
|
41
|
+
}>>;
|
|
42
|
+
/**
|
|
43
|
+
* `modeler:executionPlatform` names Camunda 8 ("Camunda Cloud", any case), as
|
|
44
|
+
* `targetCamundaVersion` reads it: the models `Bpmn.export` and `build()` gate.
|
|
45
|
+
*/
|
|
46
|
+
export declare function targetsCamunda8(definitions: BpmnDefinitions): boolean;
|
|
47
|
+
/** The message of a {@link DeployabilityError}; the Rust twin builds the same bytes. */
|
|
48
|
+
export declare function deployabilityMessage(camundaVersion: string, errors: readonly OptimizationFinding[]): string;
|
|
49
|
+
/**
|
|
50
|
+
* Refuses a model Zeebe would reject on deploy, with every reason in one error.
|
|
51
|
+
*
|
|
52
|
+
* The check is {@link validateDeployableXml} on the serialized model, so anything
|
|
53
|
+
* the serializer gets wrong is refused too. With `placeholders: true`, missing
|
|
54
|
+
* required values (job types, message names, correlation keys, ...) are filled
|
|
55
|
+
* with the values in {@link PLACEHOLDERS} on a copy, which is validated again.
|
|
56
|
+
*
|
|
57
|
+
* @param definitions - The model to check; never mutated.
|
|
58
|
+
* @param options - As for {@link validateDeployable}, plus `placeholders`.
|
|
59
|
+
* @returns The model to deploy (the input, or the filled copy), the fills and the warnings.
|
|
60
|
+
* @throws {DeployabilityError} When an error finding remains.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const { definitions, placeholders } = assertDeployable(defs, { placeholders: true })
|
|
65
|
+
* for (const p of placeholders) console.log(`${p.elementId}.${p.field} = ${p.value}`)
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare function assertDeployable(definitions: BpmnDefinitions, options?: AssertDeployableOptions): DeployableResult;
|
|
69
|
+
/**
|
|
70
|
+
* Refuses BPMN XML Zeebe would reject on deploy: the bytes as they are, for a caller
|
|
71
|
+
* that deploys, writes or returns XML it did not serialize itself (a file, a model's
|
|
72
|
+
* answer). No placeholders: to fill them, parse the XML and call {@link assertDeployable}.
|
|
73
|
+
*
|
|
74
|
+
* @param xml - The document to check.
|
|
75
|
+
* @param options - As for {@link validateDeployableXml}; `camundaVersion` defaults to the
|
|
76
|
+
* document's `modeler:executionPlatformVersion`, else the newest supported version.
|
|
77
|
+
* @returns The findings below severity `error`.
|
|
78
|
+
* @throws {DeployabilityError} When an error finding remains, with the same message
|
|
79
|
+
* {@link assertDeployable} gives.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* assertDeployableXml(readFileSync("order.bpmn", "utf8")) // throws before a deploy would fail
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function assertDeployableXml(xml: string, options?: ValidateDeployableOptions): OptimizationFinding[];
|
|
87
|
+
//# sourceMappingURL=gate.d.ts.map
|