@bpmnkit/core 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +19 -0
- package/README.md +2 -0
- package/agent-cards/bpmn.md +86 -0
- package/agent-cards/dmn.md +105 -0
- package/agent-cards/form.md +72 -0
- package/dist/bpmn/auto-layout.js +2 -1
- package/dist/bpmn/bpmn-builder.d.ts +2 -2
- package/dist/bpmn/bpmn-builder.js +17 -6
- package/dist/bpmn/camunda7/migrate.d.ts +1 -1
- package/dist/bpmn/camunda7/migrate.js +1 -1
- package/dist/bpmn/compact.js +3 -0
- package/dist/bpmn/full-operations.js +2 -0
- package/dist/bpmn/index.d.ts +2 -0
- package/dist/bpmn/index.js +2 -0
- package/dist/bpmn/optimize/deploy.js +14 -0
- package/dist/bpmn/optimize/index.d.ts +2 -0
- package/dist/bpmn/optimize/index.js +5 -0
- package/dist/bpmn/optimize/types.d.ts +7 -0
- package/dist/bpmn/stable-ids.d.ts +15 -0
- package/dist/bpmn/stable-ids.js +26 -0
- package/dist/bpmn/svg.js +5 -6
- package/dist/check-finding.d.ts +19 -0
- package/dist/check-finding.js +5 -0
- package/dist/dmn/compact.js +14 -5
- package/dist/dmn/dmn-builder.js +3 -3
- package/dist/dmn/drd-builder.d.ts +53 -0
- package/dist/dmn/drd-builder.js +100 -0
- package/dist/dmn/index.d.ts +35 -0
- package/dist/dmn/index.js +36 -0
- package/dist/dmn/lint.d.ts +19 -0
- package/dist/dmn/lint.js +414 -0
- package/dist/form/form-builder.d.ts +9 -1
- package/dist/form/form-builder.js +34 -1
- package/dist/form/form-model.d.ts +7 -0
- package/dist/form/form-parser.js +22 -0
- package/dist/form/form-serializer.js +10 -0
- package/dist/form/index.d.ts +11 -2
- package/dist/form/index.js +10 -1
- package/dist/form/lint.d.ts +19 -0
- package/dist/form/lint.js +356 -0
- package/dist/index.d.ts +13 -3
- package/dist/index.js +10 -2
- package/dist/layout/grid/edge-labels.d.ts +7 -1
- package/dist/layout/grid/edge-labels.js +62 -1
- package/dist/layout/semantic/index.js +78 -8
- package/dist/layout/semantic/place.d.ts +19 -4
- package/dist/layout/semantic/place.js +232 -34
- package/dist/layout/semantic/route.js +47 -14
- package/llms.txt +9 -0
- package/package.json +5 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @bpmnkit/core for agents
|
|
2
|
+
|
|
3
|
+
Do not read README.md (20 KB) or the .d.ts files first. Read the one card for your task (~1k tokens each). Each has a runnable script, the top options and the known traps.
|
|
4
|
+
|
|
5
|
+
| You write | Read |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| BPMN process | `node_modules/@bpmnkit/core/agent-cards/bpmn.md` |
|
|
8
|
+
| DMN decision table or DRD | `node_modules/@bpmnkit/core/agent-cards/dmn.md` |
|
|
9
|
+
| Camunda form | `node_modules/@bpmnkit/core/agent-cards/form.md` |
|
|
10
|
+
|
|
11
|
+
Rules that hold for all three:
|
|
12
|
+
|
|
13
|
+
- Build with the builders (`Bpmn`, `Dmn`, `Form`). Never write XML or form JSON by hand.
|
|
14
|
+
- Edit an existing file with `Bpmn.parse` and the `export*Preserving` writers, so layout and formatting stay.
|
|
15
|
+
- `formId` and `decisionId` must equal the deployed form id and decision id exactly.
|
|
16
|
+
- Validate before you finish: `npx @bpmnkit/cli check order.bpmn risk.dmn review.form --deploy` (`casen check` if the CLI is installed). Fix every error.
|
|
17
|
+
- Builder errors and check findings end with `agent-cards/<type>.md#traps`. Read that section.
|
|
18
|
+
|
|
19
|
+
The full API reference is `builder-reference.md` in this folder. Open it only when a card does not cover an option.
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
> **Agents:** read `node_modules/@bpmnkit/core/AGENTS.md`, then `node_modules/@bpmnkit/core/agent-cards/<bpmn|dmn|form>.md` (~1k tokens) instead of this README.
|
|
2
|
+
|
|
1
3
|
<div align="center">
|
|
2
4
|
<a href="https://bpmnkit.com"><img src="https://bpmnkit.com/favicon.svg" width="72" height="72" alt="BPMN Kit logo"></a>
|
|
3
5
|
<h1>@bpmnkit/core</h1>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# BPMN agent card
|
|
2
|
+
|
|
3
|
+
Write a Camunda 8 BPMN process with `@bpmnkit/core` in one script: create, export, edit, validate. Run it with `node --experimental-strip-types build.ts` (Node 22.6+) or `npx tsx build.ts`. Never write BPMN XML by hand.
|
|
4
|
+
|
|
5
|
+
<!-- docspack: tags=agent-card,cheat-sheet,build-script,bpmn,process,create,write,script,builder -->
|
|
6
|
+
|
|
7
|
+
## Minimal BPMN build script: create, export, edit, validate
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { readFileSync, writeFileSync } from "node:fs"
|
|
11
|
+
import { Bpmn, exportPreserving, lintDiagram } from "@bpmnkit/core"
|
|
12
|
+
|
|
13
|
+
// 1. Create. The process id is the deploy key: same id = new version of that process.
|
|
14
|
+
const definitions = Bpmn.createProcess("order")
|
|
15
|
+
.name("Order")
|
|
16
|
+
.withAutoLayout()
|
|
17
|
+
.startEvent("received", { name: "Order received" })
|
|
18
|
+
.businessRuleTask("score", { name: "Score risk", decisionId: "risk", resultVariable: "risk" })
|
|
19
|
+
.exclusiveGateway("check", { name: "Risky?" })
|
|
20
|
+
.branch("yes", (b) =>
|
|
21
|
+
b
|
|
22
|
+
.condition('=risk = "high"')
|
|
23
|
+
.label("Yes")
|
|
24
|
+
.userTask("review", { name: "Review order", formId: "review-order", zeebeUserTask: true })
|
|
25
|
+
.connectTo("ship"),
|
|
26
|
+
)
|
|
27
|
+
.branch("no", (b) => b.defaultFlow().label("No").connectTo("ship"))
|
|
28
|
+
.serviceTask("ship", { name: "Ship order", taskType: "ship-order", retries: "3" })
|
|
29
|
+
.endEvent("done", { name: "Order shipped" })
|
|
30
|
+
.build()
|
|
31
|
+
|
|
32
|
+
// 2. Export.
|
|
33
|
+
writeFileSync("order.bpmn", Bpmn.export(definitions))
|
|
34
|
+
|
|
35
|
+
// 3. Edit an existing file: parse, change, write with exportPreserving to keep layout and formatting.
|
|
36
|
+
const original = readFileSync("order.bpmn", "utf8")
|
|
37
|
+
const edited = Bpmn.parse(original)
|
|
38
|
+
const ship = edited.processes[0]?.flowElements.find((e) => e.id === "ship")
|
|
39
|
+
if (ship) ship.name = "Ship parcel"
|
|
40
|
+
writeFileSync("order.bpmn", exportPreserving(original, edited))
|
|
41
|
+
|
|
42
|
+
// 4. Validate: Camunda 8 deployability and modelling rules.
|
|
43
|
+
const report = lintDiagram(Bpmn.parse(readFileSync("order.bpmn", "utf8")))
|
|
44
|
+
for (const d of report.diagnostics.filter((d) => d.severity !== "info"))
|
|
45
|
+
console.log(`${d.severity} ${d.elementIds.join(",")}: ${d.message}`)
|
|
46
|
+
if (report.counts.error > 0) process.exit(1)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`npm i @bpmnkit/core`. The script writes `order.bpmn`, re-opens it, renames a task without moving a shape, and exits 1 on a lint error.
|
|
50
|
+
|
|
51
|
+
## Top builder options
|
|
52
|
+
|
|
53
|
+
- `Bpmn.createProcess(id)` … `.build()`; `.withAutoLayout()` before `.build()`, or the file has no shapes.
|
|
54
|
+
- Every element takes `(id, options)`; ids are unique and each element connects to the previous one.
|
|
55
|
+
- `serviceTask(id, { name, taskType, retries, ioMapping: { inputs, outputs }, taskHeaders })`: `taskType` is the job type a worker subscribes to.
|
|
56
|
+
- `userTask(id, { name, zeebeUserTask: true, formId, assignee, candidateGroups, dueDate })`.
|
|
57
|
+
- `businessRuleTask(id, { decisionId, resultVariable })`: both are required to deploy.
|
|
58
|
+
- `scriptTask(id, { expression: "=a + b", resultVariable })`; `callActivity(id, { processId })`.
|
|
59
|
+
- Gateways: `.exclusiveGateway(id)` then `.branch(name, (b) => b.condition("=x > 1")...)`, one branch `b.defaultFlow()`; `.label(text)` sets the flow label. Merge with `.connectTo(id)` and declare that id after the last branch.
|
|
60
|
+
- Events take named options: `timerDuration: "PT1H"`, `messageName` + `correlationKey`, `errorCode`, `signalName`. `.withBoundary(id, { errorCode }, (b) => ...)` hangs a boundary on the previous task.
|
|
61
|
+
- `multiInstance: { collection: "=items", elementVariable: "item" }` on any task.
|
|
62
|
+
- Full method list: `packages/core/builder-reference.md` in `@bpmnkit/core`, or `npx bpmnkit-docs ask "<option>"`.
|
|
63
|
+
|
|
64
|
+
## Traps
|
|
65
|
+
|
|
66
|
+
- **Camunda 8.10 is the default target.** To target an older cluster, call `.executionPlatformVersion("8.8.0")` so lint checks that version.
|
|
67
|
+
- **User tasks default to job-worker tasks**, which 8.10 deprecates. Pass `zeebeUserTask: true` for a Camunda user task.
|
|
68
|
+
- **Deploy ids.** The engine keys a process by its process id (`createProcess("order")`), a decision by its `<decision id>`, a form by its JSON `id`. File names and display names do not count. `formId` and `decisionId` must equal those ids exactly; by default they bind to the latest deployed version, so deploy the `.dmn` and `.form` before an instance reaches the task. Redeploying the same id makes a new version.
|
|
69
|
+
- **Reference a DMN decision by its decision id**, not the DMN `definitions` id, the file name or the decision name.
|
|
70
|
+
- **Edit with the preserving writer.** For an existing file, `Bpmn.parse` it, change the model, and write `exportPreserving(original, edited)`. Rebuilding it with `withAutoLayout()`, or `Bpmn.export` alone, moves every shape and reformats the diff.
|
|
71
|
+
- FEEL in the builder starts with `=` (`"=amount > 1000"`); a value without `=` is a literal string.
|
|
72
|
+
- Unknown option names are silently dropped: `timer: { duration }` does nothing; use `timerDuration`.
|
|
73
|
+
|
|
74
|
+
## Lint before you deploy or test
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
casen check order.bpmn risk.dmn review-order.form --deploy # one gate: BPMN + DMN + forms, and the ids that link them
|
|
78
|
+
casen lint lint order.bpmn --profile deploy # BPMN only, errors only
|
|
79
|
+
casen deploy deploy order.bpmn # local Reebe; --target camunda8 for a cluster
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
In code, `lintDiagram(definitions)` returns `{ diagnostics, counts }`; fail on `counts.error > 0`. Warnings (no timer boundary, no output mapping) are advice.
|
|
83
|
+
|
|
84
|
+
## Writing a process as text instead
|
|
85
|
+
|
|
86
|
+
A model writing the diagram itself can use the line format: `parseProcessText(text)` then `expand(result.diagram)` from `@bpmnkit/core`. `casen agent-card bpmn --text` prints its guide. Related cards: `casen agent-card dmn`, `casen agent-card form`.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# DMN agent card
|
|
2
|
+
|
|
3
|
+
Write a Camunda 8 DMN decision table with `@bpmnkit/core` in one script: create, export, edit, validate. Run it with `node --experimental-strip-types build.ts` (Node 22.6+) or `npx tsx build.ts`. Never write DMN XML by hand.
|
|
4
|
+
|
|
5
|
+
<!-- docspack: tags=agent-card,cheat-sheet,build-script,dmn,decision,decision-table,rules,create,write,script -->
|
|
6
|
+
|
|
7
|
+
## Minimal DMN build script: create, export, edit, validate
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { readFileSync, writeFileSync } from "node:fs"
|
|
11
|
+
import { Dmn, exportDmnPreserving } from "@bpmnkit/core"
|
|
12
|
+
|
|
13
|
+
// 1. Create. "risk" is the decision id a BPMN businessRuleTask references as decisionId.
|
|
14
|
+
const definitions = Dmn.createDecisionTable("risk")
|
|
15
|
+
.name("Order risk")
|
|
16
|
+
.hitPolicy("FIRST")
|
|
17
|
+
.input({ label: "Amount", expression: "amount", typeRef: "number" })
|
|
18
|
+
.input({ label: "Country", expression: "country", typeRef: "string" })
|
|
19
|
+
.output({ label: "Risk", name: "risk", typeRef: "string" })
|
|
20
|
+
.rule({ inputs: ["> 1000", "-"], outputs: ['"high"'], description: "Large order" })
|
|
21
|
+
.rule({ inputs: ["-", 'not("DE", "AT")'], outputs: ['"medium"'] })
|
|
22
|
+
.rule({ inputs: ["-", "-"], outputs: ['"low"'] })
|
|
23
|
+
.build()
|
|
24
|
+
|
|
25
|
+
// 2. Export.
|
|
26
|
+
writeFileSync("risk.dmn", Dmn.export(definitions))
|
|
27
|
+
|
|
28
|
+
// 3. Edit an existing file: parse, change, write with exportDmnPreserving to keep the diagram.
|
|
29
|
+
const original = readFileSync("risk.dmn", "utf8")
|
|
30
|
+
const edited = Dmn.parse(original)
|
|
31
|
+
const decision = edited.decisions.find((d) => d.id === "risk")
|
|
32
|
+
if (decision) decision.name = "Order risk level"
|
|
33
|
+
writeFileSync("risk.dmn", exportDmnPreserving(original, edited))
|
|
34
|
+
|
|
35
|
+
// 4. Validate: it parses back and the decision id the process calls is there.
|
|
36
|
+
const check = Dmn.parse(readFileSync("risk.dmn", "utf8"))
|
|
37
|
+
if (!check.decisions.some((d) => d.id === "risk")) {
|
|
38
|
+
console.error("decision 'risk' missing")
|
|
39
|
+
process.exit(1)
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`npm i @bpmnkit/core`. The script writes `risk.dmn` with its diagram, re-opens it, renames the decision without touching the layout, and checks the decision id.
|
|
44
|
+
|
|
45
|
+
## Several decisions in one file: `Dmn.drd()`
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import { writeFileSync } from "node:fs"
|
|
49
|
+
import { Dmn } from "@bpmnkit/core"
|
|
50
|
+
|
|
51
|
+
// Two decisions in one file: "approval" reads the result of "riskScore".
|
|
52
|
+
const drd = Dmn.drd("Order approval")
|
|
53
|
+
const riskScore = drd.decision("riskScore", (t) =>
|
|
54
|
+
t
|
|
55
|
+
.name("Risk score")
|
|
56
|
+
.hitPolicy("FIRST")
|
|
57
|
+
.input({ label: "Amount", expression: "amount", typeRef: "number" })
|
|
58
|
+
.output({ label: "Risk", name: "risk", typeRef: "string" })
|
|
59
|
+
.rule({ inputs: ["> 1000"], outputs: ['"high"'] })
|
|
60
|
+
.rule({ inputs: ["-"], outputs: ['"low"'] }),
|
|
61
|
+
)
|
|
62
|
+
drd.decision(
|
|
63
|
+
"approval",
|
|
64
|
+
(t) =>
|
|
65
|
+
t
|
|
66
|
+
.name("Approval")
|
|
67
|
+
.input({ label: "Risk", expression: "risk", typeRef: "string" })
|
|
68
|
+
.output({ label: "Approved", name: "approved", typeRef: "boolean" })
|
|
69
|
+
.rule({ inputs: ['"low"'], outputs: ["true"] })
|
|
70
|
+
.rule({ inputs: ["-"], outputs: ["false"] }),
|
|
71
|
+
{ requires: [riskScore] }, // pass the handle; a name or label is a type error
|
|
72
|
+
)
|
|
73
|
+
writeFileSync("approval.dmn", drd.toXml())
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`drd.decision(id, table, { requires })` returns a handle; `requires` takes handles (or `drd.inputData(id, name)` handles), never names. A `requires` that points at an unknown id throws at `build()`/`toXml()`.
|
|
77
|
+
|
|
78
|
+
## Top builder options
|
|
79
|
+
|
|
80
|
+
- `Dmn.createDecisionTable(decisionId)` … `.build()` returns `DmnDefinitions`; `Dmn.export(defs)` gives the XML with DMNDI shapes.
|
|
81
|
+
- `.name(text)` is the display name; `.hitPolicy("UNIQUE" | "FIRST" | "ANY" | "COLLECT" | "RULE ORDER" | "OUTPUT ORDER" | "PRIORITY")`.
|
|
82
|
+
- `.input({ label, expression, typeRef })`: `expression` is a FEEL expression over process variables (`amount`, `order.total`).
|
|
83
|
+
- `.output({ label, name, typeRef })`: `name` is the key in the result.
|
|
84
|
+
- `.rule({ inputs, outputs, description })`: one entry per column, in column order, or `build` throws.
|
|
85
|
+
- `typeRef`: `"string" | "number" | "boolean" | "date"`.
|
|
86
|
+
- Read or change an existing file: `Dmn.parse(xml)` → `defs.decisions[i].decisionTable`.
|
|
87
|
+
|
|
88
|
+
## Traps
|
|
89
|
+
|
|
90
|
+
- **The process calls the decision id.** A BPMN `businessRuleTask(id, { decisionId: "risk", resultVariable: "risk" })` must use the argument of `createDecisionTable("risk")`, not the DMN `definitions` id, the file name or `.name()`. Ids are unique across the cluster: a second file with decision `risk` deploys as a new version of the same decision.
|
|
91
|
+
- **Deploy the `.dmn` before an instance reaches the task.** The call binds to the latest deployed version: `casen deploy deploy risk.dmn` first.
|
|
92
|
+
- **Hit policy `UNIQUE` is the default.** Two matching rules is a runtime incident. Use `FIRST` for a catch-all last row, or `COLLECT` for a list.
|
|
93
|
+
- **Input entries are FEEL unary tests, outputs are FEEL expressions,** and neither starts with `=`. `-` matches anything; `> 1000`, `[1..10]`, `"DE"`, `not("DE", "AT")`. A string output needs quotes: `'"high"'`, not `"high"`.
|
|
94
|
+
- **Result shape.** With one output column the result variable holds the value; with several it holds an object keyed by output `name`; `COLLECT` gives a list.
|
|
95
|
+
- **Edit with the preserving writer.** Write `exportDmnPreserving(original, edited)`; `Dmn.export` alone reformats the file and its diagram.
|
|
96
|
+
|
|
97
|
+
## Validate
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
casen check risk.dmn order.bpmn --deploy # DMN lint + every decisionId in the BPMN resolves
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`casen check <files...>` takes `.bpmn`, `.dmn` and `.form` together and exits 1 on errors; add `--json` for an agent loop. The script above also re-parses the file and checks the decision id.
|
|
104
|
+
|
|
105
|
+
Related cards: `casen agent-card bpmn`, `casen agent-card form`. More: `npx bpmnkit-docs ask "decision table hit policy"`.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Form agent card
|
|
2
|
+
|
|
3
|
+
Write a Camunda 8 form (`.form` JSON) with `@bpmnkit/core` in one script: create, export, edit, validate. Run it with `node --experimental-strip-types build.ts` (Node 22.6+) or `npx tsx build.ts`. Never write form JSON by hand.
|
|
4
|
+
|
|
5
|
+
<!-- docspack: tags=agent-card,cheat-sheet,build-script,form,camunda-form,user-task-form,start-form,create,write,script -->
|
|
6
|
+
|
|
7
|
+
## Minimal form build script: create, export, edit, validate
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { readFileSync, writeFileSync } from "node:fs"
|
|
11
|
+
import { Form, exportFormPreserving } from "@bpmnkit/core"
|
|
12
|
+
|
|
13
|
+
// 1. Create. "review-order" is the form id a userTask or startEvent references as formId.
|
|
14
|
+
const form = Form.create("review-order")
|
|
15
|
+
.text("## Review order")
|
|
16
|
+
.textfield("Customer", "customer", { validate: { required: true } })
|
|
17
|
+
.select("Decision", "decision", {
|
|
18
|
+
values: [
|
|
19
|
+
{ label: "Approve", value: "approve" },
|
|
20
|
+
{ label: "Reject", value: "reject" },
|
|
21
|
+
],
|
|
22
|
+
validate: { required: true },
|
|
23
|
+
})
|
|
24
|
+
.textarea("Comment", "comment")
|
|
25
|
+
.checkbox("Notify customer", "notify")
|
|
26
|
+
.build()
|
|
27
|
+
|
|
28
|
+
// 2. Export.
|
|
29
|
+
writeFileSync("review-order.form", Form.export(form))
|
|
30
|
+
|
|
31
|
+
// 3. Edit an existing file: parse, change, write with exportFormPreserving to keep key order and ids.
|
|
32
|
+
const original = readFileSync("review-order.form", "utf8")
|
|
33
|
+
const edited = Form.parse(original)
|
|
34
|
+
edited.components.push({
|
|
35
|
+
id: "Field_note",
|
|
36
|
+
type: "text",
|
|
37
|
+
text: "Reviewed orders ship the same day.",
|
|
38
|
+
})
|
|
39
|
+
writeFileSync("review-order.form", exportFormPreserving(original, edited))
|
|
40
|
+
|
|
41
|
+
// 4. Validate: it parses back with the id the process references.
|
|
42
|
+
const check = Form.parse(readFileSync("review-order.form", "utf8"))
|
|
43
|
+
if (check.id !== "review-order") {
|
|
44
|
+
console.error(`form id is ${check.id}, expected review-order`)
|
|
45
|
+
process.exit(1)
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`npm i @bpmnkit/core`. The script writes `review-order.form`, re-opens it, adds a component without reordering the rest, and checks the form id.
|
|
50
|
+
|
|
51
|
+
## Top builder options
|
|
52
|
+
|
|
53
|
+
- `Form.create(id)` … `.build()` returns a `FormDefinition`; `Form.export(form)` gives the JSON.
|
|
54
|
+
- Fields take `(label, key, options)`: `textfield`, `textarea`, `select` (`values` or `valuesKey`), `checkbox`; `radio(label, key, values)`.
|
|
55
|
+
- `text(markdown)` is static text; `group(label, (g) => g.textfield(...))` nests fields.
|
|
56
|
+
- `options.validate`: `{ required, minLength, maxLength }`; `defaultValue`; `id` for a fixed component id.
|
|
57
|
+
- The builder stamps `8.10.0`; override with `.executionPlatformVersion("8.8.0")`.
|
|
58
|
+
- Read or change an existing file: `Form.parse(json)` → `form.components`.
|
|
59
|
+
|
|
60
|
+
## Traps
|
|
61
|
+
|
|
62
|
+
- **The process calls the form id.** `userTask(id, { zeebeUserTask: true, formId: "review-order" })` and `startEvent(id, { formId })` must equal `Form.create("review-order")`, the JSON `id`, not the file name.
|
|
63
|
+
- **Deploy the `.form` before an instance reaches the task.** `formId` binds to the latest deployed form with that id: `casen deploy deploy review-order.form` first. With `formBindingType: "deployment"` it must be in the same deployment as the process.
|
|
64
|
+
- **`key` is the process variable** the field reads and writes. Keep keys equal to the variable names the process and its gateways use; a typo silently creates a new variable.
|
|
65
|
+
- **Use a Camunda user task** (`zeebeUserTask: true`) for a linked form; Camunda 8.10 deprecates job-worker user tasks.
|
|
66
|
+
- **Edit with the preserving writer.** Write `exportFormPreserving(original, edited)`; it keeps key order and component ids, so the diff shows only your change.
|
|
67
|
+
|
|
68
|
+
## Validate
|
|
69
|
+
|
|
70
|
+
The script re-parses the file and checks the form id. Before deploying, run `casen check review-order.form order.bpmn --deploy`: it lints the form and checks that every `formId` in the `.bpmn` names a form. Check by hand that each `key` is a variable the process expects.
|
|
71
|
+
|
|
72
|
+
Related cards: `casen agent-card bpmn`, `casen agent-card dmn`. More: `npx bpmnkit-docs ask "form on a start event"`.
|
package/dist/bpmn/auto-layout.js
CHANGED
|
@@ -752,7 +752,8 @@ export function applyAutoLayout(defs, engine = "semantic", hints) {
|
|
|
752
752
|
}
|
|
753
753
|
else {
|
|
754
754
|
dx = PADDING - minX;
|
|
755
|
-
|
|
755
|
+
// Below any pools already stacked; poolY is 0 without a collaboration.
|
|
756
|
+
dy = (process?.id === primaryProcessId ? poolY : 0) + PADDING - minY;
|
|
756
757
|
}
|
|
757
758
|
// Only the primary process shares the root plane; any other root process
|
|
758
759
|
// owns one, instead of being stacked on top of the first at the origin.
|
|
@@ -841,7 +841,7 @@ export declare class ProcessBuilder {
|
|
|
841
841
|
private resolvePendingSplice;
|
|
842
842
|
/** Enable auto-layout: `build()` will run the layout engine and populate diagram interchange data. */
|
|
843
843
|
withAutoLayout(): this;
|
|
844
|
-
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.
|
|
844
|
+
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.10.0"`. */
|
|
845
845
|
executionPlatformVersion(version: string): this;
|
|
846
846
|
/** Set process-wide defaults applied to subsequently added elements. */
|
|
847
847
|
defaults(options: {
|
|
@@ -1097,7 +1097,7 @@ export declare class DiagramBuilder {
|
|
|
1097
1097
|
private _collaborationId;
|
|
1098
1098
|
private _executionPlatformVersion;
|
|
1099
1099
|
constructor(id: string);
|
|
1100
|
-
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.
|
|
1100
|
+
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.10.0"`. */
|
|
1101
1101
|
executionPlatformVersion(version: string): this;
|
|
1102
1102
|
process(id: string, callback: (b: ProcessBuilder) => void): this;
|
|
1103
1103
|
/** Renames the collaboration element. Defaults to `"Collaboration_1"`. */
|
|
@@ -3,7 +3,7 @@ import { generateId } from "../types/id-generator.js";
|
|
|
3
3
|
import { applyAutoLayout } from "./auto-layout.js";
|
|
4
4
|
import { createFlowElement } from "./element-shape.js";
|
|
5
5
|
import { REST_CONNECTOR_TEMPLATE_VERSION, restConnectorRetries, restConnectorTaskType, restConnectorToIoMappingInputs, restConnectorToTaskHeaders, } from "./rest-connector.js";
|
|
6
|
-
import { assertExplicitFlowIdsUnique, assignStableFlowIds, markExplicitFlowId, rootDefinitionId, setFlowDiscriminatorSource, } from "./stable-ids.js";
|
|
6
|
+
import { assertExplicitFlowIdsUnique, assignEventDefinitionIds, assignStableFlowIds, markExplicitFlowId, rootDefinitionId, setFlowDiscriminatorSource, } from "./stable-ids.js";
|
|
7
7
|
import { assertZeebePlacement, bpmnElementName, ensureZeebeExtension, makeConditionalDefinition, zeebeExtensionsToXmlElements, } from "./zeebe-extensions.js";
|
|
8
8
|
// Keep in sync with packages/core/package.json version
|
|
9
9
|
const EXPORTER_VERSION = "0.0.23";
|
|
@@ -706,7 +706,7 @@ function resolveBoundaryEventArgs(id, attachedToOrOptions, maybeOptions) {
|
|
|
706
706
|
? { ...maybeOptions, attachedTo: attachedToOrOptions }
|
|
707
707
|
: attachedToOrOptions;
|
|
708
708
|
if (typeof options?.attachedTo !== "string" || options.attachedTo === "") {
|
|
709
|
-
throw new ValidationError(`boundaryEvent("${id}") requires the id of the activity it attaches to. Pass it as options.attachedTo, as boundaryEvent("${id}", hostId, options), or use withBoundary() to attach to the preceding activity.`);
|
|
709
|
+
throw new ValidationError(`boundaryEvent("${id}") requires the id of the activity it attaches to. Pass it as options.attachedTo, as boundaryEvent("${id}", hostId, options), or use withBoundary() to attach to the preceding activity. See agent-cards/bpmn.md#traps.`);
|
|
710
710
|
}
|
|
711
711
|
return options;
|
|
712
712
|
}
|
|
@@ -832,6 +832,10 @@ function insertJoinGateways(elements, flows) {
|
|
|
832
832
|
* final until join inference has run, and its id is not final until this pass.
|
|
833
833
|
*/
|
|
834
834
|
function finalizeScope(elements, flows) {
|
|
835
|
+
for (const el of elements) {
|
|
836
|
+
if ("eventDefinitions" in el)
|
|
837
|
+
assignEventDefinitionIds(el.id, el.eventDefinitions);
|
|
838
|
+
}
|
|
835
839
|
insertJoinGateways(elements, flows);
|
|
836
840
|
assignStableFlowIds(elements, flows);
|
|
837
841
|
recomputeIncomingOutgoing(elements, flows);
|
|
@@ -1824,7 +1828,7 @@ export class ProcessBuilder {
|
|
|
1824
1828
|
currentGatewayId;
|
|
1825
1829
|
openBranchEnds = [];
|
|
1826
1830
|
_autoLayout = false;
|
|
1827
|
-
_executionPlatformVersion = "8.
|
|
1831
|
+
_executionPlatformVersion = "8.10.0";
|
|
1828
1832
|
_serviceTaskDefaults = {};
|
|
1829
1833
|
_savedMainFlowId = undefined;
|
|
1830
1834
|
/** Set by {@link ProcessBuilder.from}; makes `build()` update rather than generate. */
|
|
@@ -1975,7 +1979,7 @@ export class ProcessBuilder {
|
|
|
1975
1979
|
this._autoLayout = true;
|
|
1976
1980
|
return this;
|
|
1977
1981
|
}
|
|
1978
|
-
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.
|
|
1982
|
+
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.10.0"`. */
|
|
1979
1983
|
executionPlatformVersion(version) {
|
|
1980
1984
|
this._executionPlatformVersion = version;
|
|
1981
1985
|
return this;
|
|
@@ -2590,6 +2594,13 @@ export class ProcessBuilder {
|
|
|
2590
2594
|
// not renumber the part the caller did not touch.
|
|
2591
2595
|
assignStableFlowIds(this.flowElements, this.sequenceFlows, this._source === undefined ? undefined : new Set(this._sourceFlowTargets.keys()));
|
|
2592
2596
|
assertExplicitFlowIdsUnique(this.flowElements, this.sequenceFlows);
|
|
2597
|
+
// A continued document keeps its untouched part byte-for-byte, ids included.
|
|
2598
|
+
if (this._source === undefined) {
|
|
2599
|
+
for (const el of this.flowElements) {
|
|
2600
|
+
if ("eventDefinitions" in el)
|
|
2601
|
+
assignEventDefinitionIds(el.id, el.eventDefinitions);
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2593
2604
|
recomputeIncomingOutgoing(this.flowElements, this.sequenceFlows);
|
|
2594
2605
|
if (this._source !== undefined)
|
|
2595
2606
|
return this.buildOntoSource(this._source);
|
|
@@ -2831,11 +2842,11 @@ export class DiagramBuilder {
|
|
|
2831
2842
|
_participants = [];
|
|
2832
2843
|
_messageFlows = [];
|
|
2833
2844
|
_collaborationId = "Collaboration_1";
|
|
2834
|
-
_executionPlatformVersion = "8.
|
|
2845
|
+
_executionPlatformVersion = "8.10.0";
|
|
2835
2846
|
constructor(id) {
|
|
2836
2847
|
this._id = id;
|
|
2837
2848
|
}
|
|
2838
|
-
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.
|
|
2849
|
+
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.10.0"`. */
|
|
2839
2850
|
executionPlatformVersion(version) {
|
|
2840
2851
|
this._executionPlatformVersion = version;
|
|
2841
2852
|
return this;
|
|
@@ -36,7 +36,7 @@ export interface Camunda7Report {
|
|
|
36
36
|
total: number;
|
|
37
37
|
}
|
|
38
38
|
export interface Camunda7ConvertOptions {
|
|
39
|
-
/** Written as `modeler:executionPlatformVersion`. Default `"8.
|
|
39
|
+
/** Written as `modeler:executionPlatformVersion`. Default `"8.10.0"`. */
|
|
40
40
|
executionPlatformVersion?: string;
|
|
41
41
|
/**
|
|
42
42
|
* Ignored. Kept for compatibility: earlier versions read `camunda:` attributes
|
|
@@ -6,7 +6,7 @@ import { containsJuel, feelString, isFeelName, translateJuelToFeel } from "./jue
|
|
|
6
6
|
export const CAMUNDA7_NS = "http://camunda.org/schema/1.0/bpmn";
|
|
7
7
|
export const ZEEBE_NS = "http://camunda.org/schema/zeebe/1.0";
|
|
8
8
|
export const MODELER_NS = "http://camunda.org/schema/modeler/1.0";
|
|
9
|
-
const DEFAULT_PLATFORM_VERSION = "8.
|
|
9
|
+
const DEFAULT_PLATFORM_VERSION = "8.10.0";
|
|
10
10
|
/** The event definitions and loop of a flow element, which carry attributes of their own. */
|
|
11
11
|
function nestedHolders(owner) {
|
|
12
12
|
const holders = [];
|
package/dist/bpmn/compact.js
CHANGED
|
@@ -3,6 +3,7 @@ import { layoutProcess } from "../layout/index.js";
|
|
|
3
3
|
import { assertBpmnDefinitions, assertCompactDiagram } from "./argument-guards.js";
|
|
4
4
|
import { addAnnotationShapes } from "./auto-layout.js";
|
|
5
5
|
import { restConnectorTaskType } from "./rest-connector.js";
|
|
6
|
+
import { assignEventDefinitionIds } from "./stable-ids.js";
|
|
6
7
|
import { makeConditionalDefinition } from "./zeebe-extensions.js";
|
|
7
8
|
// ── Default flows ────────────────────────────────────────────────────────────
|
|
8
9
|
/**
|
|
@@ -575,6 +576,8 @@ defaultFlow) {
|
|
|
575
576
|
? makeConditionalDefinition(el.condition)
|
|
576
577
|
: made;
|
|
577
578
|
const eventDefs = eventDef ? [eventDef] : [];
|
|
579
|
+
// Zeebe rejects an id-less definition at deploy time; the builder derives the same ids.
|
|
580
|
+
assignEventDefinitionIds(el.id, eventDefs);
|
|
578
581
|
const subContent = buildSubContent(el.children);
|
|
579
582
|
const loop = el.multiInstance && {
|
|
580
583
|
loopCharacteristics: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { assertBpmnDefinitions, assertCompactDiagram } from "./argument-guards.js";
|
|
2
2
|
import { buildFlowElement, defaultFlows, makeEventDef, } from "./compact.js";
|
|
3
|
+
import { assignEventDefinitionIds } from "./stable-ids.js";
|
|
3
4
|
import { assertZeebePlacement, bpmnElementName, ensureZeebeExtension, isZeebePlacementAllowed, zeebeExtensionsToXmlElements, } from "./zeebe-extensions.js";
|
|
4
5
|
/** Thrown by {@link applyBpmnOperations} in strict mode. */
|
|
5
6
|
export class OperationError extends Error {
|
|
@@ -568,6 +569,7 @@ function patchElement(definitions, element, patch) {
|
|
|
568
569
|
if (current !== patch.eventType) {
|
|
569
570
|
const replacement = makeEventDef(patch.eventType);
|
|
570
571
|
element.eventDefinitions = replacement ? [replacement] : [];
|
|
572
|
+
assignEventDefinitionIds(element.id, element.eventDefinitions);
|
|
571
573
|
}
|
|
572
574
|
}
|
|
573
575
|
return undefined;
|
package/dist/bpmn/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export declare const SAMPLE_BPMN_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"
|
|
|
23
23
|
*
|
|
24
24
|
* const xml2 = Bpmn.export(defs2)
|
|
25
25
|
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see node_modules/@bpmnkit/core/agent-cards/bpmn.md — runnable script and traps (~1k tokens)
|
|
26
28
|
*/
|
|
27
29
|
export declare const Bpmn: {
|
|
28
30
|
/**
|
package/dist/bpmn/index.js
CHANGED
|
@@ -66,6 +66,8 @@ export const SAMPLE_BPMN_XML = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
66
66
|
*
|
|
67
67
|
* const xml2 = Bpmn.export(defs2)
|
|
68
68
|
* ```
|
|
69
|
+
*
|
|
70
|
+
* @see node_modules/@bpmnkit/core/agent-cards/bpmn.md — runnable script and traps (~1k tokens)
|
|
69
71
|
*/
|
|
70
72
|
export const Bpmn = {
|
|
71
73
|
/**
|
|
@@ -35,6 +35,20 @@ messages = []) {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
for (const el of p.flowElements) {
|
|
38
|
+
if ("eventDefinitions" in el) {
|
|
39
|
+
const missingId = el.eventDefinitions.filter((d) => !d.id);
|
|
40
|
+
if (missingId.length > 0) {
|
|
41
|
+
findings.push({
|
|
42
|
+
id: "deploy/event-definition-no-id",
|
|
43
|
+
category: "deploy",
|
|
44
|
+
severity: "error",
|
|
45
|
+
message: `"${el.name ?? el.id}" has ${missingId.length} event definition(s) without an id.`,
|
|
46
|
+
suggestion: "Give every event definition an id (e.g. <ElementId>_TimerEventDefinition) — Zeebe rejects a definition without one.",
|
|
47
|
+
processId,
|
|
48
|
+
elementIds: [el.id],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
38
52
|
if (el.type === "serviceTask" || el.type === "sendTask") {
|
|
39
53
|
const type = readZeebeTaskType(el.extensionElements);
|
|
40
54
|
if (!type) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BpmnDefinitions } from "../bpmn-model.js";
|
|
2
2
|
import type { OptimizationReport, OptimizeOptions } from "./types.js";
|
|
3
|
+
/** The finding a user task with no form raises; see `OptimizeOptions.userTaskForms`. */
|
|
4
|
+
export declare const USER_TASK_FORM_RULE = "compat/user-task-definition";
|
|
3
5
|
/** Run static analysis on a BPMN definitions object. */
|
|
4
6
|
export declare function optimize(defs: BpmnDefinitions, options?: OptimizeOptions): OptimizationReport;
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -8,6 +8,8 @@ import { analyzeNaming } from "./naming.js";
|
|
|
8
8
|
import { analyzePatterns } from "./patterns.js";
|
|
9
9
|
import { analyzeTasks } from "./tasks.js";
|
|
10
10
|
import { analyzeVariableFlow } from "./variable-flow.js";
|
|
11
|
+
/** The finding a user task with no form raises; see `OptimizeOptions.userTaskForms`. */
|
|
12
|
+
export const USER_TASK_FORM_RULE = "compat/user-task-definition";
|
|
11
13
|
const ALL_CATEGORIES = [
|
|
12
14
|
"feel",
|
|
13
15
|
"feel-syntax",
|
|
@@ -74,6 +76,9 @@ export function optimize(defs, options) {
|
|
|
74
76
|
if (resolved.categories.includes("deploy") || options?.camundaVersion !== undefined) {
|
|
75
77
|
findings.push(...analyzeCamundaCompat(defs, resolved.camundaVersion));
|
|
76
78
|
findings = dedupeCamundaCompat(findings);
|
|
79
|
+
if (options?.userTaskForms === "off") {
|
|
80
|
+
findings = findings.filter((f) => f.id !== USER_TASK_FORM_RULE);
|
|
81
|
+
}
|
|
77
82
|
}
|
|
78
83
|
const byCategory = Object.fromEntries(ALL_CATEGORIES.map((c) => [c, findings.filter((f) => f.category === c).length]));
|
|
79
84
|
const bySeverity = Object.fromEntries(["info", "warning", "error"].map((s) => [
|
|
@@ -57,6 +57,13 @@ export interface OptimizeOptions {
|
|
|
57
57
|
* `compat` reports nothing.
|
|
58
58
|
*/
|
|
59
59
|
camundaVersion?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Whether a user task with no `zeebe:formDefinition` is reported
|
|
62
|
+
* (`compat/user-task-definition`). Default `"require"`. Zeebe deploys such a
|
|
63
|
+
* task fine; `"off"` suits a sketch or a gate that should not push an author
|
|
64
|
+
* to invent a form reference.
|
|
65
|
+
*/
|
|
66
|
+
userTaskForms?: "require" | "off";
|
|
60
67
|
}
|
|
61
68
|
export interface ResolvedOptions {
|
|
62
69
|
feelLengthThreshold: number;
|
|
@@ -38,4 +38,19 @@ export declare function assignStableFlowIds(elements: BpmnFlowElement[], flows:
|
|
|
38
38
|
export declare function rootDefinitionId(prefix: string, source: string, existing: ReadonlyArray<{
|
|
39
39
|
id: string;
|
|
40
40
|
}>): string;
|
|
41
|
+
/**
|
|
42
|
+
* Id for an event definition that carries none. Zeebe rejects a definition
|
|
43
|
+
* without an `id` at deploy time, so one is derived from the owning event
|
|
44
|
+
* (`Start_TimerEventDefinition`), with a counter when an event holds several
|
|
45
|
+
* of one kind. Ids already present on sibling definitions are never reused.
|
|
46
|
+
*/
|
|
47
|
+
export declare function eventDefinitionId(ownerId: string, defs: readonly {
|
|
48
|
+
id?: string;
|
|
49
|
+
type: string;
|
|
50
|
+
}[], index: number): string;
|
|
51
|
+
/** Gives every id-less definition of `defs` a derived id; see `eventDefinitionId`. */
|
|
52
|
+
export declare function assignEventDefinitionIds(ownerId: string, defs: {
|
|
53
|
+
id?: string;
|
|
54
|
+
type: string;
|
|
55
|
+
}[]): void;
|
|
41
56
|
//# sourceMappingURL=stable-ids.d.ts.map
|
package/dist/bpmn/stable-ids.js
CHANGED
|
@@ -197,4 +197,30 @@ export function rootDefinitionId(prefix, source, existing) {
|
|
|
197
197
|
const taken = new Set(existing.map((definition) => definition.id));
|
|
198
198
|
return uniqueId(capLength(`${prefix}_${ncName(slugify(source))}`), taken);
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Id for an event definition that carries none. Zeebe rejects a definition
|
|
202
|
+
* without an `id` at deploy time, so one is derived from the owning event
|
|
203
|
+
* (`Start_TimerEventDefinition`), with a counter when an event holds several
|
|
204
|
+
* of one kind. Ids already present on sibling definitions are never reused.
|
|
205
|
+
*/
|
|
206
|
+
export function eventDefinitionId(ownerId, defs, index) {
|
|
207
|
+
const def = defs[index];
|
|
208
|
+
if (def === undefined)
|
|
209
|
+
return `${ncName(ownerId)}_EventDefinition`;
|
|
210
|
+
const kind = def.type.charAt(0).toUpperCase() + def.type.slice(1);
|
|
211
|
+
const base = `${ncName(ownerId)}_${kind}EventDefinition`;
|
|
212
|
+
const taken = new Set(defs.map((d) => d.id).filter((id) => id !== undefined));
|
|
213
|
+
const sameKind = defs.slice(0, index + 1).filter((d) => d.type === def.type).length;
|
|
214
|
+
let candidate = sameKind > 1 ? `${base}_${sameKind}` : base;
|
|
215
|
+
for (let n = sameKind + 1; taken.has(candidate); n++)
|
|
216
|
+
candidate = `${base}_${n}`;
|
|
217
|
+
return candidate;
|
|
218
|
+
}
|
|
219
|
+
/** Gives every id-less definition of `defs` a derived id; see `eventDefinitionId`. */
|
|
220
|
+
export function assignEventDefinitionIds(ownerId, defs) {
|
|
221
|
+
defs.forEach((d, i) => {
|
|
222
|
+
if (d.id === undefined)
|
|
223
|
+
d.id = eventDefinitionId(ownerId, defs, i);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
200
226
|
//# sourceMappingURL=stable-ids.js.map
|
package/dist/bpmn/svg.js
CHANGED
|
@@ -121,7 +121,7 @@ export function exportSvg(defs, options) {
|
|
|
121
121
|
// Edge label
|
|
122
122
|
if (flow?.name && edge.label?.bounds) {
|
|
123
123
|
const { x, y, width, height } = edge.label.bounds;
|
|
124
|
-
edgeParts.push(labelSvg(flow.name, x + width / 2, y + height / 2, width
|
|
124
|
+
edgeParts.push(labelSvg(flow.name, x + width / 2, y + height / 2, width, t, false, fontOf(edge.label)));
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
// ── Shapes ────────────────────────────────────────────────────────────────
|
|
@@ -193,7 +193,7 @@ export function exportSvg(defs, options) {
|
|
|
193
193
|
width: 80,
|
|
194
194
|
height: 20,
|
|
195
195
|
};
|
|
196
|
-
labelParts.push(labelSvg(el.name, lb.x + lb.width / 2, lb.y + lb.height / 2, lb.width
|
|
196
|
+
labelParts.push(labelSvg(el.name, lb.x + lb.width / 2, lb.y + lb.height / 2, lb.width, t, true, font));
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
// ── Assemble SVG ──────────────────────────────────────────────────────────
|
|
@@ -511,10 +511,9 @@ function renderTask(el, width, height, t, options) {
|
|
|
511
511
|
out += labelSvg(el.name, width / 2, height / 2, width - 16, t, false, options?.font);
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
type === "transaction") {
|
|
514
|
+
// The "+" marker means "contents elsewhere"; an expanded body shows them.
|
|
515
|
+
const container = type === "subProcess" || type === "eventSubProcess" || type === "transaction";
|
|
516
|
+
if ((container && !options?.expanded) || type === "adHocSubProcess") {
|
|
518
517
|
out += iconGroup(subProcessMarker(type), width / 2, height - 10, t);
|
|
519
518
|
}
|
|
520
519
|
return out;
|