@emaarco/bpmn-js-data-simulation 0.0.0 → 0.1.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.
Files changed (71) hide show
  1. package/README.md +99 -0
  2. package/dist/assets/bpmn-js-data-simulation.css +127 -0
  3. package/dist/domain/model.d.ts +32 -0
  4. package/dist/domain/model.d.ts.map +1 -0
  5. package/dist/domain/routing.d.ts +4 -0
  6. package/dist/domain/routing.d.ts.map +1 -0
  7. package/dist/domain/scenario.d.ts +13 -0
  8. package/dist/domain/scenario.d.ts.map +1 -0
  9. package/dist/domain/startFields.d.ts +31 -0
  10. package/dist/domain/startFields.d.ts.map +1 -0
  11. package/dist/domain/variables.d.ts +4 -0
  12. package/dist/domain/variables.d.ts.map +1 -0
  13. package/dist/engines/camunda7/camunda7Engine.d.ts +3 -0
  14. package/dist/engines/camunda7/camunda7Engine.d.ts.map +1 -0
  15. package/dist/engines/camunda7/juel.d.ts +32 -0
  16. package/dist/engines/camunda7/juel.d.ts.map +1 -0
  17. package/dist/engines/index.d.ts +7 -0
  18. package/dist/engines/index.d.ts.map +1 -0
  19. package/dist/engines/moddle.d.ts +8 -0
  20. package/dist/engines/moddle.d.ts.map +1 -0
  21. package/dist/engines/types.d.ts +21 -0
  22. package/dist/engines/types.d.ts.map +1 -0
  23. package/dist/engines/zeebe/zeebeEngine.d.ts +3 -0
  24. package/dist/engines/zeebe/zeebeEngine.d.ts.map +1 -0
  25. package/dist/index.cjs +1965 -0
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.d.ts +13 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +1951 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/integration/DataGateways.d.ts +20 -0
  32. package/dist/integration/DataGateways.d.ts.map +1 -0
  33. package/dist/integration/DataSimulation.d.ts +34 -0
  34. package/dist/integration/DataSimulation.d.ts.map +1 -0
  35. package/dist/integration/DataSimulationOverlays.d.ts +23 -0
  36. package/dist/integration/DataSimulationOverlays.d.ts.map +1 -0
  37. package/dist/integration/DataSimulationPanel.d.ts +11 -0
  38. package/dist/integration/DataSimulationPanel.d.ts.map +1 -0
  39. package/dist/integration/DataSimulationToggle.d.ts +11 -0
  40. package/dist/integration/DataSimulationToggle.d.ts.map +1 -0
  41. package/dist/integration/DataStartForm.d.ts +18 -0
  42. package/dist/integration/DataStartForm.d.ts.map +1 -0
  43. package/dist/integration/behaviors/DataContextPads.d.ts +24 -0
  44. package/dist/integration/behaviors/DataContextPads.d.ts.map +1 -0
  45. package/dist/integration/behaviors/DataGatewayBehaviors.d.ts +11 -0
  46. package/dist/integration/behaviors/DataGatewayBehaviors.d.ts.map +1 -0
  47. package/dist/integration/behaviors/DataGatewaySettings.d.ts +16 -0
  48. package/dist/integration/behaviors/DataGatewaySettings.d.ts.map +1 -0
  49. package/dist/integration/index.d.ts +7 -0
  50. package/dist/integration/index.d.ts.map +1 -0
  51. package/dist/integration/tokenSimulation.d.ts +98 -0
  52. package/dist/integration/tokenSimulation.d.ts.map +1 -0
  53. package/dist/simulation/DataSimulationStore.d.ts +85 -0
  54. package/dist/simulation/DataSimulationStore.d.ts.map +1 -0
  55. package/dist/ui/SimpleStartForm.d.ts +3 -0
  56. package/dist/ui/SimpleStartForm.d.ts.map +1 -0
  57. package/dist/ui/StartDialog.d.ts +16 -0
  58. package/dist/ui/StartDialog.d.ts.map +1 -0
  59. package/dist/ui/VariablesPanel.d.ts +30 -0
  60. package/dist/ui/VariablesPanel.d.ts.map +1 -0
  61. package/dist/ui/dom.d.ts +5 -0
  62. package/dist/ui/dom.d.ts.map +1 -0
  63. package/dist/ui/overlayContent.d.ts +5 -0
  64. package/dist/ui/overlayContent.d.ts.map +1 -0
  65. package/dist/ui/popoverPlacement.d.ts +18 -0
  66. package/dist/ui/popoverPlacement.d.ts.map +1 -0
  67. package/dist/ui/shadow.d.ts +2 -0
  68. package/dist/ui/shadow.d.ts.map +1 -0
  69. package/dist/ui/startForm.d.ts +18 -0
  70. package/dist/ui/startForm.d.ts.map +1 -0
  71. package/package.json +80 -3
