From 5a6e05ab7abd607924f10cf14df4ff4473979474 Mon Sep 17 00:00:00 2001 From: "Dr. David A. Kunz" Date: Wed, 13 Nov 2024 11:12:11 +0100 Subject: [PATCH 1/4] feat: programmatic invocation of draft actions --- node.js/fiori.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/node.js/fiori.md b/node.js/fiori.md index 95423413b..306db1213 100644 --- a/node.js/fiori.md +++ b/node.js/fiori.md @@ -174,3 +174,14 @@ You can set the property to one of the following: - Draft-related properties (with the exception of `IsActiveEntity`) are only computed for the target entity, not for expanded sub entities since this is not required by Fiori Elements. - Manual filtering on draft-related properties is not allowed, only certain draft scenarios are supported. + +### Programmatic Invocation of Draft Actions + +You can programmatically invoke draft actions with the following APIs: + +```js +await srv.new(MyEntity, data) // create new draft +await srv.cancel(MyEntity.drafts, keys) // cancel draft +await srv.edit(MyEntity, keys) // create draft from active instance +await srv.save(MyEntity.drafts, keys) // activate draft +``` From 6a26d0832274a0f5a4587d6399e919c808975e33 Mon Sep 17 00:00:00 2001 From: "Dr. David A. Kunz" Date: Tue, 26 Nov 2024 09:32:18 +0100 Subject: [PATCH 2/4] Update node.js/fiori.md --- node.js/fiori.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node.js/fiori.md b/node.js/fiori.md index 306db1213..e0a1ea34d 100644 --- a/node.js/fiori.md +++ b/node.js/fiori.md @@ -181,7 +181,7 @@ You can programmatically invoke draft actions with the following APIs: ```js await srv.new(MyEntity, data) // create new draft -await srv.cancel(MyEntity.drafts, keys) // cancel draft +await srv.discard(MyEntity.drafts, keys) // discard draft await srv.edit(MyEntity, keys) // create draft from active instance await srv.save(MyEntity.drafts, keys) // activate draft ``` From c735251406bf445e21ad353830e19e79b377446b Mon Sep 17 00:00:00 2001 From: "Dr. David A. Kunz" Date: Tue, 26 Nov 2024 16:31:53 +0100 Subject: [PATCH 3/4] Update node.js/fiori.md --- node.js/fiori.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node.js/fiori.md b/node.js/fiori.md index e0a1ea34d..6fe3cfc28 100644 --- a/node.js/fiori.md +++ b/node.js/fiori.md @@ -180,8 +180,8 @@ You can set the property to one of the following: You can programmatically invoke draft actions with the following APIs: ```js -await srv.new(MyEntity, data) // create new draft +await srv.new(MyEntity, data) // create new draft await srv.discard(MyEntity.drafts, keys) // discard draft -await srv.edit(MyEntity, keys) // create draft from active instance -await srv.save(MyEntity.drafts, keys) // activate draft +await srv.edit(MyEntity, keys) // create draft from active instance +await srv.save(MyEntity.drafts, keys) // activate draft ``` From c8f38596fb45d971e689e06e0a85088a52f77524 Mon Sep 17 00:00:00 2001 From: "Dr. David A. Kunz" Date: Tue, 26 Nov 2024 16:32:38 +0100 Subject: [PATCH 4/4] Update node.js/fiori.md --- node.js/fiori.md | 1 + 1 file changed, 1 insertion(+) diff --git a/node.js/fiori.md b/node.js/fiori.md index 6fe3cfc28..0268f0496 100644 --- a/node.js/fiori.md +++ b/node.js/fiori.md @@ -183,5 +183,6 @@ You can programmatically invoke draft actions with the following APIs: await srv.new(MyEntity, data) // create new draft await srv.discard(MyEntity.drafts, keys) // discard draft await srv.edit(MyEntity, keys) // create draft from active instance +await srv.new(MyEntity).for(keys) // same as above await srv.save(MyEntity.drafts, keys) // activate draft ```