spec: lifecycle - the whole legal status graph, enforced on every status write - #16
Open
delchev wants to merge 1 commit into
Open
spec: lifecycle - the whole legal status graph, enforced on every status write#16delchev wants to merge 1 commit into
delchev wants to merge 1 commit into
Conversation
…tus write
Everything else about statuses is stated one edge at a time: `init:` names the
start, a `transitions:` button guards the flips a user performs through it, a
workflow step sets one, a check files a rejected record in another. Nowhere does
a file say which moves are legal at all, so any writer that is not a transition
button can move a document from any status to any other.
`lifecycle: { edges: [...] }` states the graph once, over the entity's
`function: EntityStatus` nomenclature. Two normative rules follow:
- Every status write is validated against it - user, workflow, glue, transition
button alike - which puts enforcement in the layer every writer passes through,
never in the transition endpoints alone. With `init:` declared, a record must
also be created at the start.
- `transitions` become presentation over the edges, and a status written by a
workflow step or forced by a check must be one an edge reaches - reported when
the file is read, since a reject path transiting through an approved status is
exactly what the graph exists to catch.
Also: the construct joins the status-by-name list and Appendix A, and leaves the
Planned list (it named "a declarative state machine").
Implemented in Eclipse Dirigible (eclipse-dirigible/dirigible#6714).
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.
The gap
Everything else about statuses is stated one edge at a time:
init:names where a record starts, atransitionsbutton guards the flips a user performs through it, a workflow step sets one, a check files a rejected record in another. Nowhere does a conforming file say which moves are legal at all - so any writer that is not a transition button (a workflow branch, a glue action, an API call) can move a document from any status to any other, and nothing notices.The 1.1 and 1.2 Planned lists named this ("a declarative state machine").
The construct
One entry per source status; either side accepts a seeded status name or its id. The graph is always over the entity's
function: EntityStatusrelation, so it names no column, and the nomenclature must be seeded in the same file (a status entity owned by another model is seeded there, and so is its lifecycle).Two normative rules
init:, a record must also be created at the start: entering the lifecycle anywhere else skips the graph rather than travelling it.transitionsbecome presentation over the edges: eachfrommust reach itssetStatusalong a declared edge, and a status written by a workflow step or forced by a check's rejection must be one some edge reaches - reported when the file is read. A reject path transiting through an approved status is exactly the mistake the graph exists to catch.Also in this PR
transitionsgains a sentence pointing at the graph.Implemented in Eclipse Dirigible - eclipse-dirigible/dirigible#6714 (PR eclipse-dirigible/dirigible#6733), which is where the wording above was proven out (including the
on:key the shape deliberately does not have: it would be redundant, and YAML 1.1 reads a bareonas the booleantrue).