-
Notifications
You must be signed in to change notification settings - Fork 0
feat: status-transition flows #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@to: $flow.previous)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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