Skip to content

fix: order the bike carried by the bikeId process variable - #10

Merged
emaarco merged 2 commits into
mainfrom
fix/order-bike-reads-bike-id
Oct 9, 2026
Merged

emaarco merged 2 commits into
mainfrom
fix/order-bike-reads-bike-id

Conversation

@emaarco

@emaarco emaarco commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Related to miragon-blueprints/zeebe-example#29 — same defect, same fix as miragon-blueprints/zeebe-example#35, translated to this engine.

Problem

The order-bike handler only read the application id and OrderBikeService took the bike from the database. The bikeId variable set on completing Clarify alternative with customer was never read, and clarify-alternative.form had no bikeId field. Completing the task in the Tasklist with alternativeFound = true re-ordered the same out-of-stock bike and looped back into the clarification.

Change

The bikeId process variable is now the single source for the bike to order.

  • Inbound: the order-bike handler reads bikeId from the process and passes it to OrderBikeUseCase.orderBike(id, bikeId). OrderBikeService puts it on the application and stores it, also when the alternative is unavailable too.
  • Outbound: SelectAlternativeService no longer writes the bike itself. It still registers the bike model in the portfolio and completes the task.
  • Validation: POST …/clarify-alternative with alternativeFound = true and no bikeId is refused with a 400.
  • Form: clarify-alternative.form gets a required bikeId text field, shown when an alternative was found.
  • Model: bikeId is declared on the user task and the order task for the generated process API. Engine behaviour is unchanged by that.
  • Docs and Bruno: BPMN documentation and README.md updated; new scenario 10-alternative-via-tasklist completes the task through the engine REST API with the variables the form submits.

Verification

The full build is green locally, with no drift in openapi/openapi.json or the generated process API. The Bruno scenarios were not run locally; they run in this PR's pipeline.

The order worker now reads the bikeId process variable and hands it to
OrderBikeService, which stores it on the application and orders it. An
alternative chosen through the Tasklist form therefore reaches the domain
just like one chosen through the REST endpoint. The form gains a required
bikeId field, and the endpoint answers 400 for an accepted alternative
that names no bike.

Related to miragon-blueprints/zeebe-example#29
The diff-scoped mutation gate saw gaps in the classes the bikeId fix
touches: the clarify-alternative task lookup, the unwrapping of failed
correlations, and the unknown-application branches of the order and
select-alternative services.

Related to miragon-blueprints/zeebe-example#29
@emaarco
emaarco merged commit 630b170 into main Oct 9, 2026
4 checks passed
@emaarco
emaarco deleted the fix/order-bike-reads-bike-id branch October 9, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant