Skip to content

Commit d8663cf

Browse files
authored
Merge pull request #8428 from joostverhoog/integration/microflows
Add docs about customizing http response for OData action and OData from microflow
2 parents 7e9ec77 + 6c1e5a3 commit d8663cf

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-entity.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ When the app receives a request to insert a new object, it does the following:
116116

117117
This is the behavior when you choose the action **Write to database**.
118118

119-
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.
119+
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.
120120

121121
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).
122122

@@ -161,15 +161,15 @@ When the app receives a request to change values, it does the following:
161161

162162
This is the behavior when you choose the action **Write to database**.
163163

164-
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.
164+
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.
165165

166166
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).
167167

168168
### Deletable {#deletable}
169169

170170
Select the checkbox for **Deletable** to indicate that clients can delete the values of attributes and associations.
171171

172-
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.
172+
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.
173173

174174
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.
175175

@@ -202,3 +202,15 @@ Setting **Use paging** to **Yes** may result in inconsistency in the retrieved d
202202
When **Use paging** is set to **Yes**, the number of objects per page can be set in **Page size**.
203203

204204
Default: **10000**
205+
206+
## 8 Customizing the Outgoing HTTP Response {#custom-http-response}
207+
208+
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.
209+
210+
You can use this parameter to affect the HTTP response:
211+
212+
* 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.
213+
* 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.
214+
* Changing the ReasonPhrase attribute has no effect.
215+
* It is not possible to change values for `Transfer-Encoding` and `Date` headers.
216+
* When the status code is set to `204`, an empty response body is always produced.

content/en/docs/refguide/modeling/integration/odata-services/published-odata-services/published-odata-microflow.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,14 @@ You can also select **Can be empty**. If this checkbox is cleared, calls to the
7373
{{% alert color="info" %}}
7474
Boolean and list parameters can never be empty.
7575
{{% /alert %}}
76+
77+
## 4 Customizing the Outgoing HTTP Response
78+
79+
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.
80+
81+
* If no changes were made to HttpResponse object, the actual response will not change.
82+
* 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.
83+
* 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.
84+
* The ReasonPhrase field is ignored.
85+
* It is not possible to change values for `Transfer-Encoding` and `Date` headers.
86+
* When the status code is set to `204`, an empty response body is always produced.

0 commit comments

Comments
 (0)