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..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 @@ -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/) 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,7 +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/) 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/) 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). @@ -164,7 +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/) 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/) 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. @@ -191,3 +191,15 @@ 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 Customizing the Outgoing HTTP Response {#custom-http-response} + +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. + +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 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 the status code is set to `204`, an 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 5e460e616e9..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 @@ -64,3 +64,14 @@ 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 Customizing the Outgoing HTTP Response + +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, 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.