Status flows

Declaring in the model which status transitions an entity may make, so the runtime rejects a transition nobody declared and sets the status itself when the bound action runs, instead of a check written by hand in every handler. Not input validation: that checks a value, this checks a transition. Not workflow integration: that drives an external engine, and this stays inside the model.

Overview

SAP SHIPS
Node.js →

@sap/cds Validates and executes the status transitions modelled with @flow.status, @from and @to on bound actions in the generic handlers, out of the box; in CAP Java the same is the cds-feature-flow package.

Java →

com.sap.cds:cds-feature-flow Adds declarative status-transition flows to CAP Java: entry and target states on a bound action, validated and applied by a generic handler that answers 409 Conflict from a wrong state.

Not covered: Only bound actions can be flow-controlled: plain CRUD and draft operations cannot be restricted by a flow. On a draft-enabled entity every action is disabled while a draft is open, so a transition can only be performed on the active instance.

Built into @sap/cds
SourceStatus-Transition Flowschecked
THE COMMUNITY ADDS

No community artifact is documented here.

Artifacts2

2 of 2 artifacts
ArtifactSignals
Packages2
@sap/cdsCAP Node.js runtime
Signals
none
com.sap.cds:cds-feature-flowDeclarative status-transition flows on bound actions in CAP Java
Signals
none

Content1

Group by
Piece, what it offers
Everything new: Try out the latest features in CAP
SAP TechEd — session catalogue, Daniel Hutzel, Daniel Schlachter, TalkA recipe
Everything new: Try out the latest features in CAP
SAP TechEd — session catalogue, Daniel Hutzel, Daniel Schlachter, TalkA recipe

Details

Coverage
statecore only, CAP
assessed
SourceStatus-Transition Flowschecked SourceStatus-Transition Flowschecked SourceStatus-Transition Flowschecked SourceStatus-Transition Flowschecked SourceStatus-Transition Flowschecked SourceStatus-Transition Flowschecked
For your agent