8 Custom Actions
Workbooks that integrate with Oracle business object REST API services can allow the user to perform custom actions on rows of data. For example, an invoice business object might support a custom action called "approve". Users could download many invoices and approve many of them in a single upload.
Use Custom Actions
When your REST API exposes a custom action, let’s see how you can invoke the custom action in your Excel workbook, for example, a custom action called "Close" that's exposed by a purchase order business object to close purchase orders.
Note:
Your REST API must expose custom actions on the item path for your resource, something like a POST to/contextRoot/v1/myBusObj/{itemId}/action/doMyAction
. Actions defined on the collection path are not supported. For other limitations, see Limitations, Known Issues, and Other Notes.
Use Custom Actions in a Form Row of a Form-over-Table Layout
When the REST service in your workbook exposes custom actions, you can perform those actions on a Form row in a Form-over-Table layout.
Edit Custom Actions
Custom actions exposed by the service that your workbook uses can be viewed and edited in the Custom Actions tab of the Business Object Editor.
Properties such as Title (which appears in the UI that the workbook user sees) and Description can be edited as needed. Other properties of the custom action should generally be left as is. Payload fields can be edited by clicking the Edit button or double-clicking an entry in the list.

Description of the illustration excel-custaction.png
Service Description for Custom Actions
If a given REST API supports custom actions, they are described in the OpenAPI v3 service description document generated by the Oracle business object REST API service. For example, a close
custom action would appear in the paths
collection:
// Note: some JSON content has been omitted for brevity/clarity
"/purchaseOrders/{purchaseOrders_Id}/action/close": {
"parameters": [
{
"$ref": "#/components/parameters/purchaseOrders_Id"
}
],
"post": {
"summary": "close",
"description": "close",
"operationId": "do_close_purchaseOrders",
"responses": {
"default": {
"description": "The following table describes the default response for this task.",
"content": {
"application/vnd.oracle.adf.actionresult+json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "string"
}
},
"required": [
"result"
],
"additionalProperties": false
}
}
}
}
},
"requestBody": {
"description": "The following table describes the body parameters in the request for this task.",
"content": {
"application/vnd.oracle.adf.action+json": {
"schema": {
"type": "object",
"properties": {
"closeAction": {
"type": "string",
"nullable": true
},
"closeReason": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
}
}
}
}
}
}
- The path entry contains a path parameter for the row/item ID, for example,
/purchaseOrders/{purchaseOrders_Id}/action/close"
- The end of the path entry (
close
) matches the name of the custom method defined in the service (see Publishing Custom Service Methods to UI Clients) - The presence of a POST operation for the action path entry is required
- In the
requestBody
schema, there are properties that match the parameters defined in the custom method signature from the service. In this document, these properties are referred to as custom action payload fields.
Limitations, Known Issues, and Other Notes
Custom actions that correspond to view object methods (as opposed to view object row methods) are not currently supported.
Custom actions are not supported for pending Create rows or form in Create mode.
Custom actions defined in the OpenAPI 3 service description document that have request payload schema members that match business object fields are unlikely to function properly.
When an Upload operation contains one or more custom action invocations, the entire operation will be performed on a row-by-row basis (one PATCH/POST/DELETE
request made for each of the participating rows). For best performance of bulk Updates, Creates, and Deletes, avoid mixing custom action invocations into those bulk operations.
Oracle business object REST API service OpenAPI 3 service descriptions do not indicate which custom action request payload fields are required. You can use the Business Object Editor to adjust the Required property on payload fields.