@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.
Files changed (110) hide show
  1. package/agent-cards/bpmn.md +3 -3
  2. package/builder-reference.md +11 -9
  3. package/dist/bpmn/auto-layout.js +82 -26
  4. package/dist/bpmn/bpmn-builder.d.ts +84 -7
  5. package/dist/bpmn/bpmn-builder.js +313 -78
  6. package/dist/bpmn/bpmn-model.d.ts +2 -0
  7. package/dist/bpmn/bpmn-parser.js +68 -76
  8. package/dist/bpmn/bpmn-serializer.js +60 -19
  9. package/dist/bpmn/bpmnlint.js +4 -69
  10. package/dist/bpmn/builder-rules.d.ts +20 -0
  11. package/dist/bpmn/builder-rules.js +120 -0
  12. package/dist/bpmn/camunda-compat-data.d.ts +10 -148
  13. package/dist/bpmn/camunda-compat-data.js +16 -407
  14. package/dist/bpmn/camunda-compat-feel.d.ts +3 -0
  15. package/dist/bpmn/camunda-compat-feel.js +1 -1
  16. package/dist/bpmn/camunda-compat.js +7 -6
  17. package/dist/bpmn/camunda7/export.js +4 -1
  18. package/dist/bpmn/camunda7/juel.js +2 -1
  19. package/dist/bpmn/camunda7/migrate.d.ts +23 -0
  20. package/dist/bpmn/camunda7/migrate.js +75 -3
  21. package/dist/bpmn/compact-stream.js +2 -1
  22. package/dist/bpmn/compact.d.ts +80 -4
  23. package/dist/bpmn/compact.js +220 -38
  24. package/dist/bpmn/feel-condition.d.ts +9 -0
  25. package/dist/bpmn/feel-condition.js +19 -0
  26. package/dist/bpmn/full-operations.js +31 -4
  27. package/dist/bpmn/index.d.ts +13 -3
  28. package/dist/bpmn/index.js +16 -15
  29. package/dist/bpmn/operations.d.ts +4 -4
  30. package/dist/bpmn/operations.js +14 -2
  31. package/dist/bpmn/optimize/bpmnlint-rules.js +7 -40
  32. package/dist/bpmn/optimize/index.js +15 -1
  33. package/dist/bpmn/optimize/tasks.js +12 -3
  34. package/dist/bpmn/process-delta.d.ts +18 -0
  35. package/dist/bpmn/process-delta.js +20 -2
  36. package/dist/bpmn/process-text-writer.js +27 -1
  37. package/dist/bpmn/process-text.d.ts +9 -3
  38. package/dist/bpmn/process-text.js +122 -16
  39. package/dist/bpmn/stable-ids.d.ts +2 -0
  40. package/dist/bpmn/stable-ids.js +8 -0
  41. package/dist/bpmn/zeebe-extensions.js +2 -1
  42. package/dist/bpmn/zeebe-placement.js +6 -129
  43. package/dist/bpmn/zeebe-validate/context.d.ts +132 -0
  44. package/dist/bpmn/zeebe-validate/context.js +241 -0
  45. package/dist/bpmn/zeebe-validate/gate.d.ts +87 -0
  46. package/dist/bpmn/zeebe-validate/gate.js +492 -0
  47. package/dist/bpmn/zeebe-validate/index.d.ts +37 -0
  48. package/dist/bpmn/zeebe-validate/index.js +106 -0
  49. package/dist/bpmn/zeebe-validate/rules/events.d.ts +4 -0
  50. package/dist/bpmn/zeebe-validate/rules/events.js +580 -0
  51. package/dist/bpmn/zeebe-validate/rules/extensions.d.ts +4 -0
  52. package/dist/bpmn/zeebe-validate/rules/extensions.js +411 -0
  53. package/dist/bpmn/zeebe-validate/rules/gateways.d.ts +3 -0
  54. package/dist/bpmn/zeebe-validate/rules/gateways.js +296 -0
  55. package/dist/bpmn/zeebe-validate/rules/references.d.ts +3 -0
  56. package/dist/bpmn/zeebe-validate/rules/references.js +495 -0
  57. package/dist/bpmn/zeebe-validate/rules/structure.d.ts +3 -0
  58. package/dist/bpmn/zeebe-validate/rules/structure.js +629 -0
  59. package/dist/bpmn/zeebe-validate/rules/tasks.d.ts +4 -0
  60. package/dist/bpmn/zeebe-validate/rules/tasks.js +446 -0
  61. package/dist/bpmn/zeebe-validate/xml.d.ts +15 -0
  62. package/dist/bpmn/zeebe-validate/xml.js +1062 -0
  63. package/dist/bpmn/zeebe-validate/xsd.d.ts +19 -0
  64. package/dist/bpmn/zeebe-validate/xsd.js +350 -0
  65. package/dist/connectors/aliases.js +1 -0
  66. package/dist/connectors/apply-element.d.ts +5 -2
  67. package/dist/connectors/apply-element.js +6 -0
  68. package/dist/connectors/apply-many.d.ts +9 -2
  69. package/dist/connectors/apply-many.js +17 -2
  70. package/dist/connectors/apply.d.ts +4 -2
  71. package/dist/connectors/deployability.d.ts +27 -0
  72. package/dist/connectors/deployability.js +41 -0
  73. package/dist/connectors/index.d.ts +1 -0
  74. package/dist/connectors/lines.d.ts +10 -0
  75. package/dist/connectors/lines.js +13 -4
  76. package/dist/connectors/templates/generated.js +10101 -3188
  77. package/dist/dmn/dmn-model.d.ts +24 -4
  78. package/dist/dmn/dmn-parser.js +37 -3
  79. package/dist/dmn/dmn-serializer.js +48 -47
  80. package/dist/dmn/lint.js +4 -11
  81. package/dist/errors.d.ts +30 -1
  82. package/dist/errors.js +31 -0
  83. package/dist/form/form-model.d.ts +11 -0
  84. package/dist/form/form-parser.d.ts +1 -0
  85. package/dist/form/form-parser.js +48 -12
  86. package/dist/form/form-serializer.js +40 -17
  87. package/dist/form/lint.js +6 -40
  88. package/dist/generated/bpmn-elements.d.ts +5 -0
  89. package/dist/generated/bpmn-elements.js +151 -0
  90. package/dist/generated/camunda-compat-data.d.ts +148 -0
  91. package/dist/generated/camunda-compat-data.js +371 -0
  92. package/dist/generated/dmn-elements.d.ts +12 -0
  93. package/dist/generated/dmn-elements.js +45 -0
  94. package/dist/generated/form-elements.d.ts +5 -0
  95. package/dist/generated/form-elements.js +45 -0
  96. package/dist/generated/lint-rules.d.ts +17 -0
  97. package/dist/generated/lint-rules.js +116 -0
  98. package/dist/generated/zeebe-elements.d.ts +10 -0
  99. package/dist/generated/zeebe-elements.js +168 -0
  100. package/dist/generated/zeebe-rules.d.ts +25 -0
  101. package/dist/generated/zeebe-rules.js +202 -0
  102. package/dist/index.d.ts +10 -4
  103. package/dist/index.js +4 -1
  104. package/dist/layout/annotations.js +21 -1
  105. package/dist/layout/orthogonal.js +9 -3
  106. package/dist/plan/compile.d.ts +26 -1
  107. package/dist/plan/compile.js +48 -6
  108. package/dist/plan/merge.d.ts +2 -1
  109. package/dist/plan/merge.js +13 -5
  110. package/package.json +2 -2
