camunda-cli 0.3.0 → 0.3.1

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/bin/camunda.js CHANGED
@@ -24,7 +24,7 @@ program
24
24
  'Start with "camunda inspect <key>" to read a deployed model, and\n' +
25
25
  '"camunda diagnose <instanceId>" when an instance misbehaves.'
26
26
  )
27
- .version('0.3.0')
27
+ .version('0.3.1')
28
28
  .option('--json', 'print the raw API payload instead of a formatted view')
29
29
  .option('--no-color', 'never emit colour, even on a terminal')
30
30
  .showHelpAfterError()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camunda-cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Command-line client for self-hosted Camunda 7: inspect and lint deployed BPMN models, and diagnose why an instance is stuck",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/lint.js CHANGED
@@ -108,7 +108,8 @@ export function lintProcess(model, { engineVariables = [] } = {}) {
108
108
  n.id,
109
109
  `Every outgoing flow of "${n.name || n.id}" has a condition and there is no default flow. ` +
110
110
  `If they all evaluate false at runtime the engine raises ENGINE-02004 and the instance stops. ` +
111
- `Mark one flow as the default.`
111
+ `Mark one flow as the default and remove its condition: a default flow carrying a condition is ` +
112
+ `rejected at deploy time with ENGINE-09005.`
112
113
  );
113
114
 
114
115
  // Numeric gap: a > N and a < N leave a == N with nowhere to go.
@@ -134,6 +135,29 @@ export function lintProcess(model, { engineVariables = [] } = {}) {
134
135
  }
135
136
  }
136
137
 
138
+ // The engine refuses to parse this rather than failing at runtime, so a model that is
139
+ // otherwise fine is rejected outright at deploy time.
140
+ if (n.defaultFlow) {
141
+ const target = outs.find((f) => f.id === n.defaultFlow);
142
+ if (!target) {
143
+ add(
144
+ 'error',
145
+ 'default-flow-missing',
146
+ n.id,
147
+ `"${n.name || n.id}" names "${n.defaultFlow}" as its default flow, but that is not one of its outgoing flows.`
148
+ );
149
+ } else if (target.condition) {
150
+ add(
151
+ 'error',
152
+ 'default-flow-with-condition',
153
+ n.id,
154
+ `The default flow of "${n.name || n.id}" ("${target.name || target.id}") also carries the condition ` +
155
+ `${target.condition}. A default flow is the branch taken when nothing else matches, so it cannot have ` +
156
+ `one: the engine rejects this at deploy time with ENGINE-09005. Remove the condition from that flow.`
157
+ );
158
+ }
159
+ }
160
+
137
161
  if (n.type === 'exclusiveGateway' && unconditional.length > 1) {
138
162
  add(
139
163
  'warning',