Skip to content
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

feat(draft): Bypassing Draft Restrictions #639

Merged
merged 18 commits into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions node.js/fiori.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,51 @@ To prevent inconsistency, the entities with draft are locked for modifications b
cds.drafts.cancellationTimeout=1h
```

### Bypassing the SAP Fiori Draft Flow

Creating or modifying active instances directly is possible without creating drafts. This comes in handy when technical services without a UI interact with each other.

To enable this feature, set this feature flag in your configuration:

```json
{
"cds": {
"fiori": {
"bypass_draft": true
}
}
}
```

You can then create active instances directly:

```http
POST /Books

{
"ID": 123,
"IsActiveEntity": true
}
```
arleytm marked this conversation as resolved.
Show resolved Hide resolved

You can modify them directly:

```http
PATCH /Books(ID=123,IsActiveEntity=true)

{
"title": "How to be more active"
}
```

This feature is required to enable [SAP Fiori Elements Mass Edit](https://sapui5.hana.ondemand.com/sdk/#/topic/965ef5b2895641bc9b6cd44f1bd0eb4d.html), allowing users to change multiple objects with the
same editable properties without creating drafts for each row.

:::warning
Note that this feature creates additional entry points to your application. Custom handlers are triggered with delta
payloads rather than the complete business object.
:::

### Garbage Collection of Stale Drafts

Inactive drafts can be deleted automatically after a timeout. You can configure this timeout by the following configuration:
Expand Down
Loading