Skip to content

Java: flows #1793

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Java: flows #1793

wants to merge 2 commits into from

Conversation

JenniferStamm
Copy link
Contributor

WIP, draft for early feedback

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling Mistakes

  • java/flows.md:80:46 Unknown word "dependenies"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.


Let's take a look at the [CAP SFLIGHT App](https://github.com/SAP-samples/cap-sflight) sample and how we can update it using the flow feature.

The `cds-feature-flow` has been added to the dependenies.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `cds-feature-flow` has been added to the dependenies.
The `cds-feature-flow` has been added to the dependences.

Or maybe one of these: dependencies, dependence, dependents, dependent's?

Copy link
Contributor

@BraunMatthias BraunMatthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! We need to discuss whether Flows should be top level topic (keep it as it is for now)

```xml
<dependency>
<groupId>com.sap.cds</groupId>
<artifactId>cds-feature-flows</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

identation

```xml
<dependency>
<groupId>com.sap.cds</groupId>
<artifactId>cds-feature-flows</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

key TravelUUID : UUID;
TravelID : Integer default 0 @readonly;
@flow.status
TravelStatus : Association to TravelStatus default 'O' @readonly;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TravelStatus is not shown in the example and seems to be an intermediate CodeList

}
```

We can simply remove the [AcceptRejectHandler](https://github.com/SAP-samples/cap-sflight/blob/main/srv/src/main/java/com/sap/cap/sflight/processor/AcceptRejectHandler.java). All of the logic is taken care of by the flow feature. The flow feature will validate that entry state is `Open`. The flow feature will transit the status to `Accepted` and `Canceled` respectively.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"You can simply remove ..."

I fear customers will not investigate existing SFlight code ni depth - you could still name the benefit, that a custom reject handler is not needed due to flow capabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants