@bpmnkit/core 1.15.0 → 1.16.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.
@@ -1,6 +1,7 @@
1
1
  import { assertBpmnDefinitions, assertCompactDiagram } from "./argument-guards.js";
2
- import { buildFlowElement, compactify, defaultFlows, makeEventDef, } from "./compact.js";
2
+ import { buildFlowElement, compactify, compactifyLanes, compactifyMessageFlow, compactifyParticipant, defaultFlows, executability, expandCollaborations, fillLanes, isPooled, makeEventDef, withLanes, } from "./compact.js";
3
3
  import { assignEventDefinitionIds } from "./stable-ids.js";
4
+ import { allLanes, collaborationProblems, documentIdList, poolLanedProcesses, pruneLaneRefs, } from "./swimlanes.js";
4
5
  import { assertZeebePlacement, bpmnElementName, ensureZeebeExtension, isZeebePlacementAllowed, zeebeExtensionsToXmlElements, } from "./zeebe-extensions.js";
5
6
  /** Thrown by {@link applyBpmnOperations} in strict mode. */
6
7
  export class OperationError extends Error {
@@ -617,16 +618,23 @@ export function applyBpmnOperations(definitions, operations, options = {}) {
617
618
  const draft = structuredClone(definitions);
618
619
  const problems = [];
619
620
  let applied = 0;
621
+ const inserted = [];
620
622
  operations.forEach((operation, index) => {
621
623
  const reason = applyOne(draft, operation);
622
- if (reason === undefined)
623
- applied++;
624
- else
624
+ if (reason !== undefined)
625
625
  problems.push({ index, operation, reason });
626
+ else {
627
+ applied++;
628
+ if (operation.op === "insert")
629
+ inserted.push(operation.element.id);
630
+ }
626
631
  });
627
632
  if ((options.strict ?? true) && problems.length > 0) {
628
633
  throw new OperationError(problems);
629
634
  }
635
+ // After every operation rather than at the insert, so the flows a batch adds
636
+ // next to a new node decide its lane.
637
+ draft.processes = draft.processes.map((process) => fillLanes(process, inserted));
630
638
  return { definitions: draft, applied, problems };
631
639
  }
632
640
  function applyOne(definitions, operation) {
@@ -652,6 +660,11 @@ function applyOne(definitions, operation) {
652
660
  // A flow to or from a removed element would dangle.
653
661
  found.container.sequenceFlows = found.container.sequenceFlows.filter((flow) => flow.sourceRef !== operation.id && flow.targetRef !== operation.id);
654
662
  recomputeRefs(found.container);
663
+ // A lane ref or a message flow naming the removed node would dangle too.
664
+ definitions.processes = definitions.processes.map((process) => process === found.container ? pruneLaneRefs(process) : process);
665
+ for (const collaboration of definitions.collaborations) {
666
+ collaboration.messageFlows = collaboration.messageFlows.filter((flow) => flow.sourceRef !== operation.id && flow.targetRef !== operation.id);
667
+ }
655
668
  return undefined;
656
669
  }
657
670
  case "insert": {
@@ -762,20 +775,44 @@ function recomputeRefs(container) {
762
775
  * a multi-process document means "this is how that process should look", not
763
776
  * "delete the others".
764
777
  *
778
+ * Lanes, pools and executability follow the same rule: a key the compact leaves
779
+ * out leaves that part of the model alone. A process's `lanes` rebuilds its
780
+ * membership (an empty list removes the lane set), keeping the attributes and
781
+ * extensions of every lane whose id survives; members that are not top-level
782
+ * flow nodes are dropped and unlisted nodes are placed as {@link expand} places
783
+ * them. `participants` and `messageFlows` replace those of the first
784
+ * collaboration, keeping what the compact form does not carry (`messageRef`,
785
+ * extensions, foreign attributes) on every id that survives. A lane, pool or
786
+ * message flow listed without a `name` has none, as {@link compactify} writes
787
+ * it, so a compact edit can remove a name. A laned process
788
+ * without a pool then gets one. A process the compact adds gets the
789
+ * `isExecutable` {@link expand} would give it, so a keyless partner pool is
790
+ * not executable. Without the keys, a deleted node still leaves
791
+ * its lanes and message flows, and an inserted one joins its predecessor's lane.
792
+ *
765
793
  * @param definitions - The model to update. Never mutated.
766
794
  * @param compact - The intended topology.
767
795
  * @param options - `strict` (default `true`) throws instead of returning problems.
768
796
  * @returns The updated model, plus what applied and what did not.
797
+ * @throws Error, in either mode, when the result would carry an id used twice
798
+ * or a collaboration problem (a dangling message end or process reference, a
799
+ * message inside one pool) that `definitions` did not already have: the
800
+ * input is invalid, as {@link expand} would find it.
769
801
  */
770
802
  export function reconcileCompact(definitions, compact, options = {}) {
771
803
  assertBpmnDefinitions(definitions, "reconcileCompact");
772
804
  assertCompactDiagram(compact, "reconcileCompact");
773
805
  const draft = structuredClone(definitions);
774
- for (const compactProcess of compact.processes) {
806
+ // A new process gets the executability expand would give it: Flowable deploys
807
+ // a process with no isExecutable, so a keyless partner pool must say false.
808
+ // poolLanedProcesses cannot, as it only marks the pools it creates itself.
809
+ const executable = executability(compact, isPooled(compact));
810
+ compact.processes.forEach((compactProcess, index) => {
775
811
  if (!draft.processes.some((process) => process.id === compactProcess.id)) {
776
812
  draft.processes.push({
777
813
  id: compactProcess.id,
778
814
  name: compactProcess.name,
815
+ ...(executable[index] === false ? { isExecutable: false } : {}),
779
816
  extensionElements: [],
780
817
  flowElements: [],
781
818
  sequenceFlows: [],
@@ -785,10 +822,157 @@ export function reconcileCompact(definitions, compact, options = {}) {
785
822
  unknownAttributes: {},
786
823
  });
787
824
  }
788
- }
825
+ });
789
826
  const result = applyBpmnOperations(draft, operationsForCompact(draft, compact), options);
790
827
  reconcileDefaultFlows(result.definitions, compact);
791
- return result;
828
+ const reconciled = reconcilePools(result.definitions, compact);
829
+ const broken = newStructureProblems(definitions, reconciled);
830
+ if (broken.length > 0) {
831
+ throw new Error(`reconcileCompact: invalid CompactDiagram — ${broken.join("; ")}`);
832
+ }
833
+ return { ...result, definitions: reconciled };
834
+ }
835
+ /**
836
+ * What `after` gets wrong that `before` did not: {@link collaborationProblems}
837
+ * and ids used twice across the document. The pool and lane keys are merged in
838
+ * after the operations, so nothing else checks that their ids and references
839
+ * hold. A problem the input already had is the caller's document, not this edit.
840
+ */
841
+ function newStructureProblems(before, after) {
842
+ const had = new Set(collaborationProblems(before));
843
+ const found = collaborationProblems(after).filter((problem) => !had.has(problem));
844
+ // Counted rather than compared as messages, so a new clash on an id the
845
+ // input already used twice is still caught.
846
+ const wasUsed = idCounts(before);
847
+ for (const [id, count] of idCounts(after)) {
848
+ if (count > 1 && count > (wasUsed.get(id) ?? 0))
849
+ found.push(`Duplicate element ID "${id}"`);
850
+ }
851
+ return [...new Set(found)];
852
+ }
853
+ /** How many times each id is used in the document ({@link documentIdList}). */
854
+ function idCounts(definitions) {
855
+ const counts = new Map();
856
+ for (const id of documentIdList(definitions))
857
+ counts.set(id, (counts.get(id) ?? 0) + 1);
858
+ return counts;
859
+ }
860
+ /**
861
+ * Applies the `executable`, `lanes`, `participants` and `messageFlows` keys
862
+ * `compact` carries. A key that says what the model already says changes
863
+ * nothing, so reconciling `compactify(defs)` onto `defs` stays a no-op.
864
+ */
865
+ function reconcilePools(definitions, compact) {
866
+ const wanted = new Map(compact.processes.map((process) => [process.id, process]));
867
+ let changed = false;
868
+ const processes = definitions.processes.map((process) => {
869
+ const compactProcess = wanted.get(process.id);
870
+ let next = process;
871
+ const executable = compactProcess?.executable;
872
+ // An absent attribute already means executable (Flowable), so `true` leaves it absent.
873
+ if (executable !== undefined && executable !== (next.isExecutable !== false)) {
874
+ next = { ...next, isExecutable: executable };
875
+ }
876
+ const lanes = compactProcess?.lanes;
877
+ if (lanes !== undefined && !sameJson(compactifyLanes(next), lanes)) {
878
+ next = relane(next, lanes);
879
+ changed = true;
880
+ }
881
+ return next;
882
+ });
883
+ const first = definitions.collaborations[0];
884
+ const poolsChanged = (compact.participants !== undefined &&
885
+ !sameJson(first?.participants.map(compactifyParticipant) ?? [], compact.participants)) ||
886
+ (compact.messageFlows !== undefined &&
887
+ !sameJson(first?.messageFlows.map(compactifyMessageFlow) ?? [], compact.messageFlows));
888
+ if (!changed && !poolsChanged)
889
+ return { ...definitions, processes };
890
+ return poolLanedProcesses({
891
+ ...definitions,
892
+ processes,
893
+ collaborations: poolsChanged
894
+ ? reconcileCollaborations({ ...definitions, processes }, compact)
895
+ : definitions.collaborations,
896
+ });
897
+ }
898
+ /** Equal as JSON: key order counts, so a reordered but equal input reads as a change, which is safe. */
899
+ function sameJson(a, b) {
900
+ return JSON.stringify(a) === JSON.stringify(b);
901
+ }
902
+ /** `process` with the membership `lanes` describes, keeping what each surviving lane carries. */
903
+ function relane(process, lanes) {
904
+ const { laneSet: previous, ...bare } = process;
905
+ if (lanes.length === 0)
906
+ return bare;
907
+ const rebuilt = pruneLaneRefs(withLanes(bare, lanes)).laneSet;
908
+ if (rebuilt === undefined)
909
+ return bare;
910
+ const before = new Map(allLanes(previous).map((lane) => [lane.id, lane]));
911
+ // `rebuilt` comes from buildLaneSet, which refuses a looping tree, so this terminates.
912
+ const mergeSet = (built, old) => ({
913
+ ...built,
914
+ ...old,
915
+ lanes: built.lanes.map(mergeLane),
916
+ });
917
+ const mergeLane = (built) => {
918
+ const old = before.get(built.id);
919
+ // The compact lane states its name the way compactify writes it: none when it has none.
920
+ const { childLaneSet: _oldChildren, name: _oldName, ...kept } = old ?? { unknownAttributes: {} };
921
+ const lane = { ...kept, id: built.id, flowNodeRefs: built.flowNodeRefs };
922
+ if (built.name)
923
+ lane.name = built.name;
924
+ if (built.childLaneSet !== undefined) {
925
+ lane.childLaneSet = mergeSet(built.childLaneSet, old?.childLaneSet);
926
+ }
927
+ return lane;
928
+ };
929
+ return { ...bare, laneSet: mergeSet(rebuilt, previous) };
930
+ }
931
+ /** The collaborations once the compact's `participants` and `messageFlows` keys are applied. */
932
+ function reconcileCollaborations(definitions, compact) {
933
+ if (compact.participants === undefined && compact.messageFlows === undefined) {
934
+ return definitions.collaborations;
935
+ }
936
+ const [first, ...rest] = definitions.collaborations;
937
+ if (first === undefined)
938
+ return expandCollaborations(compact, documentIds(definitions, compact));
939
+ return [
940
+ {
941
+ ...first,
942
+ participants: compact.participants?.map((participant) => mergeParticipant(first.participants.find((p) => p.id === participant.id), participant)) ?? first.participants,
943
+ messageFlows: compact.messageFlows?.map((flow) => mergeMessageFlow(first.messageFlows.find((f) => f.id === flow.id), flow)) ?? first.messageFlows,
944
+ },
945
+ ...rest,
946
+ ];
947
+ }
948
+ function mergeParticipant(old, wanted) {
949
+ const { processRef: _oldRef, name: _oldName, ...kept } = old ?? { unknownAttributes: {} };
950
+ const participant = { ...kept, id: wanted.id };
951
+ if (wanted.name)
952
+ participant.name = wanted.name;
953
+ if (wanted.processId !== undefined)
954
+ participant.processRef = wanted.processId;
955
+ return participant;
956
+ }
957
+ function mergeMessageFlow(old, wanted) {
958
+ const { name: _oldName, ...kept } = old ?? { unknownAttributes: {} };
959
+ const flow = {
960
+ ...kept,
961
+ id: wanted.id,
962
+ sourceRef: wanted.source,
963
+ targetRef: wanted.target,
964
+ };
965
+ if (wanted.name)
966
+ flow.name = wanted.name;
967
+ return flow;
968
+ }
969
+ /** Ids a new collaboration must not take: every process, element, flow and lane, and the compact's pool ids. */
970
+ function documentIds(definitions, compact) {
971
+ const ids = new Set(documentIdList(definitions));
972
+ for (const item of [...(compact.participants ?? []), ...(compact.messageFlows ?? [])]) {
973
+ ids.add(item.id);
974
+ }
975
+ return ids;
792
976
  }
793
977
  /**
794
978
  * Brings each gateway's `bpmn:default` in line with the flow the compact input
@@ -16,7 +16,7 @@
16
16
  * a file written by another tool comes back reshuffled even when nothing
17
17
  * changed. Keeping the original order is therefore worth more than keeping the
18
18
  * indentation. The same goes for an attribute set to its schema default:
19
- * `isExecutable="false"` disappears from a file that said it out loud.
19
+ * `isSequential="false"` disappears from a file that said it out loud.
20
20
  *
21
21
  * Neither is safe to assume in general, so neither is assumed. Each strategy is
22
22
  * tried, the result is **parsed back and compared against a plain write**, and
@@ -16,7 +16,7 @@
16
16
  * a file written by another tool comes back reshuffled even when nothing
17
17
  * changed. Keeping the original order is therefore worth more than keeping the
18
18
  * indentation. The same goes for an attribute set to its schema default:
19
- * `isExecutable="false"` disappears from a file that said it out loud.
19
+ * `isSequential="false"` disappears from a file that said it out loud.
20
20
  *
21
21
  * Neither is safe to assume in general, so neither is assumed. Each strategy is
22
22
  * tried, the result is **parsed back and compared against a plain write**, and
@@ -29,7 +29,7 @@ export declare const FIXED_KINDS: Readonly<Record<string, BpmnElementType>>;
29
29
  * after {@link PROCESS_TEXT_GUIDE}. A test parses its example and expects no
30
30
  * problems.
31
31
  */
32
- export declare const PROCESS_DELTA_GUIDE = "Change script \u2014 write only what changes, one line each:\na > new[kind Name] > b add nodes and flows; an existing node is written by its id only\na >(Label: condition) b add a flow; restating an existing flow with a new label changes it\nx[kind Name] an existing id declared again changes its kind or name\nx[user Name | form=f in.a=b] form and in./out. mappings (FEEL; write a = 1 with spaces) go after the bar\n- a > b remove the flow from a to b\n- x remove node x and its flows\n@2 x y feedback item 2 is answered by the changes to x and y\nRules:\n- Use the ids of the diagram you were given. Never repeat a line that changes nothing.\n- A new node written between two connected nodes (a > new > b) replaces the flow a > b.\n- Removing a node with one way in and one way out joins the two.\n- End with one @ line for each feedback item you answered.\n\nExample:\ncheck > second[user Second approval] > pay\nreview[user Review application]\n- notify\n@1 second\n@2 review";
32
+ export declare const PROCESS_DELTA_GUIDE = "Change script \u2014 write only what changes, one line each:\na > new[kind Name] > b add nodes and flows; an existing node is written by its id only\na >(Label: condition) b add a flow; restating an existing flow with a new label changes it\nx[kind Name] an existing id declared again changes its kind or name\nx[user Name | form=f in.a=b] form and in./out. mappings (FEEL; write a = 1 with spaces) go after the bar\n- a > b remove the flow from a to b\n- x remove node x and its flows\nlane sales: a, b move a and b into lane sales; lane ops[Operations]: c adds or renames a lane\npool bank[Bank] add or rename a partner pool; msg pay >(Payment) bank sends it a message\n- msg pay > bank remove that message\n@2 x y feedback item 2 is answered by the changes to x and y\nRules:\n- Use the ids of the diagram you were given. Never repeat a line that changes nothing.\n- A new node written between two connected nodes (a > new > b) replaces the flow a > b.\n- Removing a node with one way in and one way out joins the two.\n- End with one @ line for each feedback item you answered.\n\nExample:\ncheck > second[user Second approval] > pay\nreview[user Review application]\n- notify\n@1 second\n@2 review";
33
33
  /** A node the script declares: a new one, or a change to an existing one. */
34
34
  export interface DeltaNode {
35
35
  /** The id as written. */
@@ -119,6 +119,37 @@ export interface ProcessDelta {
119
119
  text: string;
120
120
  line: number;
121
121
  }[];
122
+ /**
123
+ * `lane` lines, in the order written; a lane written twice appears twice. An
124
+ * absent `name` keeps an existing lane's name, and a new lane is named from its
125
+ * id. `nodes` move into the lane and may be empty: the line then only renames
126
+ * or adds the lane.
127
+ */
128
+ lanes: {
129
+ id: string;
130
+ name?: string;
131
+ nodes: string[];
132
+ line: number;
133
+ }[];
134
+ /** `pool` lines: a partner pool added, or an existing one renamed. */
135
+ pools: {
136
+ id: string;
137
+ name?: string;
138
+ line: number;
139
+ }[];
140
+ /** `msg` lines: message flows between a node and a pool, label as written. */
141
+ messageFlows: {
142
+ from: string;
143
+ to: string;
144
+ name?: string;
145
+ line: number;
146
+ }[];
147
+ /** `- msg a > b` lines. */
148
+ removedMessageFlows: {
149
+ from: string;
150
+ to: string;
151
+ line: number;
152
+ }[];
122
153
  /** Lines, or parts of lines, that were left out. */
123
154
  problems: ProcessTextProblem[];
124
155
  }
@@ -16,7 +16,7 @@
16
16
  * @packageDocumentation
17
17
  */
18
18
  import { CONNECTOR_LINE, parseConnectorLine } from "./connector-line.js";
19
- import { DOC_LINE, NOTE_LINE, TRIGGERS, cycle, duration, edgeLabel, kindOf, splitFeel, splitMappings, tokenizePath, } from "./process-text.js";
19
+ import { DOC_LINE, LANE_LINE, MESSAGE_LINE, NOTE_LINE, POOL_LINE, TRIGGERS, cycle, duration, edgeLabel, kindOf, splitFeel, splitMappings, tokenizePath, } from "./process-text.js";
20
20
  /**
21
21
  * Kind words the writer uses for element types the line format cannot create.
22
22
  * A script may restate them on an existing node; it cannot declare a new one.
@@ -38,6 +38,9 @@ x[kind Name] an existing id declared again changes its kind or name
38
38
  x[user Name | form=f in.a=b] form and in./out. mappings (FEEL; write a = 1 with spaces) go after the bar
39
39
  - a > b remove the flow from a to b
40
40
  - x remove node x and its flows
41
+ lane sales: a, b move a and b into lane sales; lane ops[Operations]: c adds or renames a lane
42
+ pool bank[Bank] add or rename a partner pool; msg pay >(Payment) bank sends it a message
43
+ - msg pay > bank remove that message
41
44
  @2 x y feedback item 2 is answered by the changes to x and y
42
45
  Rules:
43
46
  - Use the ids of the diagram you were given. Never repeat a line that changes nothing.
@@ -58,6 +61,46 @@ review[user Review application]
58
61
  const ID_LIST = /^[A-Za-z_][\w.-]*(\s*,\s*[A-Za-z_][\w.-]*)*$/;
59
62
  /** A line that ends in an arrow: the path goes on below, as in the line format. */
60
63
  const DANGLING = /\s*-{0,2}>\s*(\([^()]*\))?\s*$/;
64
+ const ID = /^[A-Za-z_][\w.-]*$/;
65
+ /**
66
+ * Reads a `lane`, `pool` or `msg` line into `delta`. Returns whether the line was
67
+ * one, so the caller does not read it as a path.
68
+ */
69
+ function readSwimlaneLine(line, n, delta) {
70
+ const lane = LANE_LINE.exec(line);
71
+ if (lane) {
72
+ const id = lane[1];
73
+ const name = lane[2]?.trim();
74
+ const nodes = [];
75
+ for (const word of (lane[3] ?? "").split(/[\s,]+/).filter(Boolean)) {
76
+ if (ID.test(word))
77
+ nodes.push(word);
78
+ else
79
+ delta.problems.push({ line: n, message: `lane ${id}: "${word}" is not an id; left out` });
80
+ }
81
+ // A bare, empty lane line changes nothing; it is more likely prose than a lane.
82
+ if (!name && nodes.length === 0) {
83
+ delta.problems.push({ line: n, message: `lane ${id}: names nothing to change; ignored` });
84
+ }
85
+ else
86
+ delta.lanes.push({ id, ...(name ? { name } : {}), nodes, line: n });
87
+ return true;
88
+ }
89
+ const pool = POOL_LINE.exec(line);
90
+ if (pool) {
91
+ const name = pool[2]?.trim();
92
+ delta.pools.push({ id: pool[1], ...(name ? { name } : {}), line: n });
93
+ return true;
94
+ }
95
+ const message = MESSAGE_LINE.exec(line);
96
+ if (message) {
97
+ const name = message[2]?.trim();
98
+ const flow = { from: message[1], to: message[3] };
99
+ delta.messageFlows.push({ ...flow, ...(name ? { name } : {}), line: n });
100
+ return true;
101
+ }
102
+ return false;
103
+ }
61
104
  /** Reads one declaration's bracket text. */
62
105
  function readSpec(id, spec, line, problems) {
63
106
  const node = { id, line };
@@ -152,6 +195,10 @@ export function parseProcessDelta(text) {
152
195
  connectors: [],
153
196
  notes: [],
154
197
  docs: [],
198
+ lanes: [],
199
+ pools: [],
200
+ messageFlows: [],
201
+ removedMessageFlows: [],
155
202
  problems: [],
156
203
  };
157
204
  const declared = new Map();
@@ -215,6 +262,18 @@ export function parseProcessDelta(text) {
215
262
  });
216
263
  };
217
264
  const removal = (rest, n) => {
265
+ const message = MESSAGE_LINE.exec(rest);
266
+ if (message) {
267
+ delta.removedMessageFlows.push({
268
+ from: message[1],
269
+ to: message[3],
270
+ line: n,
271
+ });
272
+ if (message[2] !== undefined) {
273
+ delta.problems.push({ line: n, message: "a removal names ids only; ignored the label" });
274
+ }
275
+ return;
276
+ }
218
277
  if (ID_LIST.test(rest) && !rest.includes(">")) {
219
278
  for (const id of rest.split(/[\s,]+/).filter(Boolean)) {
220
279
  delta.removedNodes.push({ id, line: n });
@@ -291,6 +350,8 @@ export function parseProcessDelta(text) {
291
350
  delta.docs.push({ id: doc[1], text, line: n });
292
351
  return;
293
352
  }
353
+ if (readSwimlaneLine(line, n, delta))
354
+ return;
294
355
  // `- x` removes; `-> x` is an arrow a model wrote at the start of a line.
295
356
  const removed = /^-(?![->])\s*(.*)$/.exec(line);
296
357
  if (removed) {
@@ -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 is written under a
8
- * name-derived alias (`review_application`) and the map back to the real id is
9
- * returned beside the text. An id that is already short and readable is kept.
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: the first process's flow nodes
12
- * and sequence flows. Lanes, data objects, annotations, event sub-processes and
13
- * the inside of a sub-process are left out. A script cannot name what it was
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
@@ -43,8 +50,12 @@ export declare function writableName(name: string): string;
43
50
  export declare function writableLabel(name: string): string;
44
51
  /** A FEEL condition without its leading `=`, on one line. */
45
52
  export declare function writableCondition(condition: string): string;
53
+ /** A message label as a `msg` line writes it: raw like a note, so colons stay, but a parenthesis would end it. */
54
+ export declare function writableMessageLabel(name: string): string;
46
55
  /**
47
- * Writes the first process of `definitions` in the line format.
56
+ * Writes the {@link primaryProcess} of `definitions` in the line format, with
57
+ * its leaf lanes, the other pools and their messages (see the module comment
58
+ * for what is left out).
48
59
  *
49
60
  * Paths start at the start events and follow the flows; each flow is written
50
61
  * once and each node is declared where it first appears. A boundary event