@bpmnkit/core 1.15.0 → 1.17.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/builder-reference.md +2 -1
- package/dist/bpmn/auto-layout.d.ts +0 -8
- package/dist/bpmn/auto-layout.js +605 -98
- package/dist/bpmn/bpmn-builder.d.ts +120 -14
- package/dist/bpmn/bpmn-builder.js +411 -152
- package/dist/bpmn/bpmn-model.d.ts +15 -0
- package/dist/bpmn/bpmn-parser.js +32 -6
- package/dist/bpmn/bpmn-serializer.js +9 -2
- package/dist/bpmn/compact-stream.d.ts +7 -0
- package/dist/bpmn/compact-stream.js +7 -0
- package/dist/bpmn/compact.d.ts +124 -9
- package/dist/bpmn/compact.js +295 -27
- package/dist/bpmn/full-operations.d.ts +19 -0
- package/dist/bpmn/full-operations.js +191 -7
- package/dist/bpmn/make-room.js +114 -0
- package/dist/bpmn/place-new-shapes.js +4 -2
- package/dist/bpmn/preserving-writer.d.ts +1 -1
- package/dist/bpmn/preserving-writer.js +1 -1
- package/dist/bpmn/process-delta.d.ts +32 -1
- package/dist/bpmn/process-delta.js +62 -1
- package/dist/bpmn/process-text-writer.d.ts +18 -7
- package/dist/bpmn/process-text-writer.js +105 -22
- package/dist/bpmn/process-text.d.ts +27 -1
- package/dist/bpmn/process-text.js +350 -2
- package/dist/bpmn/swimlanes.d.ts +178 -0
- package/dist/bpmn/swimlanes.js +774 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3 -2
- package/dist/layout/collaboration/crossings.d.ts +13 -0
- package/dist/layout/collaboration/crossings.js +37 -0
- package/dist/layout/collaboration/docked-labels.d.ts +21 -0
- package/dist/layout/collaboration/docked-labels.js +65 -0
- package/dist/layout/collaboration/message-tracks.d.ts +20 -0
- package/dist/layout/collaboration/message-tracks.js +78 -0
- package/dist/layout/collaboration/stack-crossings.d.ts +38 -0
- package/dist/layout/collaboration/stack-crossings.js +155 -0
- package/dist/layout/grid/edge-labels.js +21 -10
- package/dist/layout/layered/coords.d.ts +13 -0
- package/dist/layout/layered/coords.js +211 -0
- package/dist/layout/layered/index.d.ts +21 -0
- package/dist/layout/layered/index.js +288 -0
- package/dist/layout/layered/layers.d.ts +60 -0
- package/dist/layout/layered/layers.js +374 -0
- package/dist/layout/layered/route.d.ts +66 -0
- package/dist/layout/layered/route.js +369 -0
- package/dist/layout/layout-engine.d.ts +6 -2
- package/dist/layout/layout-engine.js +4 -2
- package/dist/layout/semantic/bands.js +8 -2
- package/dist/layout/semantic/graph.d.ts +33 -1
- package/dist/layout/semantic/graph.js +200 -4
- package/dist/layout/semantic/index.d.ts +8 -2
- package/dist/layout/semantic/index.js +114 -14
- package/dist/layout/semantic/lanes.d.ts +40 -0
- package/dist/layout/semantic/lanes.js +198 -0
- package/dist/layout/semantic/place.d.ts +46 -2
- package/dist/layout/semantic/place.js +248 -30
- package/dist/layout/semantic/route.js +35 -2
- package/dist/layout/types.d.ts +0 -8
- package/dist/xml/xml-patch.d.ts +1 -1
- package/package.json +2 -2
|
@@ -4,13 +4,20 @@
|
|
|
4
4
|
* ({@link PROCESS_DELTA_GUIDE}) that names its nodes by id.
|
|
5
5
|
*
|
|
6
6
|
* Written ids are short aliases: a Modeler id such as `Activity_0x9k2lm` costs
|
|
7
|
-
* several tokens and tells the model nothing, so each node
|
|
8
|
-
* name-derived alias (`review_application`) and the map back to
|
|
9
|
-
* returned beside the text. An id that is already short and
|
|
7
|
+
* several tokens and tells the model nothing, so each node, lane and pool is
|
|
8
|
+
* written under a name-derived alias (`review_application`) and the map back to
|
|
9
|
+
* the real id is returned beside the text. An id that is already short and
|
|
10
|
+
* readable is kept.
|
|
10
11
|
*
|
|
11
|
-
* Only what the format can express is written
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Only what the format can express is written, for one process: the
|
|
13
|
+
* {@link primaryProcess} (the executable one, which need not come first in a
|
|
14
|
+
* Modeler collaboration). That is its flow nodes, sequence flows, the tasks of
|
|
15
|
+
* an ad-hoc sub-process, documentation, notes and connectors; its leaf lanes;
|
|
16
|
+
* every other pool of the first collaboration, as a black box; and the message
|
|
17
|
+
* flows between one of its top-level nodes and such a pool. Data objects, event
|
|
18
|
+
* sub-processes, the inside of any other sub-process, parent lanes of nested
|
|
19
|
+
* lanes, the content of other pools, and messages that touch the process's own
|
|
20
|
+
* pool or a node of another pool are left out. A script cannot name what it was
|
|
14
21
|
* never shown, so those parts cannot be changed by it either.
|
|
15
22
|
*
|
|
16
23
|
* @packageDocumentation
|
|
@@ -19,6 +26,7 @@ import { assertBpmnDefinitions } from "./argument-guards.js";
|
|
|
19
26
|
import { compactify } from "./compact.js";
|
|
20
27
|
import { FIXED_KINDS } from "./process-delta.js";
|
|
21
28
|
import { KINDS, cycle, duration, splitMappings } from "./process-text.js";
|
|
29
|
+
import { leafLanes, primaryProcess } from "./swimlanes.js";
|
|
22
30
|
const KIND_WORDS = new Map([...Object.entries(KINDS), ...Object.entries(FIXED_KINDS)].map(([word, type]) => [type, word]));
|
|
23
31
|
/** Ids kept as they are: short, lowercase, and readable. */
|
|
24
32
|
const READABLE_ID = /^[a-z][a-z0-9_]{0,23}$/;
|
|
@@ -58,12 +66,13 @@ function platformVersion(definitions) {
|
|
|
58
66
|
const version = /^\s*(\d+\.\d+)/.exec(definitions.unknownAttributes["modeler:executionPlatformVersion"] ?? "");
|
|
59
67
|
return version?.[1];
|
|
60
68
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
/** The alias of `id`: the id when readable and free, else derived from `name`, else from `kind`. */
|
|
70
|
+
function aliasFor(id, name, kind, taken) {
|
|
71
|
+
if (READABLE_ID.test(id) && !taken.has(id)) {
|
|
72
|
+
taken.add(id);
|
|
73
|
+
return id;
|
|
65
74
|
}
|
|
66
|
-
const words = (
|
|
75
|
+
const words = (name ?? "")
|
|
67
76
|
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
68
77
|
.toLowerCase()
|
|
69
78
|
.split(/[^a-z0-9]+/)
|
|
@@ -71,7 +80,7 @@ function aliasFor(element, taken) {
|
|
|
71
80
|
.slice(0, ALIAS_WORDS);
|
|
72
81
|
let base = words.join("_");
|
|
73
82
|
if (!/^[a-z]/.test(base))
|
|
74
|
-
base =
|
|
83
|
+
base = kind + (base ? `_${base}` : "");
|
|
75
84
|
let alias = base;
|
|
76
85
|
for (let n = 2; taken.has(alias); n++)
|
|
77
86
|
alias = `${base}_${n}`;
|
|
@@ -82,6 +91,74 @@ function aliasFor(element, taken) {
|
|
|
82
91
|
function token(value) {
|
|
83
92
|
return value !== undefined && /^[^\s,|=[\]]+$/.test(value);
|
|
84
93
|
}
|
|
94
|
+
/** A lane's or pool's name in brackets, or nothing for one without a name. */
|
|
95
|
+
/** `[Name]`, or `[]` for no name: the reader names a lane without a bracket after its id. */
|
|
96
|
+
function bracketed(name) {
|
|
97
|
+
return `[${name ? writableName(name) : ""}]`;
|
|
98
|
+
}
|
|
99
|
+
/** A message label as a `msg` line writes it: raw like a note, so colons stay, but a parenthesis would end it. */
|
|
100
|
+
export function writableMessageLabel(name) {
|
|
101
|
+
return name.replace(/[()]/g, " ").replace(/\s+/g, " ").trim();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The `lane`, `pool` and `msg` lines of `source`, whose written top-level nodes
|
|
105
|
+
* are `nodes`. Lane and pool aliases are claimed here, after every node alias,
|
|
106
|
+
* so a diagram that gains a lane keeps the node aliases it had.
|
|
107
|
+
*
|
|
108
|
+
* Only leaf lanes are written, each with the nodes it lists in their ref order
|
|
109
|
+
* (a node two leaves list goes to the first): a script can move a node between
|
|
110
|
+
* leaf lanes but cannot create a nested lane. Every participant of the
|
|
111
|
+
* collaboration that holds `source`'s pool (else the first collaboration) but
|
|
112
|
+
* that pool is a `pool` line, its content
|
|
113
|
+
* unwritten. A message is written only between a node of `nodes` and such a
|
|
114
|
+
* pool, the two ends the line format can name.
|
|
115
|
+
*/
|
|
116
|
+
function swimlaneLines(definitions, source, nodes, alias, taken) {
|
|
117
|
+
const collaboration = definitions.collaborations.find((c) => c.participants.some((p) => p.processRef === source.id)) ?? definitions.collaborations[0];
|
|
118
|
+
// A node two leaves list is written in the first only, or the reader would move it.
|
|
119
|
+
const placed = new Set();
|
|
120
|
+
const membersOf = new Map();
|
|
121
|
+
for (const lane of leafLanes(source.laneSet)) {
|
|
122
|
+
const members = [...new Set(lane.flowNodeRefs)].filter((id) => nodes.has(id) && !placed.has(id));
|
|
123
|
+
for (const id of members)
|
|
124
|
+
placed.add(id);
|
|
125
|
+
membersOf.set(lane.id, members);
|
|
126
|
+
}
|
|
127
|
+
// An unnamed lane holding nothing has nothing to say, and `lane x:` reads as prose.
|
|
128
|
+
const lanes = leafLanes(source.laneSet).filter((lane) => lane.name || (membersOf.get(lane.id) ?? []).length > 0);
|
|
129
|
+
const pools = (collaboration?.participants ?? []).filter((p) => p.processRef !== source.id);
|
|
130
|
+
const named = [
|
|
131
|
+
...lanes.map((lane) => ({ item: lane, kind: "lane" })),
|
|
132
|
+
...pools.map((pool) => ({ item: pool, kind: "pool" })),
|
|
133
|
+
];
|
|
134
|
+
// Readable ids first, as for nodes.
|
|
135
|
+
for (const { item, kind } of named) {
|
|
136
|
+
if (READABLE_ID.test(item.id))
|
|
137
|
+
alias.set(item.id, aliasFor(item.id, item.name, kind, taken));
|
|
138
|
+
}
|
|
139
|
+
for (const { item, kind } of named) {
|
|
140
|
+
if (!alias.has(item.id))
|
|
141
|
+
alias.set(item.id, aliasFor(item.id, item.name, kind, taken));
|
|
142
|
+
}
|
|
143
|
+
const lines = [];
|
|
144
|
+
for (const lane of lanes) {
|
|
145
|
+
const list = (membersOf.get(lane.id) ?? []).map((id) => alias.get(id)).join(", ");
|
|
146
|
+
lines.push(`lane ${alias.get(lane.id)}${bracketed(lane.name)}: ${list}`.trimEnd());
|
|
147
|
+
}
|
|
148
|
+
for (const pool of pools)
|
|
149
|
+
lines.push(`pool ${alias.get(pool.id)}${bracketed(pool.name)}`);
|
|
150
|
+
const poolIds = new Set(pools.map((pool) => pool.id));
|
|
151
|
+
for (const flow of collaboration?.messageFlows ?? []) {
|
|
152
|
+
const nodeToPool = nodes.has(flow.sourceRef) && poolIds.has(flow.targetRef);
|
|
153
|
+
const poolToNode = poolIds.has(flow.sourceRef) && nodes.has(flow.targetRef);
|
|
154
|
+
if (!nodeToPool && !poolToNode)
|
|
155
|
+
continue;
|
|
156
|
+
const name = flow.name ? writableMessageLabel(flow.name) : "";
|
|
157
|
+
const arrow = name ? `>(${name})` : ">";
|
|
158
|
+
lines.push(`msg ${alias.get(flow.sourceRef)} ${arrow} ${alias.get(flow.targetRef)}`);
|
|
159
|
+
}
|
|
160
|
+
return lines;
|
|
161
|
+
}
|
|
85
162
|
function spec(element, host, container) {
|
|
86
163
|
const word = KIND_WORDS.get(element.type) ?? "task";
|
|
87
164
|
const trigger = element.eventType ? `:${element.eventType}` : "";
|
|
@@ -149,7 +226,9 @@ function label(flow) {
|
|
|
149
226
|
return name ? `>(${name}) ` : "> ";
|
|
150
227
|
}
|
|
151
228
|
/**
|
|
152
|
-
* Writes the
|
|
229
|
+
* Writes the {@link primaryProcess} of `definitions` in the line format, with
|
|
230
|
+
* its leaf lanes, the other pools and their messages (see the module comment
|
|
231
|
+
* for what is left out).
|
|
153
232
|
*
|
|
154
233
|
* Paths start at the start events and follow the flows; each flow is written
|
|
155
234
|
* once and each node is declared where it first appears. A boundary event
|
|
@@ -166,8 +245,10 @@ function label(flow) {
|
|
|
166
245
|
*/
|
|
167
246
|
export function writeProcessText(definitions, options = {}) {
|
|
168
247
|
assertBpmnDefinitions(definitions, "writeProcessText");
|
|
169
|
-
const
|
|
170
|
-
|
|
248
|
+
const source = primaryProcess(definitions);
|
|
249
|
+
// compactify keeps the process order, so the index finds the compact twin.
|
|
250
|
+
const process = source && compactify(definitions).processes[definitions.processes.indexOf(source)];
|
|
251
|
+
if (!source || !process)
|
|
171
252
|
return { text: "", aliases: {} };
|
|
172
253
|
// What the format can write: flow nodes with a kind word, outside any event sub-process.
|
|
173
254
|
const elements = process.elements.filter((el) => KIND_WORDS.has(el.type));
|
|
@@ -191,12 +272,13 @@ export function writeProcessText(definitions, options = {}) {
|
|
|
191
272
|
const alias = new Map();
|
|
192
273
|
// Readable ids first, so a name-derived alias never takes one of them.
|
|
193
274
|
const named = [...elements, ...[...inner.values()].map((child) => child.element)];
|
|
275
|
+
const nodeAlias = (el) => aliasFor(el.id, el.name, KIND_WORDS.get(el.type) ?? "node", taken);
|
|
194
276
|
for (const el of named)
|
|
195
277
|
if (READABLE_ID.test(el.id))
|
|
196
|
-
alias.set(el.id,
|
|
278
|
+
alias.set(el.id, nodeAlias(el));
|
|
197
279
|
for (const el of named)
|
|
198
280
|
if (!alias.has(el.id))
|
|
199
|
-
alias.set(el.id,
|
|
281
|
+
alias.set(el.id, nodeAlias(el));
|
|
200
282
|
const declared = new Set();
|
|
201
283
|
const ref = (id) => {
|
|
202
284
|
const el = byId.get(id);
|
|
@@ -272,6 +354,7 @@ export function writeProcessText(definitions, options = {}) {
|
|
|
272
354
|
}
|
|
273
355
|
for (const id of inner.keys())
|
|
274
356
|
lines.push(inside(id));
|
|
357
|
+
lines.push(...swimlaneLines(definitions, source, byId, alias, taken));
|
|
275
358
|
// Documentation, on one line like a note: it is the tool description of an agent's tool
|
|
276
359
|
for (const el of named) {
|
|
277
360
|
const text = el.documentation?.replace(/\s+/g, " ").trim();
|
|
@@ -279,20 +362,20 @@ export function writeProcessText(definitions, options = {}) {
|
|
|
279
362
|
lines.push(`doc ${alias.get(el.id)}: ${text}`);
|
|
280
363
|
}
|
|
281
364
|
// A note names an element it is associated with; one tied to nothing the format writes has no line.
|
|
282
|
-
const
|
|
283
|
-
const
|
|
284
|
-
for (const assoc of source?.associations ?? []) {
|
|
365
|
+
const annotations = new Map((source.textAnnotations ?? []).map((a) => [a.id, a.text ?? ""]));
|
|
366
|
+
for (const assoc of source.associations ?? []) {
|
|
285
367
|
const [annotation, target] = annotations.has(assoc.targetRef)
|
|
286
368
|
? [assoc.targetRef, assoc.sourceRef]
|
|
287
369
|
: [assoc.sourceRef, assoc.targetRef];
|
|
288
370
|
const text = (annotations.get(annotation) ?? "").replace(/\s+/g, " ").trim();
|
|
289
|
-
|
|
371
|
+
// Nodes only: the alias map also holds lanes and pools, which have no note line.
|
|
372
|
+
const written = byId.has(target) || inner.has(target) ? alias.get(target) : undefined;
|
|
290
373
|
if (annotations.has(annotation) && written !== undefined && text !== "") {
|
|
291
374
|
lines.push(`note ${written}: ${text}`);
|
|
292
375
|
}
|
|
293
376
|
}
|
|
294
377
|
if (options.connectorLine) {
|
|
295
|
-
const real = new Map(
|
|
378
|
+
const real = new Map(source.flowElements.map((el) => [el.id, el]));
|
|
296
379
|
for (const el of elements) {
|
|
297
380
|
const element = real.get(el.id);
|
|
298
381
|
const line = element && options.connectorLine(element, definitions);
|
|
@@ -29,7 +29,7 @@ import { type ConnectorLine } from "./connector-line.js";
|
|
|
29
29
|
* It lives beside the parser so the two cannot drift: a test parses its example
|
|
30
30
|
* and expects no problems.
|
|
31
31
|
*/
|
|
32
|
-
export declare const PROCESS_TEXT_GUIDE = "Format \u2014 one path per line, nothing else:\n# Process name (first line; add \" | camunda=8.10\" to target a Camunda version)\na > b > c sequence flow\nid[kind Name] declare a node the first time it appears; afterwards write only id\ngw >(Label: condition) x conditional branch, condition in FEEL (amount > 1000, status = \"ok\")\ngw >(Label: default) y branch taken when no condition holds\nKinds: start end task user service rule (DMN decision) send receive script manual call xor and or eventgw catch (wait for message or timer) throw boundary adhoc (an AI agent that chooses among tools)\nEvents take a trigger: start:message end:error catch:timer boundary:error (timer message signal error escalation terminate conditional compensate cancel)\nAttributes after |: on=<task id> (required on boundary), nonint (non-interrupting), job=<job type>, each=<list variable> (once per item), after=<ISO duration> (timer), result=<variable>, feel=<FEEL expression> (last)\nNames after |: msg=<message name> key=<FEEL> (key required where a message is waited for: catch, boundary, receive), signal=<name>, error=<code>, escalation=<code>, at=<ISO date-time> and every=<R/PT1H> (timers), called=<process id> (call)\nAlso after |: form=<form id> (start, user), in.<name>=<FEEL> and out.<name>=<FEEL> map variables in and out of a step (value runs to the next word=; write comparisons with spaces: a = 1)\nAd-hoc: agent[adhoc Name] is a container with flows like any node; tool[service Name | inside=agent] has no flows of its own; note <id>: text annotates a node\ndoc <id>: text the element's documentation; for a tool inside an ad-hoc agent it is the description the agent chooses the tool by\nAd-hoc example:\nask[start Question asked] > agent[adhoc Answer with tools] > review[user Review answer] > done[end Answered]\nusers[service Look up users | inside=agent]\ndoc users: Returns the list of sample users\nnote agent: Picks a tool by its description\nRules:\n- One start event. Every node is on a path from it to an end event: never a node nothing leads to.\n- An xor has two or more branches: exactly one is (Label: default), each other has a FEEL condition.\n- A boundary starts its own line, on a task you declared, and leads to a task that handles it; never draw an arrow into a boundary.\n- A boundary leads only to the handling. What happens next when nothing fails follows the task itself (read > count), never the boundary.\n- A step that only works on process data (count, sum, filter, compare, pick, format a message) is a script task, never a service or plain task: its FEEL reads the variables earlier steps set with result=. read[service Read issues | result=issues] > count[script Count open issues | result=openCount feel=count(issues[state = \"open\"])]\n- Branches that meet again are joined automatically; join parallel branches with an and node.\n- Steps done at the same time start from an and node and meet at another. A deadline is a boundary:timer with after= on the task that may run late. A step done for every item of a list takes each=<list>; use it only when the description says every or each.\n\nExample:\n# Expense approval\nstart[start Expense submitted] > check[xor Amount over 1000?]\ncheck >(Yes: amount > 1000) review[user Review expense] > pay[service Pay expense] > done[end Expense paid]\ncheck >(No: default) auto[service Approve automatically] > pay\nfailed[boundary:error Payment failed | on=pay] > notify[send Notify submitter] > notice[end Payment failed]";
|
|
32
|
+
export declare const PROCESS_TEXT_GUIDE = "Format \u2014 one path per line, nothing else:\n# Process name (first line; add \" | camunda=8.10\" to target a Camunda version)\na > b > c sequence flow\nid[kind Name] declare a node the first time it appears; afterwards write only id\ngw >(Label: condition) x conditional branch, condition in FEEL (amount > 1000, status = \"ok\")\ngw >(Label: default) y branch taken when no condition holds\nKinds: start end task user service rule (DMN decision) send receive script manual call xor and or eventgw catch (wait for message or timer) throw boundary adhoc (an AI agent that chooses among tools)\nEvents take a trigger: start:message end:error catch:timer boundary:error (timer message signal error escalation terminate conditional compensate cancel)\nAttributes after |: on=<task id> (required on boundary), nonint (non-interrupting), job=<job type>, each=<list variable> (once per item), after=<ISO duration> (timer), result=<variable>, feel=<FEEL expression> (last)\nNames after |: msg=<message name> key=<FEEL> (key required where a message is waited for: catch, boundary, receive), signal=<name>, error=<code>, escalation=<code>, at=<ISO date-time> and every=<R/PT1H> (timers), called=<process id> (call)\nAlso after |: form=<form id> (start, user), in.<name>=<FEEL> and out.<name>=<FEEL> map variables in and out of a step (value runs to the next word=; write comparisons with spaces: a = 1)\nAd-hoc: agent[adhoc Name] is a container with flows like any node; tool[service Name | inside=agent] has no flows of its own; note <id>: text annotates a node\ndoc <id>: text the element's documentation; for a tool inside an ad-hoc agent it is the description the agent chooses the tool by\nlane sales[Sales team]: a, b a and b are done by the Sales team: one line per role, after the paths\npool bank[Bank] another party; msg pay >(Payment) bank is a message to it, msg bank > paid one from it\nAd-hoc example:\nask[start Question asked] > agent[adhoc Answer with tools] > review[user Review answer] > done[end Answered]\nusers[service Look up users | inside=agent]\ndoc users: Returns the list of sample users\nnote agent: Picks a tool by its description\nRules:\n- One start event. Every node is on a path from it to an end event: never a node nothing leads to.\n- An xor has two or more branches: exactly one is (Label: default), each other has a FEEL condition.\n- A boundary starts its own line, on a task you declared, and leads to a task that handles it; never draw an arrow into a boundary.\n- A boundary leads only to the handling. What happens next when nothing fails follows the task itself (read > count), never the boundary.\n- A step that only works on process data (count, sum, filter, compare, pick, format a message) is a script task, never a service or plain task: its FEEL reads the variables earlier steps set with result=. read[service Read issues | result=issues] > count[script Count open issues | result=openCount feel=count(issues[state = \"open\"])]\n- Branches that meet again are joined automatically; join parallel branches with an and node.\n- Lanes and pools only when the description names roles or other parties; then every node is in one lane.\n- Steps done at the same time start from an and node and meet at another. A deadline is a boundary:timer with after= on the task that may run late. A step done for every item of a list takes each=<list>; use it only when the description says every or each.\n\nExample:\n# Expense approval\nstart[start Expense submitted] > check[xor Amount over 1000?]\ncheck >(Yes: amount > 1000) review[user Review expense] > pay[service Pay expense] > done[end Expense paid]\ncheck >(No: default) auto[service Approve automatically] > pay\nfailed[boundary:error Payment failed | on=pay] > notify[send Notify submitter] > notice[end Payment failed]";
|
|
33
33
|
/** A line, or part of one, that {@link parseProcessText} could not use. */
|
|
34
34
|
export interface ProcessTextProblem {
|
|
35
35
|
/** 1-based line number in the text. */
|
|
@@ -87,6 +87,27 @@ export declare const EVENTS: Set<BpmnElementType>;
|
|
|
87
87
|
export declare const NOTE_LINE: RegExp;
|
|
88
88
|
/** `doc <id>: text`, the element's documentation; free text like a note. */
|
|
89
89
|
export declare const DOC_LINE: RegExp;
|
|
90
|
+
/**
|
|
91
|
+
* `lane <id>[Name]: a, b`, the swimlane a role works in. Whitespace after the
|
|
92
|
+
* keyword is required, so `lane_check[user …] > x` is still a path. The keywords
|
|
93
|
+
* of this and the next two lines are lowercase only, as the guides teach them:
|
|
94
|
+
* prose such as "Lane changes: move review into sales" starts with a capital.
|
|
95
|
+
* Without a bracket the lane is named after its id, as a node is; `[]` leaves
|
|
96
|
+
* it unnamed.
|
|
97
|
+
*/
|
|
98
|
+
export declare const LANE_LINE: RegExp;
|
|
99
|
+
/**
|
|
100
|
+
* `pool <id>[Name]`, another party drawn as an empty pool; `[]` leaves it
|
|
101
|
+
* unnamed. The bracket is required: without it, two words of prose such as
|
|
102
|
+
* "pool party" would declare a pool.
|
|
103
|
+
*/
|
|
104
|
+
export declare const POOL_LINE: RegExp;
|
|
105
|
+
/**
|
|
106
|
+
* `msg a >(Label) b`, a message between a node and a pool. Its own keyword, so a
|
|
107
|
+
* path can never mix sequence and message flows; the label is kept as written,
|
|
108
|
+
* colons included, because a message has no condition.
|
|
109
|
+
*/
|
|
110
|
+
export declare const MESSAGE_LINE: RegExp;
|
|
90
111
|
/**
|
|
91
112
|
* Splits `feel=` off a declaration's attributes. A FEEL expression has spaces and
|
|
92
113
|
* commas, so it takes the rest of them: `| result=open feel=count(issues[state = "open"])`.
|
|
@@ -119,6 +140,11 @@ export declare function splitMappings(attrs: string): {
|
|
|
119
140
|
* would find `Object.prototype`'s member and make a node whose type is a function.
|
|
120
141
|
*/
|
|
121
142
|
export declare function kindOf(word: string): BpmnElementType | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* `send_email` / `sendEmail` → "Send email": a readable name for a node, lane
|
|
145
|
+
* or pool the model never named.
|
|
146
|
+
*/
|
|
147
|
+
export declare function nameFromId(id: string): string;
|
|
122
148
|
/** A path line split into its parts. */
|
|
123
149
|
export interface PathTokens {
|
|
124
150
|
/** The nodes in the order written, each with the bracket text it was declared with, if any. */
|