fix(templates): the BPM starter's form calls its client-Java service - #6630
Merged
Conversation
Master's nightly is red on BPMStarterTemplateIT, on both the H2 and the PostgreSQL leg. #6619 migrated the BPM starter's two TypeScript files to client Java but left everything that TALKS to them pointing at the retired TypeScript, so the sample no longer works at all: - the form still posted to /services/ts/<project>/api/ProcessService.ts/ processes, a file that PR deleted, and branched on `response.status != 202` - the status the TS service used to set, where the client-Java @controller answers 200. Hence the failure the nightly reports: the alert reads "Unable to trigger a new process: 'undefined'" (the error branch prints `response.message`, which the form-builder's $http shim never sets). It now posts to /services/java/<project>/<javaPackageName>/ProcessService/processes and, since that shim rejects on a non-2xx, uses a proper error callback instead of an exact-status branch - which also gives the failure path a real message. - the service task logged a different line than before the migration ("Process instance [id] with variables" vs "Process variables"), which the test asserts. Restored, so the sample's observable behaviour is unchanged by the port. And the test itself watched the wrong logger. `console.log` from the retired TypeScript task landed on "app.out"; the SDK logger nests the name it is given under "app.", so the Java task logs to app.<package>.MyServiceTask - which an appender bound to app.out never sees, and which logback-test.xml pins to ERROR. It now watches the "app" tree, so it observes any client-application log and does not depend on the package name derived from the project. Verified by running BPMStarterTemplateIT locally: the process starts through the Java controller and the task logs `app.bpmtestproject.MyServiceTask - Hello World! Process variables: {param1=string-param-value, param2=777.0}`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Master's nightly is red (run 31290954773) —
BPMStarterTemplateIT.testCreateProjectFromTemplatefails on both the H2 and the PostgreSQL leg (243 tests, 1 failure), so it is deterministic, not a flake. The 8 Aug nightly was green; the regression is #6619.That PR migrated the BPM starter's two TypeScript files to client Java, but left everything that talks to them pointing at the retired TypeScript — so the shipped sample does not work at all.
Three things were broken
/services/ts/<project>/api/ProcessService.ts/processes, which feat(templates): client-Java process handlers for template-bpm (#6584) #6619 removed, and branched onresponse.status != 202— the status the TS service used to set, where a client-Java@Controlleranswers 200. That is exactly the failure the nightly reports: the alert readsUnable to trigger a new process: 'undefined'(the error branch printsresponse.message, which the form-builder's$httpshim never sets). It now posts to/services/java/${projectName}/${javaPackageName}/ProcessService/processes, and since that shim rejects on a non-2xx, it uses a proper error callback rather than an exact-status branch — which also gives the failure path a real message instead ofundefined.Process instance [id] with variablesvsProcess variables), and the test asserts on it. Restored, so the sample's observable behaviour is unchanged by the migration.console.logfrom the retired TypeScript task landed onapp.out; the SDK logger nests the name it is given underapp., so the Java task logs toapp.<package>.MyServiceTask— which an appender bound toapp.outnever receives, and whichlogback-test.xmlpins toERROR.LogsAsserteronly lowers the level of the logger it is handed, so the message was silently invisible: no error, just a 30-second timeout. It now watches theapptree, so it observes any client-application log and does not depend on the package name the template derives from the project.(1) is what the nightly hit; (2) and (3) sat right behind it and would have failed the very next assertion.
Verified
Ran
BPMStarterTemplateITlocally against the fix — green, and the process really runs end to end through the Java stack:Also checked, while confirming the generated URL is right:
${JavaTask}survives Velocity (an undefined reference passes through — verified against the engine itself, so the BPMN's delegate expression is intact),JavaNames.toPackageNameyields a single lower-case segment, and a client controller routes by FQN with dots→slashes.🤖 Generated with Claude Code