Skip to content

docs: name the third Transition parameter as the transition name, not the new state - #2607

Merged
Su (sushmangupta) merged 2 commits into
mainfrom
fix/docs-state-machine-transition-parameter
Oct 14, 2026
Merged

Su (sushmangupta) merged 2 commits into
mainfrom
fix/docs-state-machine-transition-parameter

Conversation

@d-kirkland

@d-kirkland Daniel Kirkland (d-kirkland) commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The "Transition parameters" section of the state machine guide describes the third constructor parameter of Transition as "the new state to be transitioned to. E.g. this could be paid". The parameter is the name of the transition (action): the state machine looks up the transition with that action name from the current state and derives the resulting state. The guide's own examples (process, do_pay, ship) and its lists of "possible transition values" show this.
  • The next bullet calls the state field name "the last parameter", but Transition has a fifth, optional parameter ($internalComment).
  • Rewrites the third-parameter bullet (names it the transition/action name, notes the forced-mode exception that the page itself documents in "Forcing a transition") and changes "last parameter" to "fourth parameter".

Related links

Docs (at origin/main 70b7d45): using-the-state-machine.md L49-50 ("The third parameter is the new state to be transitioned to. E.g. this could be paid, if the order is still open."), using-the-state-machine.md L51 ("The last parameter is the name of the StateMachineStateField."), and the section Forcing a transition L172-L175 ("the transition name is interpreted as the target state's technical name").

Platform source (tag v6.7.15.1):

  • Transition.php L11-15: constructor parameters in order $entityName, $entityId, $transitionName, $stateFieldName, ?$internalComment = null.
  • StateMachineRegistry.php L169-174: getTransitionDestinationById(..., $transition->getTransitionName(), ...); L339: if ($transition->getActionName() !== $transitionName) { continue; } (the name is matched against the transitions' action names); L383-L387: only with the FORCE_TRANSITION context state is the name searched as a state technicalName.
  • StateMachineTransitionActions.php L10-L31: the action names (cancel, process, ship, ...).

Checklist

  • I reviewed affected links, code samples, and cross-references, including PageRef references where relevant. (The anchor #forcing-a-transition matches the heading at L172; rumdl@0.2.67 passes.)
  • I added or updated redirects in .gitbook.yaml if pages were moved, renamed, or deleted. (N/A, no page moved.)
  • I updated .wordlist.txt (and sorted it) if spellcheck flags new legitimate terms. (No new prose words outside code spans; checked against .wordlist.txt; the docker spellcheck image could not be run locally.)
  • Any required dependent changes in downstream modules have already been merged and published. (N/A)
  • This pull request is ready for review.

Notes

  • This PR was fully AI generated (Claude Code) and requires human review. It has not been merged, approved or reviewed by the AI session. Please verify the claims and the changed text against the linked source.
  • Scope: main (Shopware 6.7) only. Checked against the platform tag v6.7.15.1 (the latest 6.7 tag when this was written). Older versions have their own docs branches and are not touched here.
  • Not changed on purpose (other wrong statements on this page, out of scope for this PR): L98 "via the pay action" is covered by docs: use the process action instead of do_pay in the order transaction state machine guide (6.7) #2587; L140 says you cannot refund a delivery that was never shipped, but the delivery transition list has no refund action; the page's source links point at the stale tag v6.3.4.1; the helper-method list near the end omits some current methods.
  • The sentence about the resulting state ("The state machine determines the resulting state from the current state and this transition name") rests on getTransitionDestinationById above, not on execution.

🤖 Generated with Claude Code

… the new state

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@d-kirkland Daniel Kirkland (d-kirkland) added Improvement PR created to append/modify info in the existing article Info Missed To Document Info Missed To Document labels Oct 13, 2026
@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: 6bb06f4
Preview: https://developer-documentation-q086l1pmr-shopware-frontends.vercel.app
Workflow run: #5630

@sushmangupta
Su (sushmangupta) merged commit 10e5f09 into main Oct 14, 2026
8 checks passed
@sushmangupta
Su (sushmangupta) deleted the fix/docs-state-machine-transition-parameter branch October 14, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement PR created to append/modify info in the existing article Info Missed To Document Info Missed To Document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants