From f32be690702ef6fd90293fd280ed08a1a2a9335a Mon Sep 17 00:00:00 2001 From: Dima Fedorenko Date: Thu, 3 Oct 2024 17:36:13 +0200 Subject: [PATCH 1/5] Add docs about customizing http response for OData action and OData from a micforlow --- .../published-odata-entity.md | 23 ++++++++++++++++--- .../published-odata-microflow.md | 13 +++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md index c049e652693..94f291847de 100644 --- a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md +++ b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md @@ -111,7 +111,7 @@ When the app receives a request to insert a new object, it does the following: This is the behavior when you choose the action **Write to database**. -You can also choose the **Call a microflow** action to use your own logic. Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) parameter. In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database. +You can also choose the **Call a microflow** action to use your own logic. Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameters. In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database. In the publishing app, you can use a validation message action to report a validation error. The client app can include a custom error handler on the [Send External Object](/refguide/send-external-object/) activity to handle the error. If the microflow reports [validation feedback](/refguide/validation-feedback/), the runtime informs the client that the request has failed. For more information, see [Supported OData Operations](/refguide/supported-odata-operations/#updating-objects). @@ -156,7 +156,9 @@ When the app receives a request to change values, it does the following: This is the behavior when you choose the action **Write to database**. -You can also choose the **Call a microflow** action to use your own logic. Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) parameter. In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database. +You can also choose the **Call a microflow** action to use your own logic. +Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameters. +In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database. In the publishing app, you can use a validation message action to report a validation error. The client app can include a custom error handler on the [Send External Object](/refguide/send-external-object/) activity to handle the error. If the microflow reports [validation feedback](/refguide/validation-feedback/), the runtime informs the client that the request has failed. For more information, see [Supported OData Operations](/refguide/supported-odata-operations/#updating-objects). @@ -164,7 +166,9 @@ In the publishing app, you can use a validation message action to report a valid Select the checkbox for **Deletable** to indicate that clients can delete the values of attributes and associations. -Choose whether the object should be deleted from the database directly, or whether to call a microflow. Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) parameter. In the microflow, you can use the [Delete](/refguide/deleting-objects/) activity to delete the object from the database. +Choose whether the object should be deleted from the database directly, or whether to call a microflow. +Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameters. +In the microflow, you can use the [Delete](/refguide/deleting-objects/) activity to delete the object from the database. You can use a validation message to report a validation error if you are performing, for example, a soft delete. If the microflow reports [validation feedback](/refguide/validation-feedback/), the runtime informs the client that the request has failed. @@ -191,3 +195,16 @@ Setting **Use paging** to **Yes** may result in inconsistency in the retrieved d When **Use paging** is set to **Yes**, the number of objects per page can be set in **Page size**. Default: **10000** + +## 8 Customising outgoing HTTP response (only applicable when **Call a microflow** is selected) + +It is possible to manipulate response which would be produced as a result of the request. +In order to do that the microflow must take a parameter of [System.HttpResponse](/refguide/http-request-and-response-entities/) type. + +If no changes were made to HttpResponse object then actual response won't be changed as well. + +If only headers of the HttpResponse were changed (for instance a new header was added to the response) then those headers would be merged with default headers, replacing values of the same name. + +If status code OR content of the HttpResponse were changed then actual response would be produced exclusively from HttpResponse parameter, including status code, headers and response body. + +Note. Reason phrase field is ignored. diff --git a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md index 5e460e616e9..209e9b3c5d5 100644 --- a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md +++ b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md @@ -64,3 +64,16 @@ You can also select **Can be empty**. If this checkbox is cleared, calls to the {{% alert color="info" %}} Boolean and list parameters can never be empty. {{% /alert %}} + +## 4 Customising outgoing HTTP response + +It is possible to manipulate response which would be produced as a result of OData Action call. +In order to do that published microflow must take a parameter of [System.HttpResponse](/refguide/http-request-and-response-entities/) type. + +If no changes were made to HttpResponse object then actual response won't be changed as well. + +If only headers of the HttpResponse were changed (for instance a new header was added to the response) then those headers would be merged with default headers, replacing values of the same name. + +If status code OR content of the HttpResponse were changed then actual response would be produced exclusively from HttpResponse parameter, including status code, headers and response body. + +Note. Reason phrase field is ignored. From 8a33ad13a06a757ac09c05b4b7b54695c4d13e34 Mon Sep 17 00:00:00 2001 From: Joost Verhoog Date: Tue, 8 Oct 2024 14:38:43 +0200 Subject: [PATCH 2/5] Rewording --- .../published-odata-entity.md | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md index 94f291847de..9cd66249c84 100644 --- a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md +++ b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md @@ -111,7 +111,7 @@ When the app receives a request to insert a new object, it does the following: This is the behavior when you choose the action **Write to database**. -You can also choose the **Call a microflow** action to use your own logic. Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameters. In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database. +You can also choose the **Call a microflow** action to use your own logic. Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameter. In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database. See [Customizing the Outgoing HTTP Response](#custom-http-response) below for more information. In the publishing app, you can use a validation message action to report a validation error. The client app can include a custom error handler on the [Send External Object](/refguide/send-external-object/) activity to handle the error. If the microflow reports [validation feedback](/refguide/validation-feedback/), the runtime informs the client that the request has failed. For more information, see [Supported OData Operations](/refguide/supported-odata-operations/#updating-objects). @@ -156,9 +156,7 @@ When the app receives a request to change values, it does the following: This is the behavior when you choose the action **Write to database**. -You can also choose the **Call a microflow** action to use your own logic. -Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameters. -In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database. +You can also choose the **Call a microflow** action to use your own logic. Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameter. In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database. See [Customizing the Outgoing HTTP Response](#custom-http-response) below for more information. In the publishing app, you can use a validation message action to report a validation error. The client app can include a custom error handler on the [Send External Object](/refguide/send-external-object/) activity to handle the error. If the microflow reports [validation feedback](/refguide/validation-feedback/), the runtime informs the client that the request has failed. For more information, see [Supported OData Operations](/refguide/supported-odata-operations/#updating-objects). @@ -166,9 +164,7 @@ In the publishing app, you can use a validation message action to report a valid Select the checkbox for **Deletable** to indicate that clients can delete the values of attributes and associations. -Choose whether the object should be deleted from the database directly, or whether to call a microflow. -Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameters. -In the microflow, you can use the [Delete](/refguide/deleting-objects/) activity to delete the object from the database. +Choose whether the object should be deleted from the database directly, or whether to call a microflow. Specify a microflow that takes the entity as a parameter, and optionally a [System.HttpRequest](/refguide/http-request-and-response-entities/) and/or a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameter. In the microflow, you can use the [Delete](/refguide/deleting-objects/) activity to delete the object from the database. See [Customizing the Outgoing HTTP Response](#custom-http-response) below for more information. You can use a validation message to report a validation error if you are performing, for example, a soft delete. If the microflow reports [validation feedback](/refguide/validation-feedback/), the runtime informs the client that the request has failed. @@ -196,15 +192,12 @@ When **Use paging** is set to **Yes**, the number of objects per page can be set Default: **10000** -## 8 Customising outgoing HTTP response (only applicable when **Call a microflow** is selected) +## 8 Customizing the Outgoing HTTP Response {#custom-http-response} -It is possible to manipulate response which would be produced as a result of the request. -In order to do that the microflow must take a parameter of [System.HttpResponse](/refguide/http-request-and-response-entities/) type. +When using **Call a microflow** for any of these capabilities, the selected microflow can take a [System.HttpResponse](/refguide/http-request-and-response-entities/) parameter. -If no changes were made to HttpResponse object then actual response won't be changed as well. +You can use this parameter to affect the HTTP response: -If only headers of the HttpResponse were changed (for instance a new header was added to the response) then those headers would be merged with default headers, replacing values of the same name. - -If status code OR content of the HttpResponse were changed then actual response would be produced exclusively from HttpResponse parameter, including status code, headers and response body. - -Note. Reason phrase field is ignored. +* The microflow can create headers associated to the HttpResponse parameter. These headers will be added to the response, overwriting headers with the same key if those would otherwise have been created. +* The microflow can change the StatusCode and/or the Content attributes of the HttpResponse parameter to completely ignore the default behavior and response with that StatusCode and Content instead. +* Changing the ReasonPhrase attribute has no effect. From 900da7d08084d28fc28162c29e76aff0ed727611 Mon Sep 17 00:00:00 2001 From: Dima Fedorenko Date: Tue, 22 Oct 2024 15:55:13 +0200 Subject: [PATCH 3/5] Include latest changes in behaviour --- .../published-odata-services/published-odata-entity.md | 2 ++ .../published-odata-services/published-odata-microflow.md | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md index 9cd66249c84..0e108707124 100644 --- a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md +++ b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md @@ -201,3 +201,5 @@ You can use this parameter to affect the HTTP response: * The microflow can create headers associated to the HttpResponse parameter. These headers will be added to the response, overwriting headers with the same key if those would otherwise have been created. * The microflow can change the StatusCode and/or the Content attributes of the HttpResponse parameter to completely ignore the default behavior and response with that StatusCode and Content instead. * Changing the ReasonPhrase attribute has no effect. +* It is not possible to change values for `Transfer-Encoding` and `Date` headers +* When StatusCode is set to `204` then empty response body is always produced. diff --git a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md index 209e9b3c5d5..f168455bd6e 100644 --- a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md +++ b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md @@ -77,3 +77,7 @@ If only headers of the HttpResponse were changed (for instance a new header was If status code OR content of the HttpResponse were changed then actual response would be produced exclusively from HttpResponse parameter, including status code, headers and response body. Note. Reason phrase field is ignored. + +It is not possible to change values for `Transfer-Encoding` and `Date` headers + +When StatusCode is set to `204` then empty response body is always produced. From 74c1fbd625602da2867ac72d075949a2bf204e14 Mon Sep 17 00:00:00 2001 From: quinntracy Date: Fri, 25 Oct 2024 13:24:45 +0200 Subject: [PATCH 4/5] Small edits --- .../published-odata-services/published-odata-entity.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md index 0e108707124..82c0c4f5fe7 100644 --- a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md +++ b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md @@ -199,7 +199,7 @@ When using **Call a microflow** for any of these capabilities, the selected micr You can use this parameter to affect the HTTP response: * The microflow can create headers associated to the HttpResponse parameter. These headers will be added to the response, overwriting headers with the same key if those would otherwise have been created. -* The microflow can change the StatusCode and/or the Content attributes of the HttpResponse parameter to completely ignore the default behavior and response with that StatusCode and Content instead. +* The microflow can change the status code and/or Content attributes of the HttpResponse parameter to ignore the default behavior and respond with that status code and Content instead. * Changing the ReasonPhrase attribute has no effect. -* It is not possible to change values for `Transfer-Encoding` and `Date` headers -* When StatusCode is set to `204` then empty response body is always produced. +* It is not possible to change values for `Transfer-Encoding` and `Date` headers. +* When the status code is set to `204`, an empty response body is always produced. From 6c1e5a344d44f73c73f86bb134ed3ecef139139c Mon Sep 17 00:00:00 2001 From: quinntracy Date: Fri, 25 Oct 2024 13:34:45 +0200 Subject: [PATCH 5/5] Edits and formatting --- .../published-odata-microflow.md | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md index f168455bd6e..966b261f7e9 100644 --- a/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md +++ b/content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md @@ -65,19 +65,13 @@ You can also select **Can be empty**. If this checkbox is cleared, calls to the Boolean and list parameters can never be empty. {{% /alert %}} -## 4 Customising outgoing HTTP response +## 4 Customizing the Outgoing HTTP Response -It is possible to manipulate response which would be produced as a result of OData Action call. -In order to do that published microflow must take a parameter of [System.HttpResponse](/refguide/http-request-and-response-entities/) type. +It is possible to manipulate the response, which is produced as a result of an OData Action call. To do this, the published microflow must have a parameter with a [System.HttpResponse](/refguide/http-request-and-response-entities/) type. -If no changes were made to HttpResponse object then actual response won't be changed as well. - -If only headers of the HttpResponse were changed (for instance a new header was added to the response) then those headers would be merged with default headers, replacing values of the same name. - -If status code OR content of the HttpResponse were changed then actual response would be produced exclusively from HttpResponse parameter, including status code, headers and response body. - -Note. Reason phrase field is ignored. - -It is not possible to change values for `Transfer-Encoding` and `Date` headers - -When StatusCode is set to `204` then empty response body is always produced. +* If no changes were made to HttpResponse object, the actual response will not change. +* If only headers of the HttpResponse were changed (for instance, a new header was added to the response), those headers are merged with default headers, which replaces values of the same name. +* If the status code or content of the HttpResponse is changed, the actual response is produced exclusively from the HttpResponse parameter, including status code, headers, and response body. +* The ReasonPhrase field is ignored. +* It is not possible to change values for `Transfer-Encoding` and `Date` headers. +* When the status code is set to `204`, an empty response body is always produced.