fix(templates): the BPM starter's form calls its client-Java service - #6631
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.
Fixes red master nightly
BPMStarterTemplateITis failing on master 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 does not work at all:
/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 theclient-Java
@Controlleranswers 200. That is the failure the nightly reports: the alert readsUnable to trigger a new process: 'undefined', because the error branch printsresponse.message,which the form-builder's
$httpshim never sets. It now posts to/services/java/<project>/<javaPackageName>/ProcessService/processesand uses a proper errorcallback instead of an exact-status branch, which also gives the failure path a real message.
Process instance [id] with variablesvsProcess variables), which the test asserts. Restored, so the sample's observablebehaviour is unchanged by the port.
The test itself also watched the wrong logger:
console.logfrom the retired TypeScript landed onapp.out, while the SDK logger nests the given name underapp., so the Java task logs toapp.<package>.MyServiceTask— which an appender bound toapp.outnever sees, and whichlogback-test.xmlpins to ERROR. It now watches theapptree, so it observes any client-applicationlog and does not depend on the package name derived from the project.
Verified locally by the commit's author: 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}.Full rationale is in the commit message.
🤖 Generated with Claude Code