@formicoidea/labre-framework-bpmn 0.36.0 → 0.37.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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/reading.d.ts +16 -0
- package/dist/reading.js +102 -0
- package/dist/translations.js +7 -1
- package/dist/view.js +11 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export { BPMN_PROFILES } from './profiles.js';
|
|
|
12
12
|
export { BPMN_ROLE, BPMN_ROLE_OF_KIND, BPMN_ROLES, type BpmnRole, type BpmnRoleId, } from './roles.js';
|
|
13
13
|
export { BPMN_RULES, BPMN_SEQUENCE_MATRIX } from './rules.js';
|
|
14
14
|
export { bpmnTranslationEntries } from './translations.js';
|
|
15
|
+
export { BPMN_ANNOTATION_READING, BPMN_DATA_READING, BPMN_GROUP_READING, BPMN_READING, BPMN_READINGS, } from './reading.js';
|
package/dist/index.js
CHANGED
|
@@ -47,3 +47,4 @@ export { BPMN_PROFILES } from './profiles.js';
|
|
|
47
47
|
export { BPMN_ROLE, BPMN_ROLE_OF_KIND, BPMN_ROLES, } from './roles.js';
|
|
48
48
|
export { BPMN_RULES, BPMN_SEQUENCE_MATRIX } from './rules.js';
|
|
49
49
|
export { bpmnTranslationEntries } from './translations.js';
|
|
50
|
+
export { BPMN_ANNOTATION_READING, BPMN_DATA_READING, BPMN_GROUP_READING, BPMN_READING, BPMN_READINGS, } from './reading.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReadingProfile } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
/** Events, activities and gateways — the three families that ARE the process. */
|
|
3
|
+
export declare const BPMN_READING: ReadingProfile;
|
|
4
|
+
/**
|
|
5
|
+
* The paperwork: a data object and a data store.
|
|
6
|
+
*
|
|
7
|
+
* No relation — a data object is tied to the work by an ASSOCIATION, which
|
|
8
|
+
* declares no verb and no direction, so there is no sentence to read off it.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BPMN_DATA_READING: ReadingProfile;
|
|
11
|
+
/** A note on the picture. Readable, so a reader can link it to a record. */
|
|
12
|
+
export declare const BPMN_ANNOTATION_READING: ReadingProfile;
|
|
13
|
+
/** A lasso round part of the picture. Parent-less by spec, hence its own row. */
|
|
14
|
+
export declare const BPMN_GROUP_READING: ReadingProfile;
|
|
15
|
+
/** Every BPMN profile, in the order the view extension registers them. */
|
|
16
|
+
export declare const BPMN_READINGS: readonly ReadingProfile[];
|
package/dist/reading.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { BPMN_ROLE, BPMN_ROLES } from './roles.js';
|
|
2
|
+
/**
|
|
3
|
+
* What BPMN lets the tool read of an artefact (MF3, the reversed reading).
|
|
4
|
+
*
|
|
5
|
+
* DATA, like the rules and the profiles beside it: the engine
|
|
6
|
+
* (`@labre/affine-block-surface`) knows how to read a role and a typed edge — it
|
|
7
|
+
* knows nothing about BPMN. Everything below is already stated in `roles.ts` and
|
|
8
|
+
* is merely POINTED AT here.
|
|
9
|
+
*
|
|
10
|
+
* Registered from the FLAG-GATED view extension: reading a process is tooling,
|
|
11
|
+
* so a pool whose BPMN flag is off keeps every element it has and simply stops
|
|
12
|
+
* being read (ADR 0009).
|
|
13
|
+
*
|
|
14
|
+
* ## FOUR profiles, because BPMN has four parent-less node families
|
|
15
|
+
*
|
|
16
|
+
* The vocabulary is deliberately a forest and not a tree — `roles.ts` spells out
|
|
17
|
+
* why, family by family: the paperwork is not the work, commentary is never
|
|
18
|
+
* evidence, and BPMN 2.0.2 §10.4 exempts the group from every containment
|
|
19
|
+
* constraint there is. A single `appliesTo` would therefore have needed a
|
|
20
|
+
* `bpmn:artefact` root that the notation does not have, and inventing a role is
|
|
21
|
+
* the one thing ADR 0007 forbids: an id is forever, and a vocabulary is not a
|
|
22
|
+
* place to put a convenience.
|
|
23
|
+
*
|
|
24
|
+
* So each family declares its own profile, with an id of its own (the DI keys on
|
|
25
|
+
* it and throws on a duplicate). Only the pool is left out, and only because it
|
|
26
|
+
* is the FRAME: a reading is about an artefact, never about the lane it is drawn
|
|
27
|
+
* in.
|
|
28
|
+
*
|
|
29
|
+
* ## The sequence flow is the only relation read
|
|
30
|
+
*
|
|
31
|
+
* Of the three connecting objects, only `bpmn:sequence-flow` orders anything. A
|
|
32
|
+
* message flow says who told whom and a plain association says "this note is
|
|
33
|
+
* about that", both of which read identically from either end — and the
|
|
34
|
+
* association declares no `direction` for exactly that reason. Reading them
|
|
35
|
+
* under the sequence flow's two words would put a sentence in the panel that
|
|
36
|
+
* the notation never said.
|
|
37
|
+
*
|
|
38
|
+
* ## No nature, no phase
|
|
39
|
+
*
|
|
40
|
+
* BPMN ships no type-3 tag pack: its kinds ARE the roles, and the panel says
|
|
41
|
+
* them on the type line, chain included ("Message start event › Start event ›
|
|
42
|
+
* Event › Flow object"). And a pool's lanes are participants, not zones on a
|
|
43
|
+
* plotted axis, so there is nothing a position could be read against yet.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* The two words a sequence flow is read with, from the subject's end.
|
|
47
|
+
*
|
|
48
|
+
* ADR 0010 tier 2 on this role: the verb is "is followed by", so the SOURCE is
|
|
49
|
+
* what happens first. An edge leaving the subject therefore names what comes
|
|
50
|
+
* next, and one arriving names what came before.
|
|
51
|
+
*/
|
|
52
|
+
const SEQUENCE_SIDES = {
|
|
53
|
+
consumer: {
|
|
54
|
+
labelKey: 'com.labre.bpmn.reading.relations.consumer',
|
|
55
|
+
labelFallback: 'Preceded by',
|
|
56
|
+
},
|
|
57
|
+
supplier: {
|
|
58
|
+
labelKey: 'com.labre.bpmn.reading.relations.supplier',
|
|
59
|
+
labelFallback: 'Followed by',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
/** Events, activities and gateways — the three families that ARE the process. */
|
|
63
|
+
export const BPMN_READING = {
|
|
64
|
+
id: 'bpmn',
|
|
65
|
+
framework: 'bpmn',
|
|
66
|
+
roles: BPMN_ROLES,
|
|
67
|
+
appliesTo: BPMN_ROLE.flowObject,
|
|
68
|
+
relation: { edgeRole: BPMN_ROLE.sequenceFlow, sides: SEQUENCE_SIDES },
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The paperwork: a data object and a data store.
|
|
72
|
+
*
|
|
73
|
+
* No relation — a data object is tied to the work by an ASSOCIATION, which
|
|
74
|
+
* declares no verb and no direction, so there is no sentence to read off it.
|
|
75
|
+
*/
|
|
76
|
+
export const BPMN_DATA_READING = {
|
|
77
|
+
id: 'bpmn-data',
|
|
78
|
+
framework: 'bpmn',
|
|
79
|
+
roles: BPMN_ROLES,
|
|
80
|
+
appliesTo: BPMN_ROLE.data,
|
|
81
|
+
};
|
|
82
|
+
/** A note on the picture. Readable, so a reader can link it to a record. */
|
|
83
|
+
export const BPMN_ANNOTATION_READING = {
|
|
84
|
+
id: 'bpmn-annotation',
|
|
85
|
+
framework: 'bpmn',
|
|
86
|
+
roles: BPMN_ROLES,
|
|
87
|
+
appliesTo: BPMN_ROLE.textAnnotation,
|
|
88
|
+
};
|
|
89
|
+
/** A lasso round part of the picture. Parent-less by spec, hence its own row. */
|
|
90
|
+
export const BPMN_GROUP_READING = {
|
|
91
|
+
id: 'bpmn-group',
|
|
92
|
+
framework: 'bpmn',
|
|
93
|
+
roles: BPMN_ROLES,
|
|
94
|
+
appliesTo: BPMN_ROLE.group,
|
|
95
|
+
};
|
|
96
|
+
/** Every BPMN profile, in the order the view extension registers them. */
|
|
97
|
+
export const BPMN_READINGS = [
|
|
98
|
+
BPMN_READING,
|
|
99
|
+
BPMN_DATA_READING,
|
|
100
|
+
BPMN_ANNOTATION_READING,
|
|
101
|
+
BPMN_GROUP_READING,
|
|
102
|
+
];
|
package/dist/translations.js
CHANGED
|
@@ -3,6 +3,7 @@ import { bpmnCommands } from './commands.js';
|
|
|
3
3
|
import { NODE_LABEL, nodeLabelKey } from './consts.js';
|
|
4
4
|
import { BPMN_IMPORT_REMARKS } from './import.js';
|
|
5
5
|
import { BPMN_PROFILES } from './profiles.js';
|
|
6
|
+
import { BPMN_READINGS } from './reading.js';
|
|
6
7
|
import { BPMN_ROLES } from './roles.js';
|
|
7
8
|
import { BPMN_RULES } from './rules.js';
|
|
8
9
|
/**
|
|
@@ -47,4 +48,9 @@ export const bpmnTranslationEntries = mergeTranslationEntries(commandTranslation
|
|
|
47
48
|
// registry names no framework category in the bundled distribution, so a
|
|
48
49
|
// host that composed core's manifest alone drew translated entries under
|
|
49
50
|
// English headers (#183).
|
|
50
|
-
commandCategoryTranslationEntries(bpmnCommands), collectTranslationKeys('role', BPMN_ROLES), collectTranslationKeys('rule', BPMN_RULES), collectTranslationKeys('profile', BPMN_PROFILES), seedEntries(), importRemarkEntries()
|
|
51
|
+
commandCategoryTranslationEntries(bpmnCommands), collectTranslationKeys('role', BPMN_ROLES), collectTranslationKeys('rule', BPMN_RULES), collectTranslationKeys('profile', BPMN_PROFILES), seedEntries(), importRemarkEntries(),
|
|
52
|
+
// LAST, and the order is load-bearing: a reading profile carries the
|
|
53
|
+
// framework's own `roles`, so walking it reaches every role key the `role`
|
|
54
|
+
// line above already named. `mergeTranslationEntries` keeps the FIRST
|
|
55
|
+
// occurrence, which is what makes each key report the source it comes from.
|
|
56
|
+
collectTranslationKeys('reading', BPMN_READINGS));
|
package/dist/view.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FrameworkBackgroundInteractionExtension, InterchangeExtension, morphToolbarConfig, ValidationProfileExtension, ValidationRuleExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
|
|
1
|
+
import { FrameworkBackgroundInteractionExtension, InterchangeExtension, morphToolbarConfig, ReadingProfileExtension, ValidationProfileExtension, ValidationRuleExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
3
3
|
import { extendTemplateCategory } from '@formicoidea/labre-core/gfx/template';
|
|
4
4
|
import { ToolbarModuleExtension } from '@formicoidea/labre-core/shared/services';
|
|
@@ -10,6 +10,7 @@ import { effects } from './effects.js';
|
|
|
10
10
|
import { BPMN_INTERCHANGE } from './interchange.js';
|
|
11
11
|
import { BPMN_MORPH_SPEC } from './morph.js';
|
|
12
12
|
import { BPMN_PROFILES } from './profiles.js';
|
|
13
|
+
import { BPMN_READINGS } from './reading.js';
|
|
13
14
|
import { BPMN_ROLES } from './roles.js';
|
|
14
15
|
import { BPMN_RULES } from './rules.js';
|
|
15
16
|
import { bpmnTemplateCategory } from './templates/index.js';
|
|
@@ -114,6 +115,15 @@ export class BpmnViewExtension extends ViewExtensionProvider {
|
|
|
114
115
|
id: BlockFlavourIdentifier('affine:surface:bpmnNode'),
|
|
115
116
|
config: morphToolbarConfig(BPMN_MORPH_SPEC),
|
|
116
117
|
}));
|
|
118
|
+
// The reversed reading (MF3): what the process says about an artefact, on
|
|
119
|
+
// demand. Four profiles because BPMN has four parent-less node families
|
|
120
|
+
// (`reading.ts` says why the notation refuses a common root). The CLICK
|
|
121
|
+
// that triggers it is registered once by the surface and gated by the
|
|
122
|
+
// presence of a profile, so it goes with the flag without either side
|
|
123
|
+
// naming the other.
|
|
124
|
+
for (const reading of BPMN_READINGS) {
|
|
125
|
+
context.register(ReadingProfileExtension(reading));
|
|
126
|
+
}
|
|
117
127
|
context.register(bpmnSeniorTool);
|
|
118
128
|
context.register(CommandExtension(bpmnCommands, bpmnCommandIcons));
|
|
119
129
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-bpmn",
|
|
3
3
|
"description": "Labre bpmn framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.37.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@formicoidea/labre-core": "0.
|
|
34
|
+
"@formicoidea/labre-core": "0.37.0",
|
|
35
35
|
"lit": "^3.2.0"
|
|
36
36
|
}
|
|
37
37
|
}
|