Skip to content

Commit f32be69

Browse files
author
Dima Fedorenko
committed
Add docs about customizing http response for OData action and OData from a micforlow
1 parent 99c69ba commit f32be69

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

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

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

112112
This is the behavior when you choose the action **Write to database**.
113113

114-
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.
114+
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.
115115

116116
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).
117117

@@ -156,15 +156,19 @@ When the app receives a request to change values, it does the following:
156156

157157
This is the behavior when you choose the action **Write to database**.
158158

159-
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.
159+
You can also choose the **Call a microflow** action to use your own logic.
160+
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.
161+
In the microflow, you can use the [Commit](/refguide/committing-objects/) activity to commit the changes to the database.
160162

161163
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).
162164

163165
### 6.4 Deletable {#deletable}
164166

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

167-
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.
169+
Choose whether the object should be deleted from the database directly, or whether to call a microflow.
170+
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.
171+
In the microflow, you can use the [Delete](/refguide/deleting-objects/) activity to delete the object from the database.
168172

169173
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.
170174

@@ -191,3 +195,16 @@ Setting **Use paging** to **Yes** may result in inconsistency in the retrieved d
191195
When **Use paging** is set to **Yes**, the number of objects per page can be set in **Page size**.
192196

193197
Default: **10000**
198+
199+
## 8 Customising outgoing HTTP response (only applicable when **Call a microflow** is selected)
200+
201+
It is possible to manipulate response which would be produced as a result of the request.
202+
In order to do that the microflow must take a parameter of [System.HttpResponse](/refguide/http-request-and-response-entities/) type.
203+
204+
If no changes were made to HttpResponse object then actual response won't be changed as well.
205+
206+
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.
207+
208+
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.
209+
210+
Note. Reason phrase field is ignored.

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,16 @@ You can also select **Can be empty**. If this checkbox is cleared, calls to the
6464
{{% alert color="info" %}}
6565
Boolean and list parameters can never be empty.
6666
{{% /alert %}}
67+
68+
## 4 Customising outgoing HTTP response
69+
70+
It is possible to manipulate response which would be produced as a result of OData Action call.
71+
In order to do that published microflow must take a parameter of [System.HttpResponse](/refguide/http-request-and-response-entities/) type.
72+
73+
If no changes were made to HttpResponse object then actual response won't be changed as well.
74+
75+
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.
76+
77+
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.
78+
79+
Note. Reason phrase field is ignored.

0 commit comments

Comments
 (0)