package/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # @emaarco/bpmn-js-data-simulation
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@emaarco/bpmn-js-data-simulation.svg)](https://www.npmjs.com/package/@emaarco/bpmn-js-data-simulation)
4
+ [![CI](https://github.com/emaarco/bpmn-js-data-simulation/actions/workflows/ci.yml/badge.svg)](https://github.com/emaarco/bpmn-js-data-simulation/actions/workflows/ci.yml)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/LICENSE)
6
+
7
+ An add-on for [bpmn-js-token-simulation](https://github.com/bpmn-io/bpmn-js-token-simulation) that runs BPMN
8
+ processes **with data**: start variables, io mappings and gateway conditions, evaluated the way the
9
+ engine would. No running engine, no clicking the path by hand.
10
+
11
+ ![Starting a Zeebe process with a scenario, hovering gateways to see why they took their flow, and fixing a missing variable to continue a stuck token](https://raw.githubusercontent.com/emaarco/bpmn-js-data-simulation/main/docs/screenshots/simulation.gif)
12
+
13
+ ## Why
14
+
15
+ The token simulation shows which paths a process _can_ take. Gateways pick their flow by click, and
16
+ conditions, default flows and io mappings are ignored. That explains BPMN, but not _why_ a process
17
+ takes a path, and checking a condition still needs a deployed process and a running engine.
18
+
19
+ bpmn-js-data-simulation evaluates what the process is modeled with:
20
+
21
+ - **Shows why a path is taken.** Gateways that decided turn green; hover one and a card lists its
22
+ conditions, their results and the values they read. Click the gateway to keep the card open.
23
+ - **What-if on the spot.** Start an instance from a scenario, change any value in the start dialog,
24
+ or edit the variables of a running instance.
25
+ - **Behaves like the engine.** Zeebe conditions and mappings are FEEL, Camunda 7 ones JUEL, with
26
+ each engine's rules for task results and variables.
27
+ - **Fails visibly.** When no flow matches or a condition fails, the token stops at the gateway and
28
+ it turns red, as an incident would; its card tells why. Fix the data and continue.
29
+ - **Drop-in.** One more module next to the token simulation, in any bpmn-js modeler or viewer. A
30
+ **Data Simulation** switch next to the token simulation's own turns it off for the plain click-through.
31
+
32
+ ## Install
33
+
34
+ ```
35
+ npm install @emaarco/bpmn-js-data-simulation
36
+ ```
37
+
38
+ `bpmn-js` (>= 18) and `bpmn-js-token-simulation` (`1.0.0`, pinned) are peer dependencies.
39
+
40
+ ## Quick start
41
+
42
+ ```ts
43
+ import BpmnModeler from 'bpmn-js/lib/Modeler'
44
+ import TokenSimulationModule from 'bpmn-js-token-simulation'
45
+ import DataSimulationModule from '@emaarco/bpmn-js-data-simulation'
46
+ import zeebeModdle from 'zeebe-bpmn-moddle/resources/zeebe.json'
47
+ import 'bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css'
48
+ import '@emaarco/bpmn-js-data-simulation/assets/bpmn-js-data-simulation.css'
49
+
50
+ const modeler = new BpmnModeler({
51
+ container: '#canvas',
52
+ additionalModules: [TokenSimulationModule, DataSimulationModule],
53
+ moddleExtensions: { zeebe: zeebeModdle },
54
+ dataSimulation: { engine: 'zeebe', scenarios },
55
+ })
56
+ ```
57
+
58
+ Switch on the token simulation and press ▶ on a start event: a dialog asks for the start variables
59
+ the process reads, prefilled from a scenario. The [demo](https://emaarco.github.io/bpmn-js-data-simulation/)
60
+ runs Zeebe and Camunda 7 examples. Details: [usage](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/docs/usage.md).
61
+
62
+ ## What it covers
63
+
64
+ | Step | What happens |
65
+ | ---------------------------- | -------------------------------------------------------------------------------------- |
66
+ | Start | ▶ opens a form with the variables the process reads; a scenario prefills it |
67
+ | Tasks | Input and output mappings write process variables; task results come from the scenario |
68
+ | Gateways | Exclusive and inclusive gateways evaluate their conditions, including the default flow |
69
+ | No match or failed condition | The token waits at the gateway, marked red, until you fix the data |
70
+ | Unsupported condition | The gateway keeps the token simulation's click |
71
+ | Inspect | Gateway cards explain each decision; Process Data in the palette shows the variables |
72
+
73
+ ## Scenarios
74
+
75
+ Named sets of start variables and mocked task results, in a JSON file next to the diagram.
76
+
77
+ Details: [scenarios](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/docs/scenarios.md).
78
+
79
+ ## Zeebe and Camunda 7
80
+
81
+ `engine: 'zeebe'` reads `zeebe:ioMapping` and evaluates FEEL; `engine: 'camunda7'` reads
82
+ `camunda:inputOutput` and evaluates a subset of JUEL (also for Operaton and CIB seven).
83
+
84
+ Details: [engines](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/docs/engines.md).
85
+
86
+ ## Documentation
87
+
88
+ - [Usage](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/docs/usage.md): setup, start dialog, decision cards, Process Data and API
89
+ - [Scenarios](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/docs/scenarios.md): the scenario file and task results
90
+ - [Engines](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/docs/engines.md): Zeebe and Camunda 7 semantics, gateways, the JUEL subset
91
+ - [How it works](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/docs/how-it-works.md): how it plugs into the token simulation, decisions and limits
92
+
93
+ ## Contributing
94
+
95
+ See [CONTRIBUTING.md](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/CONTRIBUTING.md).
96
+
97
+ ## License
98
+
99
+ [MIT](https://github.com/emaarco/bpmn-js-data-simulation/blob/main/LICENSE) © Marco Schäck
@@ -0,0 +1,127 @@
1
+ :root {
2
+ --bds-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
3
+ --bds-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
4
+
5
+ --bds-surface: #ffffff;
6
+ --bds-ink: #1d1d1d;
7
+ --bds-muted: #5b5b5b;
8
+ --bds-line: #e6e2e2;
9
+ --bds-code-bg: rgba(29, 29, 29, 0.05);
10
+
11
+ --bds-accent: #335de5;
12
+ --bds-accent-ink: #2b50d4;
13
+ --bds-accent-soft: rgba(43, 80, 212, 0.12);
14
+ --bds-on-accent: #ffffff;
15
+
16
+ --bds-success: #0b7a55;
17
+ --bds-success-soft: rgba(11, 122, 85, 0.12);
18
+ --bds-warning: #92610a;
19
+ --bds-warning-soft: rgba(146, 97, 10, 0.12);
20
+ --bds-danger: #c92a2a;
21
+ --bds-danger-soft: rgba(201, 42, 42, 0.12);
22
+ --bds-gateway-decided-fill: #e7f3ee;
23
+ --bds-gateway-stuck-fill: #fbe9e9;
24
+
25
+ --bds-space-1: 4px;
26
+ --bds-space-2: 8px;
27
+ --bds-space-3: 16px;
28
+
29
+ --bds-radius-sm: 6px;
30
+ --bds-radius-md: 12px;
31
+ --bds-radius-lg: 16px;
32
+ --bds-radius-pill: 999px;
33
+
34
+ --bds-shadow-1: 0 1px 2px rgba(29, 29, 29, 0.06), 0 1px 3px rgba(29, 29, 29, 0.1);
35
+ --bds-shadow-2: 0 4px 12px rgba(29, 29, 29, 0.1);
36
+ --bds-shadow-3: 0 12px 32px rgba(29, 29, 29, 0.16);
37
+
38
+ --bds-motion-fast: 150ms;
39
+ --bds-ease: cubic-bezier(0.4, 0, 0.2, 1);
40
+ }
41
+
42
+ .bjs-container.simulation .djs-overlays .djs-overlay.djs-overlay-bds-flow-outcome {
43
+ display: block !important;
44
+ }
45
+
46
+ .bjs-container:has(.bds-palette-entry.active) .bts-log {
47
+ right: 332px;
48
+ }
49
+
50
+ .bjs-container.simulation .djs-element.bds-gateway--decided,
51
+ .bjs-container.simulation .djs-element.bds-gateway--stuck {
52
+ cursor: pointer;
53
+ }
54
+
55
+ .djs-element.bds-gateway--decided .djs-visual > polygon {
56
+ fill: var(--bds-gateway-decided-fill) !important;
57
+ stroke: var(--bds-success) !important;
58
+ }
59
+
60
+ .djs-element.bds-gateway--stuck .djs-visual > polygon {
61
+ fill: var(--bds-gateway-stuck-fill) !important;
62
+ stroke: var(--bds-danger) !important;
63
+ }
64
+
65
+ .djs-element.bds-gateway--decided.hover .djs-visual > polygon,
66
+ .djs-element.bds-gateway--stuck.hover .djs-visual > polygon {
67
+ stroke-width: 3px !important;
68
+ }
69
+
70
+ .bds-palette-entry svg {
71
+ width: 1em;
72
+ height: 1em;
73
+ fill: none;
74
+ stroke: currentColor;
75
+ stroke-width: 1.6;
76
+ stroke-linecap: round;
77
+ stroke-linejoin: round;
78
+ }
79
+
80
+ .bds-palette-entry[hidden] {
81
+ display: none;
82
+ }
83
+
84
+ .bds-data-toggle {
85
+ position: absolute;
86
+ top: 20px;
87
+ left: 200px;
88
+ display: none;
89
+ align-items: center;
90
+ gap: 0.25em;
91
+ padding: 6px;
92
+ font-family: inherit;
93
+ font-size: 16px;
94
+ line-height: normal;
95
+ color: var(--token-simulation-control-color, #222);
96
+ background-color: var(--token-simulation-control-background, #f1f2f4);
97
+ border: none;
98
+ border-radius: var(--button-border-radius, 3px);
99
+ cursor: pointer;
100
+ user-select: none;
101
+ }
102
+
103
+ .bjs-container.simulation .bds-data-toggle {
104
+ display: inline-flex;
105
+ }
106
+
107
+ .bds-data-toggle.active,
108
+ .bds-data-toggle:hover {
109
+ color: var(--token-simulation-control-surface, #fff);
110
+ background-color: var(--token-simulation-primary, #0067cc);
111
+ }
112
+
113
+ .bds-data-toggle-icon {
114
+ display: inline-flex;
115
+ }
116
+
117
+ .bds-data-toggle-icon svg {
118
+ height: 1em;
119
+ fill: none;
120
+ stroke: currentColor;
121
+ stroke-width: 2;
122
+ }
123
+
124
+ .bds-data-toggle-icon circle {
125
+ fill: currentColor;
126
+ stroke: none;
127
+ }
@@ -0,0 +1,32 @@
1
+ export type Variables = Record<string, unknown>;
2
+ export type Evaluation = {
3
+ ok: true;
4
+ value: unknown;
5
+ } | {
6
+ ok: false;
7
+ reason: string;
8
+ };
9
+ export interface Mapping {
10
+ source: string;
11
+ target: string;
12
+ }
13
+ export type GatewayKind = 'exclusive' | 'inclusive';
14
+ export interface OutgoingFlow {
15
+ id: string;
16
+ name?: string;
17
+ expression?: string;
18
+ isDefault: boolean;
19
+ }
20
+ export type FlowOutcome = 'taken' | 'not-taken' | 'error' | 'skipped';
21
+ export interface FlowEvaluation {
22
+ flow: OutgoingFlow;
23
+ outcome: FlowOutcome;
24
+ value?: unknown;
25
+ reason?: string;
26
+ }
27
+ export interface RoutingDecision {
28
+ flows: FlowEvaluation[];
29
+ takenFlowIds: string[];
30
+ stuckReason?: string;
31
+ }
32
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/domain/model.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE/C,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAErF,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,WAAW,CAAA;AAEnD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAA;AAErE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB"}
@@ -0,0 +1,4 @@
1
+ import type { Evaluation, GatewayKind, OutgoingFlow, RoutingDecision } from './model.js';
2
+ export type EvaluateCondition = (expression: string) => Evaluation;
3
+ export declare function routeGateway(kind: GatewayKind, outgoing: OutgoingFlow[], evaluateCondition: EvaluateCondition): RoutingDecision;
4
+ //# sourceMappingURL=routing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/domain/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAA+B,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAErH,MAAM,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,UAAU,CAAA;AAElE,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,YAAY,EAAE,EACxB,iBAAiB,EAAE,iBAAiB,GACnC,eAAe,CAkCjB"}
@@ -0,0 +1,13 @@
1
+ import type { Variables } from './model.js';
2
+ export interface Scenario {
3
+ id: string;
4
+ name: string;
5
+ description?: string;
6
+ variables: Variables;
7
+ taskResults: Record<string, Variables>;
8
+ }
9
+ export declare class ScenarioError extends Error {
10
+ name: string;
11
+ }
12
+ export declare function parseScenarios(input: unknown): Scenario[];
13
+ //# sourceMappingURL=scenario.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../../src/domain/scenario.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;CACvC;AAED,qBAAa,aAAc,SAAQ,KAAK;IAC7B,IAAI,SAAkB;CAChC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,EAAE,CAQzD"}
@@ -0,0 +1,31 @@
1
+ import type { Variables } from './model.js';
2
+ export type StartFieldType = 'number' | 'boolean' | 'text' | 'json' | 'auto';
3
+ export interface StartField {
4
+ name: string;
5
+ type: StartFieldType;
6
+ usedBy: string[];
7
+ }
8
+ export interface ElementVariableUsage {
9
+ elementName: string;
10
+ conditionReads: string[];
11
+ inputReads: string[];
12
+ inputTargets: string[];
13
+ outputReads: string[];
14
+ outputTargets: string[];
15
+ }
16
+ export type FieldValue = {
17
+ ok: true;
18
+ value: unknown;
19
+ } | {
20
+ ok: false;
21
+ reason: string;
22
+ };
23
+ export interface StartFieldHints {
24
+ examples?: Variables[];
25
+ taskResultNames?: string[];
26
+ }
27
+ export declare function deriveStartFields(usages: ElementVariableUsage[], { examples, taskResultNames }?: StartFieldHints): StartField[];
28
+ export declare function parseFieldValue(field: StartField, raw: string | boolean): FieldValue;
29
+ export declare function formatFieldValue(field: StartField, value: unknown): string | boolean;
30
+ export declare function applyFieldValues(base: Variables, values: Record<string, unknown>): Variables;
31
+ //# sourceMappingURL=startFields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startFields.d.ts","sourceRoot":"","sources":["../../src/domain/startFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,cAAc,CAAA;IACpB,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AAED,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAErF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,oBAAoB,EAAE,EAC9B,EAAE,QAAa,EAAE,eAAoB,EAAE,GAAE,eAAoB,GAC5D,UAAU,EAAE,CAkBd;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAwBpF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAKpF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAO5F"}
@@ -0,0 +1,4 @@
1
+ import type { Variables } from './model.js';
2
+ export declare function setVariable(variables: Variables, path: string, value: unknown): Variables;
3
+ export declare function isVariables(value: unknown): value is Variables;
4
+ //# sourceMappingURL=variables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/domain/variables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAQzF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D"}
@@ -0,0 +1,3 @@
1
+ import type { EngineAdapter } from '../types.js';
2
+ export declare const camunda7Engine: EngineAdapter;
3
+ //# sourceMappingURL=camunda7Engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camunda7Engine.d.ts","sourceRoot":"","sources":["../../../src/engines/camunda7/camunda7Engine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,aAAa,CAAA;AAG/D,eAAO,MAAM,cAAc,EAAE,aAY5B,CAAA"}
@@ -0,0 +1,32 @@
1
+ import type { Variables } from '../../domain/model.js';
2
+ type Node = {
3
+ type: 'literal';
4
+ value: unknown;
5
+ } | {
6
+ type: 'identifier';
7
+ name: string;
8
+ } | {
9
+ type: 'member';
10
+ object: Node;
11
+ property: Node;
12
+ } | {
13
+ type: 'unary';
14
+ operator: string;
15
+ operand: Node;
16
+ } | {
17
+ type: 'binary';
18
+ operator: string;
19
+ left: Node;
20
+ right: Node;
21
+ } | {
22
+ type: 'conditional';
23
+ test: Node;
24
+ consequent: Node;
25
+ alternate: Node;
26
+ };
27
+ export type JuelTemplate = Array<string | Node>;
28
+ export declare function parseJuelTemplate(text: string): JuelTemplate;
29
+ export declare function evaluateJuelTemplate(template: JuelTemplate, variables: Variables): unknown;
30
+ export declare function readJuelVariableNames(template: JuelTemplate): string[];
31
+ export {};
32
+ //# sourceMappingURL=juel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"juel.d.ts","sourceRoot":"","sources":["../../../src/engines/camunda7/juel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAMtD,KAAK,IAAI,GACL;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAA;AAE1E,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;AA+C/C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAe5D;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAO1F;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,EAAE,CAqBtE"}
@@ -0,0 +1,7 @@
1
+ import { camunda7Engine } from './camunda7/camunda7Engine.js';
2
+ import type { EngineAdapter, EngineId } from './types.js';
3
+ import { zeebeEngine } from './zeebe/zeebeEngine.js';
4
+ export declare function resolveEngine(engine: EngineId | EngineAdapter): EngineAdapter;
5
+ export { camunda7Engine, zeebeEngine };
6
+ export type { EngineAdapter, EngineId };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engines/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAOpD,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,aAAa,GAAG,aAAa,CAO7E;AAED,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,CAAA;AACtC,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { ModdleElement } from './types.js';
2
+ export declare function findExtension(element: ModdleElement, type: string): ModdleElement | undefined;
3
+ export declare function listProperty(element: ModdleElement | undefined, property: string): ModdleElement[];
4
+ export declare function readConditionExpression(sequenceFlow: ModdleElement): {
5
+ body?: string;
6
+ language?: string;
7
+ } | undefined;
8
+ //# sourceMappingURL=moddle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moddle.d.ts","sourceRoot":"","sources":["../../src/engines/moddle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAG7F;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,EAAE,CAGlG;AAED,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAOrH"}
@@ -0,0 +1,21 @@
1
+ import type { Evaluation, Mapping, Variables } from '../domain/model.js';
2
+ export type EngineId = 'zeebe' | 'camunda7';
3
+ export interface ModdleElement {
4
+ $type: string;
5
+ [property: string]: unknown;
6
+ }
7
+ export type TaskResultPropagation = 'always' | 'without-output-mappings';
8
+ export interface EngineAdapter {
9
+ id: EngineId;
10
+ label: string;
11
+ expressionLanguage: string;
12
+ taskResultPropagation: TaskResultPropagation;
13
+ writeVariable(variables: Variables, target: string, value: unknown): Variables;
14
+ readInputMappings(element: ModdleElement): Mapping[];
15
+ readOutputMappings(element: ModdleElement): Mapping[];
16
+ readCondition(sequenceFlow: ModdleElement): string | undefined;
17
+ canEvaluate(expression: string): boolean;
18
+ evaluate(expression: string, variables: Variables): Evaluation;
19
+ readVariableNames(expression: string): string[];
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/engines/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAExE,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAA;AAE3C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CAC5B;AAED,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,yBAAyB,CAAA;AAExE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,QAAQ,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,kBAAkB,EAAE,MAAM,CAAA;IAC1B,qBAAqB,EAAE,qBAAqB,CAAA;IAC5C,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9E,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,EAAE,CAAA;IACpD,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,EAAE,CAAA;IACrD,aAAa,CAAC,YAAY,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAAA;IAC9D,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,UAAU,CAAA;IAC9D,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAChD"}
@@ -0,0 +1,3 @@
1
+ import type { EngineAdapter } from '../types.js';
2
+ export declare const zeebeEngine: EngineAdapter;
3
+ //# sourceMappingURL=zeebeEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zeebeEngine.d.ts","sourceRoot":"","sources":["../../../src/engines/zeebe/zeebeEngine.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,WAAW,EAAE,aAYzB,CAAA"}