Commit 5849cab
fix(intent): task-form button action wins over a stale model action (approve-as-reject)
In a multi-step flow (submit -> approve), the second task's form completed down
the wrong branch: a prior task set an 'action' process variable, form.js
preloaded it into the model on open, and the completion handler's
Object.assign({ action }, $scope.model) let that stale model 'action' overwrite
the clicked button -> the decision gateway (${action == 'approve'}) saw 'submit'
and took the reject branch. Both Approve and Reject effectively sent 'submit',
so a manager could never approve.
Two coordinated fixes:
- FormIntentGenerator: rebuild the COMPLETE payload explicitly - copy the model
MINUS 'action' and control vars (__*, which are locators, not entity data),
then set 'action' LAST so the button wins.
- form.js.template: never preload the bare 'action' process variable into the
model (the __* locators still load - the runtime reads them).
The bug lives in emitted client JS (the browser builds the payload), so the
HTTP ITs - which build the payload themselves - cannot exercise it; IntentEngineIT
gains an emission assertion that the generated form code rebuilds the payload
with the button action winning and no longer uses the buggy Object.assign. The
runtime proof is a browser submit->approve flow (verified via the KF vacations
regen, which was blocked on exactly this).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent c4bdc6a commit 5849cab
3 files changed
Lines changed: 29 additions & 2 deletions
File tree
- components
- engine/engine-intent/src/main/java/org/eclipse/dirigible/components/intent/generator/form
- template/template-form-builder-harmonia/src/main/resources/META-INF/dirigible/template-form-builder-harmonia/ui
- tests/tests-integrations/src/main/java/org/eclipse/dirigible/integration/tests/api
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
250 | 263 | | |
251 | 264 | | |
252 | | - | |
| 265 | + | |
253 | 266 | | |
254 | 267 | | |
255 | 268 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2174 | 2174 | | |
2175 | 2175 | | |
2176 | 2176 | | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
2177 | 2186 | | |
2178 | 2187 | | |
2179 | 2188 | | |
| |||
0 commit comments