@@ -168,8 +168,9 @@ function isIsoDate(value) {
168
168
  const match = ISO_DATE_RE.exec(value);
169
169
  if (match?.groups === undefined)
170
170
  return false;
171
- // Rejects dates like 2024-02-31, which `Date` rolls into the next month.
172
- return new Date(match.groups.date).getMonth() + 1 === Number(match.groups.month);
171
+ // Rejects dates like 2024-02-31, which `Date` rolls into the next month. A date-only
172
+ // string is UTC midnight, so the month is read in UTC, not in the local time zone.
173
+ return new Date(match.groups.date).getUTCMonth() + 1 === Number(match.groups.month);
173
174
  }
174
175
  const cronAlt = (...patterns) => `(${patterns.join("|")})`;
175
176
  const cronRange = (p) => `${p}(-${p})?`;
@@ -574,9 +575,10 @@ function checkReferences(ctx, el, parent) {
574
575
  report(ctx, "error-reference", el.id, `${describe(el)} references error "${error.name ?? error.id}", which has no error code.`, "Set the error code.");
575
576
  }
576
577
  else if (error?.errorCode?.startsWith("=")) {
578
+ // The camunda-compat plugin allows catch expressions from 8.4, but Zeebe
579
+ // (ErrorEventDefinitionValidator, still in 8.9) rejects them on every version.
577
580
  const before82 = !atLeast(ctx.version, "8.2");
578
- const before84 = !atLeast(ctx.version, "8.4");
579
- if (before82 || (before84 && isCatch)) {
581
+ if (before82 || isCatch) {
580
582
  report(ctx, "no-expression", el.id, isCatch
581
583
  ? `${describe(el)} catches error code "${error.errorCode}", an expression, which Camunda ${ctx.version} does not support in a catch event.`
582
584
  : `${describe(el)} throws error code "${error.errorCode}", an expression, which needs Camunda ${FEATURE_SINCE.errorCodeExpression} or newer; ${targets(ctx)}.`, isCatch ? "Use a static error code." : raise(FEATURE_SINCE.errorCodeExpression));
@@ -595,8 +597,7 @@ function checkReferences(ctx, el, parent) {
595
597
  }
596
598
  else if (isCatch &&
597
599
  escalation?.escalationCode?.startsWith("=") &&
598
- atLeast(ctx.version, "8.2") &&
599
- !atLeast(ctx.version, "8.4")) {
600
+ atLeast(ctx.version, "8.2")) {
600
601
  report(ctx, "no-expression", el.id, `${describe(el)} catches escalation code "${escalation.escalationCode}", an expression, which Camunda ${ctx.version} does not support in a catch event.`, "Use a static escalation code.");
601
602
  }
602
603
  }
@@ -175,8 +175,11 @@ export function convertCamunda8To7(definitions) {
175
175
  if (typeof value !== "object" || value === null)
176
176
  return;
177
177
  const record = value;
178
- if (isOwner(record))
178
+ if (isOwner(record)) {
179
+ // A multi-instance loop with an id has extensionElements but no unknownAttributes.
180
+ record.unknownAttributes ??= {};
179
181
  convertOwner(record);
182
+ }
180
183
  else if (typeof record.unknownAttributes === "object" && record.unknownAttributes !== null) {
181
184
  stripForeignAttrs(record.unknownAttributes);
182
185
  }
@@ -281,7 +281,8 @@ class JuelParser {
281
281
  if (head && C7_ENGINE_OBJECTS.has(text)) {
282
282
  throw new Refusal(`"${text}" is a Camunda 7 engine object with no Camunda 8 counterpart`);
283
283
  }
284
- if (head && text in MULTI_INSTANCE_RENAMES) {
284
+ // `in` would also find Object.prototype members, refusing a variable named `constructor`.
285
+ if (head && Object.hasOwn(MULTI_INSTANCE_RENAMES, text)) {
285
286
  const renamed = MULTI_INSTANCE_RENAMES[text];
286
287
  if (this.options.multiInstance !== true || renamed === undefined) {
287
288
  throw new Refusal(`"${text}" exists only in a multi-instance completion condition`);
@@ -1,4 +1,5 @@
1
1
  import type { BpmnDefinitions } from "../bpmn-model.js";
2
+ import { type PlaceholderFill } from "../zeebe-validate/gate.js";
2
3
  /**
3
4
  * How much work a Camunda 7 construct leaves after conversion.
4
5
  *
@@ -38,6 +39,19 @@ export interface Camunda7Report {
38
39
  export interface Camunda7ConvertOptions {
39
40
  /** Written as `modeler:executionPlatformVersion`. Default `"8.10.0"`. */
40
41
  executionPlatformVersion?: string;
42
+ /**
43
+ * Refuse a result Zeebe would reject on deploy, with a `DeployabilityError`
44
+ * (default `true`). `false` returns the conversion as it is, deployable or not.
45
+ */
46
+ validate?: boolean;
47
+ /**
48
+ * Fill the gate's documented placeholders (`PLACEHOLDERS`) where a value the
49
+ * conversion cannot derive is missing — a job type, a correlation key — instead
50
+ * of refusing. Each fill is listed in the report as a `manual` finding.
51
+ */
52
+ placeholders?: boolean;
53
+ /** The Camunda 8 version the gate checks. Default: `executionPlatformVersion`. */
54
+ camundaVersion?: string;
41
55
  /**
42
56
  * Ignored. Kept for compatibility: earlier versions read `camunda:` attributes
43
57
  * on multi-instance loops and event definitions from the source XML, because
@@ -48,6 +62,8 @@ export interface Camunda7ConvertOptions {
48
62
  export interface Camunda7Conversion {
49
63
  definitions: BpmnDefinitions;
50
64
  report: Camunda7Report;
65
+ /** The placeholder values written; empty unless `placeholders: true` filled something. */
66
+ placeholders: PlaceholderFill[];
51
67
  }
52
68
  export declare const CAMUNDA7_NS = "http://camunda.org/schema/1.0/bpmn";
53
69
  export declare const ZEEBE_NS = "http://camunda.org/schema/zeebe/1.0";
@@ -59,6 +75,13 @@ export declare const MODELER_NS = "http://camunda.org/schema/modeler/1.0";
59
75
  * What cannot be converted stays in the output verbatim — Camunda 8 ignores
60
76
  * `camunda:` content — and has a `manual` or `unsupported` finding saying why.
61
77
  *
78
+ * The result must deploy on Camunda 8: unless `validate: false`, it goes through
79
+ * `assertDeployable`, which throws a `DeployabilityError` listing every reason
80
+ * Zeebe would reject it (a service task with no job type, a message catch with no
81
+ * correlation key, ...). Get the report of a refused model from
82
+ * {@link analyzeCamunda7}. With `placeholders: true` the missing values are filled
83
+ * instead, and each fill is a `manual` finding in the report.
84
+ *
62
85
  * @example
63
86
  * ```typescript
64
87
  * const { definitions, report } = convertCamunda7(Bpmn.parse(xml))
@@ -2,6 +2,7 @@ import { parseExpression } from "@bpmnkit/feel";
2
2
  import { ValidationError } from "../../errors.js";
3
3
  import { detectExecutionPlatform } from "../lint.js";
4
4
  import { bpmnElementName, isZeebePlacementAllowed } from "../zeebe-extensions.js";
5
+ import { assertDeployable } from "../zeebe-validate/gate.js";
5
6
  import { containsJuel, feelString, isFeelName, translateJuelToFeel } from "./juel.js";
6
7
  export const CAMUNDA7_NS = "http://camunda.org/schema/1.0/bpmn";
7
8
  export const ZEEBE_NS = "http://camunda.org/schema/zeebe/1.0";
@@ -29,6 +30,13 @@ function localName(name) {
29
30
  * What cannot be converted stays in the output verbatim — Camunda 8 ignores
30
31
  * `camunda:` content — and has a `manual` or `unsupported` finding saying why.
31
32
  *
33
+ * The result must deploy on Camunda 8: unless `validate: false`, it goes through
34
+ * `assertDeployable`, which throws a `DeployabilityError` listing every reason
35
+ * Zeebe would reject it (a service task with no job type, a message catch with no
36
+ * correlation key, ...). Get the report of a refused model from
37
+ * {@link analyzeCamunda7}. With `placeholders: true` the missing values are filled
38
+ * instead, and each fill is a `manual` finding in the report.
39
+ *
32
40
  * @example
33
41
  * ```typescript
34
42
  * const { definitions, report } = convertCamunda7(Bpmn.parse(xml))
@@ -44,14 +52,29 @@ export function convertCamunda7(definitions, options = {}) {
44
52
  const draft = structuredClone(definitions);
45
53
  const converter = new Converter(draft, options);
46
54
  converter.run();
47
- return { definitions: draft, report: converter.report() };
55
+ if (options.validate === false) {
56
+ return { definitions: draft, report: converter.report(), placeholders: [] };
57
+ }
58
+ // Throws DeployabilityError; `analyzeCamunda7` still gives the report of a refused model.
59
+ const gated = assertDeployable(draft, {
60
+ camundaVersion: options.camundaVersion ?? options.executionPlatformVersion ?? DEFAULT_PLATFORM_VERSION,
61
+ placeholders: options.placeholders === true,
62
+ });
63
+ for (const fill of gated.placeholders)
64
+ converter.addPlaceholder(fill, gated.definitions);
65
+ return {
66
+ definitions: gated.definitions,
67
+ report: converter.report(),
68
+ placeholders: gated.placeholders,
69
+ };
48
70
  }
49
71
  /**
50
72
  * Reports what migrating a Camunda 7 model to Camunda 8 takes, element by
51
73
  * element, without changing it. Same findings as {@link convertCamunda7}.
52
74
  */
53
75
  export function analyzeCamunda7(definitions, options = {}) {
54
- return convertCamunda7(definitions, options).report;
76
+ // Analysis never gates: the report is what a refused conversion leaves to do.
77
+ return convertCamunda7(definitions, { ...options, validate: false }).report;
55
78
  }
56
79
  /** `com.acme.ShipOrderDelegate` → `shipOrderDelegate`, the Spring bean name the class gets by default. */
57
80
  function beanName(className) {
@@ -106,6 +129,21 @@ class Converter {
106
129
  this.convertProcess(process);
107
130
  this.setExecutionPlatform();
108
131
  }
132
+ /** Lists a gate placeholder as work left: the value has to be replaced before going live. */
133
+ addPlaceholder(fill, filled) {
134
+ // The filled copy: a placeholder can be a message the fill created.
135
+ const where = locateForReport(filled, fill.elementId);
136
+ this.findings.push({
137
+ elementId: fill.elementId,
138
+ elementType: where.type,
139
+ processId: where.processId,
140
+ construct: `placeholder ${fill.field}`,
141
+ severity: "manual",
142
+ message: `Placeholder ${fill.field} "${fill.value}" written so the model deploys (${fill.rule}).`,
143
+ suggestion: "Replace it with the real value; the placeholder does nothing useful at runtime.",
144
+ applied: true,
145
+ });
146
+ }
109
147
  report() {
110
148
  const counts = { convertible: 0, manual: 0, unsupported: 0 };
111
149
  for (const finding of this.findings)
@@ -754,7 +792,10 @@ class Converter {
754
792
  for (const listener of this.exts(owner, "taskListener")) {
755
793
  this.keepExt(listener);
756
794
  const event = listener.attributes.event ?? "create";
757
- const c8Event = TASK_LISTENER_EVENTS[event];
795
+ // Own keys only: an event named `constructor` is not a listener event.
796
+ const c8Event = Object.hasOwn(TASK_LISTENER_EVENTS, event)
797
+ ? TASK_LISTENER_EVENTS[event]
798
+ : undefined;
758
799
  if (c8Event === undefined) {
759
800
  this.add(owner, "camunda:taskListener", "unsupported", `Camunda 8 has no task listener event like "${event}".`, event === "timeout"
760
801
  ? "Model the timeout with a timer boundary event."
@@ -1122,6 +1163,37 @@ class Converter {
1122
1163
  this.add({ id: d.id, type: "definitions" }, "modeler:executionPlatform", "convertible", `Execution platform set to Camunda Cloud ${version}${before === undefined ? "" : ` (was ${before})`}.`, "Camunda Modeler opens the file as a Camunda 8 diagram.", true);
1123
1164
  }
1124
1165
  }
1166
+ /** The type and process of the element a placeholder went to; root elements belong to no process. */
1167
+ function locateForReport(definitions, id) {
1168
+ const visit = (elements, flows) => {
1169
+ for (const element of elements) {
1170
+ if (element.id === id)
1171
+ return element.type;
1172
+ if ("flowElements" in element) {
1173
+ const nested = visit(element.flowElements, element.sequenceFlows);
1174
+ if (nested !== undefined)
1175
+ return nested;
1176
+ }
1177
+ }
1178
+ return flows.some((flow) => flow.id === id) ? "sequenceFlow" : undefined;
1179
+ };
1180
+ for (const process of definitions.processes) {
1181
+ const type = visit(process.flowElements, process.sequenceFlows);
1182
+ if (type !== undefined)
1183
+ return { type, processId: process.id };
1184
+ }
1185
+ const roots = [
1186
+ ["message", definitions.messages],
1187
+ ["signal", definitions.signals],
1188
+ ["error", definitions.errors],
1189
+ ["escalation", definitions.escalations],
1190
+ ];
1191
+ for (const [type, list] of roots) {
1192
+ if (list.some((root) => root.id === id))
1193
+ return { type, processId: "" };
1194
+ }
1195
+ return { type: "", processId: "" };
1196
+ }
1125
1197
  const DELEGATE_LABEL = {
1126
1198
  class: "Java delegate class",
1127
1199
  delegateExpression: "Delegate expression",
@@ -156,7 +156,8 @@ export function createCompactStream(options) {
156
156
  ],
157
157
  };
158
158
  try {
159
- return expand(diagram);
159
+ // A frame is a preview of an unfinished diagram, never deployed: no gate.
160
+ return expand(diagram, { validate: false });
160
161
  }
161
162
  catch {
162
163
  return null; // an element whose fields have not all arrived
@@ -1,5 +1,5 @@
1
1
  import type { XmlElement } from "../types/xml-element.js";
2
- import type { BpmnDefinitions, BpmnElementType, BpmnEventDefinition, BpmnFlowElement } from "./bpmn-model.js";
2
+ import type { BpmnDefinitions, BpmnElementType, BpmnError, BpmnEscalation, BpmnEventDefinition, BpmnFlowElement, BpmnMessage, BpmnSignal } from "./bpmn-model.js";
3
3
  /** A single BPMN flow node in compact form. */
4
4
  export interface CompactElement {
5
5
  id: string;
@@ -78,7 +78,7 @@ export interface CompactElement {
78
78
  eventType?: string;
79
79
  /** Boundary event: host element ID */
80
80
  attachedTo?: string;
81
- /** Boundary event: false = non-interrupting */
81
+ /** Boundary event, or the start event of an event sub-process: false = non-interrupting */
82
82
  interrupting?: boolean;
83
83
  /** Nested content for sub-process container types (subProcess, eventSubProcess, etc.) */
84
84
  children?: {
@@ -102,8 +102,37 @@ export interface CompactElement {
102
102
  };
103
103
  /** A timer event's ISO 8601 duration (`PT5M`): how long it waits once reached. */
104
104
  timerDuration?: string;
105
+ /** A timer event's ISO 8601 date-time (`2026-12-01T09:00:00Z`): when it fires. */
106
+ timerDate?: string;
107
+ /** A timer event's ISO 8601 repeating interval (`R/PT1H`, `R3/PT10M`) or cron expression. */
108
+ timerCycle?: string;
109
+ /**
110
+ * A message event's or receive task's message name. {@link expand} writes one
111
+ * `bpmn:message` per name and correlation key and points the element at it.
112
+ */
113
+ messageName?: string;
114
+ /**
115
+ * The FEEL expression (`=orderId`) a caught message is correlated on, written
116
+ * as the message's `zeebe:subscription`. Camunda 8 needs it on every message
117
+ * caught outside a process start event.
118
+ */
119
+ correlationKey?: string;
120
+ /** A signal event's signal name (a `bpmn:signal` per name). */
121
+ signalName?: string;
122
+ /**
123
+ * An error event's error code (a `bpmn:error` per code). A thrown error needs
124
+ * one; an error boundary or start event without one catches every error.
125
+ */
126
+ errorCode?: string;
127
+ /** An escalation event's escalation code (a `bpmn:escalation` per code). */
128
+ escalationCode?: string;
105
129
  /** A conditional event's FEEL condition (Camunda 8.9+). */
106
130
  condition?: string;
131
+ /**
132
+ * A link event's name: a throw jumps to the catch of the same name. BPMN
133
+ * requires it on every link event definition.
134
+ */
135
+ linkName?: string;
107
136
  }
108
137
  /** A sequence flow in compact form. */
109
138
  export interface CompactFlow {
@@ -206,16 +235,63 @@ export declare function makeEventDef(eventType: string): BpmnEventDefinition | u
206
235
  */
207
236
  export declare function isConnectorJobType(jobType: string): boolean;
208
237
  export declare function makeExtensions(el: CompactElement): XmlElement[];
238
+ /**
239
+ * The root elements {@link expand} writes for the names and codes elements carry:
240
+ * one message per name and correlation key, one signal per name, one error or
241
+ * escalation per code. Ids are made as the builder makes them (`Message_<name>`).
242
+ */
243
+ export declare class CompactRoots {
244
+ readonly messages: BpmnMessage[];
245
+ readonly errors: BpmnError[];
246
+ readonly signals: BpmnSignal[];
247
+ readonly escalations: BpmnEscalation[];
248
+ message(name: string, correlationKey: string | undefined): string;
249
+ signal(name: string): string;
250
+ error(code: string): string;
251
+ escalation(code: string): string;
252
+ }
253
+ /**
254
+ * One compact element as a flow element. `roots`, when given, receives the
255
+ * messages, signals, errors and escalations the element names; without it the
256
+ * names and codes are not written.
257
+ */
209
258
  export declare function buildFlowElement(el: CompactElement, incoming: string[], outgoing: string[],
210
259
  /** Id of the outgoing flow marked `isDefault`, for a gateway that has one. */
211
- defaultFlow?: string): BpmnFlowElement;
260
+ defaultFlow?: string, roots?: CompactRoots): BpmnFlowElement;
261
+ /**
262
+ * Options for {@link expand}. A compact diagram is written for Camunda 8, so
263
+ * the result is checked with `assertDeployable` unless `validate` is `false`.
264
+ */
265
+ export interface ExpandOptions {
266
+ /**
267
+ * Refuse a diagram Zeebe would reject on deploy (default `true`). Pass `false`
268
+ * for a diagram that is not finished (a streamed preview, an edit in
269
+ * progress) or not meant for Camunda 8; the result is then not marked as
270
+ * Camunda 8 unless the diagram names an `executionPlatformVersion`.
271
+ */
272
+ validate?: boolean;
273
+ /**
274
+ * Fill the documented `PLACEHOLDERS` (job types, message names, conditions,
275
+ * ...) instead of refusing, and return the filled model. Default `false`.
276
+ */
277
+ placeholders?: boolean;
278
+ /** The Camunda 8 version to check for; defaults to the diagram's `executionPlatformVersion`. */
279
+ camundaVersion?: string;
280
+ }
212
281
  /**
213
282
  * Restores a {@link CompactDiagram} (produced by {@link compactify} or an AI
214
283
  * model) back to a full {@link BpmnDefinitions} with auto-generated layout.
215
284
  *
285
+ * The result targets Camunda 8: it carries `modeler:executionPlatform="Camunda
286
+ * Cloud"` (and the diagram's `executionPlatformVersion`, when it names one), so a
287
+ * later `Bpmn.export` checks it the same way.
288
+ * Then `assertDeployable` refuses what Zeebe would reject, unless
289
+ * `options.validate` is `false`.
290
+ *
216
291
  * @throws {Error} When the diagram cannot be valid BPMN — a flow or boundary
217
292
  * event naming an element that is not in its scope, a duplicate or missing id,
218
293
  * or an unknown `eventType`. The message lists every problem at once.
294
+ * @throws {DeployabilityError} When the gate runs and Zeebe would reject the model.
219
295
  *
220
296
  * @example
221
297
  * ```typescript
@@ -225,5 +301,5 @@ defaultFlow?: string): BpmnFlowElement;
225
301
  * editor.loadXml(xml)
226
302
  * ```
227
303
  */
228
- export declare function expand(compact: CompactDiagram): BpmnDefinitions;
304
+ export declare function expand(compact: CompactDiagram, options?: ExpandOptions): BpmnDefinitions;
229
305
  //# sourceMappingURL=compact.d.ts.map