You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prevent inconsistency, the entities with draft are locked for modifications by other users. The lock is released when the draft is saved, canceled or a timeout is hit. The default timeout is 15 minutes. You can configure this timeout by the following application configuration property:
@@ -153,6 +158,7 @@ If the `draft_lock_timeout` has been reached, every user can delete other users'
153
158
:::
154
159
155
160
161
+
156
162
## Draft Timeouts
157
163
158
164
Inactive drafts are deleted automatically after the default timeout of 30 days. You can configure or deactivate this timeout by the following configuration:
@@ -178,43 +184,42 @@ It can occur that inactive drafts are still in the database after the configured
178
184
:::
179
185
180
186
181
-
## Bypassing Drafts
182
-
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.
183
187
184
-
To enable this feature, set this feature flag in your configuration:
188
+
## Bypassing Drafts {.deprecated}
189
+
190
+
Use [Direct CRUD](#direct-crud) instead.
191
+
192
+
Until the next major release (`cds10`), you can still activate the draft bypass without also allowing direct CRUD via <Config>cds.fiori.bypass_draft:true</Config>.
185
193
186
-
```json
187
-
{
188
-
"cds": {
189
-
"fiori": {
190
-
"bypass_draft": true
191
-
}
192
-
}
193
-
}
194
-
```
195
194
196
-
You can then create active instances directly:
195
+
196
+
## Direct CRUD <Beta />
197
+
198
+
With <Config>cds.fiori.direct_crud:true</Config>, creating or modifying active instances directly is possible without creating drafts.
199
+
This comes in handy when technical services without a UI interact with each other.
200
+
201
+
That is, you can then create and modify active instances directly:
197
202
198
203
```http
199
204
POST /Books
200
205
201
206
{
202
-
"ID": 123,
203
-
"IsActiveEntity": true
207
+
"ID": 123
204
208
}
205
209
```
206
210
207
-
You can modify them directly:
208
-
209
211
```http
210
-
PATCH /Books(ID=123,IsActiveEntity=true)
212
+
PATCH /Books(ID=123)
211
213
212
214
{
213
215
"title": "How to be more active"
214
216
}
215
217
```
216
218
217
-
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
219
+
For this, the default draft creation behavior by SAP Fiori Elements is redirected to a collection-bound action via annotation `@Common.DraftRoot.NewAction`.
220
+
The thereby freed `POST` request to draft roots without specifying `IsActiveEntity` leads to the creation of an active instance (as it would without draft enablement).
221
+
222
+
The 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
218
223
same editable properties without creating drafts for each row.
219
224
220
225
:::warning Additional entry point
@@ -223,6 +228,7 @@ payloads rather than the complete business object.
223
228
:::
224
229
225
230
231
+
226
232
## Programmatic APIs <Beta />
227
233
228
234
You can programmatically invoke draft actions with the following APIs:
0 commit comments