Conversation
@to: $flow.previous)There was a problem hiding this comment.
This image is hardly readable when using dark mode, I think it should not have a transparent background.
| action rejectTravel(); | ||
| action reopenTravel(); | ||
| action deductDiscount( percent: Percentage not null ) returns Travels; | ||
| action draftEdit(PreserveChanges: Boolean) returns Travels; // define to annotate |
There was a problem hiding this comment.
Its a little unfortunate if edit is now always present, as that no longer produces a reasonable behaviour together with the field control annotations. I readded the flow with the draftEdit action for the time being.
| annotate Travels with @flow.status: (Status) actions { | ||
| deductDiscount @from: [ #Open ]; // can only be called on #Open travels | ||
| acceptTravel @from: [ #Open ] @to: #Accepted; | ||
| rejectTravel @from: [ #Open ] @to: #Canceled; |
There was a problem hiding this comment.
I changed #Rejected to #Canceled as the other enum value actually doesn't exist. It also matches the picture in the README. If you want to rename to #Rejected please do so consistently.
There was a problem hiding this comment.
copy paste error. daniel had changed to #Rejected in xtravels. i'll align...
|
I didn't notice the auto merge when approving. Please double-check my comments and feel free to make adjustments as required :) |
summary
makes use of new status-transition flows feature of cds-services^4.5 and cds^9.5:
CDS_ENV=flow mvn cds:watchextends to a more complex flow incl. usage of
@to: $flow.previous.for that, status
InReviewandBlockedas well as actionsreviewTravel,reopenTravel,blockTravel, andunblockTravelwere added in order to create a scenario where the previous state ofBlockedcan be eitherOpenorInReview.visualization of the flow:

related