Discoverable Procedures

Discoverable procedures in the Oracle Fusion (BDK) Book.

Overview

In Oracle Cloud Fusion, a resource is any object or record type that stores business data, such as an invoice, purchase order, supplier, or customer. Resources define how information is structured, including the fields, relationships, and operations available for that data.

Discovery scans your connected Oracle Cloud Fusion instance to identify these resources, their fields, and the actions they support. Each discovery generates three groups of automation procedures for a given resource:

  1. Basic Operations: Create, Retrieve, Update, and Delete records

  2. Child Operations: Retrieve and Create child records for a resource

  3. Actions: Execute complex actions on specific records

Discovery

Use the following syntax to discover resources from your Oracle Cloud Fusion instance and generate automation procedures. Replace RESOURCE with the resource type to be discovered:

discover "RESOURCE" from oracle fusion

Oracle Cloud Fusion Resources

Common Oracle Cloud Fusion resources include:

  • Financial: invoices, purchaseOrders, receipts, payments

  • Procurement: suppliers, supplierSites, requisitions

  • Projects: projects, projectTasks, projectExpenses

  • Inventory: items, itemRevisions, itemCategories

  • HCM: employees, workers, departments

Resource Names

Oracle Cloud Fusion resource names typically use camelCase:

  • invoices (lowercase for simple resources)

  • purchaseOrders (camelCase for compound names)

Examples

discover "invoices" from oracle fusion
discover "suppliers" from oracle fusion
discover "employees" from oracle fusion

Basic Operation Procedures

After discovery, you can use the four basic operation procedures for that resource:

1. Retrieve Records

Get a list of records from the discovered resource.

retrieve some [RESOURCE] records from oracle fusion

Parameters

Parameter
Description
Required?

the limit is [NUMBER]

Maximum number of records to retrieve

Optional

the offset is [NUMBER]

Number of records to skip for pagination

Optional

whose [FIELD] is [VALUE]

Filter records by specific criteria.

Note: Use the "is" operator for exact matching.

Optional

Examples

# Get all records
retrieve some purchaseOrders records from oracle fusion

# Get first 10 records
retrieve some purchaseOrders records from oracle fusion
  the limit is 10

# Get records with pagination
retrieve some purchaseOrders records from oracle fusion
  the limit is 10
  the offset is 20
  
# Get records with filter
retrieve some invoices records from oracle fusion whose InvoiceNumber is "12345678"
  the limit is 10

Returns: A list of records from the Oracle Cloud Fusion resource.


2. Create Record

Create a new record in the discovered resource.

create a [RESOURCE] record in oracle fusion

Parameters

Parameter
Description
Required?

the body is [DATA]

The data for the new record

Yes

Example

# First, create the data structure
create a json
use the above as the invoice body
the invoice body's "InvoiceNumber" is "12345678"
the invoice body's "InvoiceCurrency" is "USD"
the invoice body's "InvoiceAmount" is "7000"
the invoice body's "InvoiceDate" is "2025-02-20"
...

# Then create the record
create an invoices record in oracle fusion where
  the body is the invoice body

Returns: The newly created record with all fields populated, including system-generated values.

Important Notes

  • Only required and create-able fields need to be provided

  • Oracle Cloud Fusion will generate system fields like ID, creation date, etc.


3. Update Record

Update an existing record in the discovered resource.

update a [RESOURCE] record in oracle fusion

Parameters

Parameter
Description
Required?

the record is [DATA]

The record with updated data (must include primary key)

Yes

Example

# Get a record
retrieve some invoices records from oracle fusion whose InvoiceNumber is "12345678"
use the above as the invoice

# Update the record
set the invoice's "InvoiceAmount" to "8000"

update an invoices record in oracle fusion
  the record is the invoice

Returns: The updated record with current values.

Important Notes:

  • The record data must include a primary key field to identify which record to update

  • Primary key fields vary by resource (e.g., InvoiceId for invoices, PurchaseOrderId for purchase orders)


4. Delete Record

Delete an existing record from the discovered resource.

delete a [RESOURCE] record in oracle fusion

Parameters

Parameter
Description
Required?

the record is [DATA]

The record to delete (must include primary key)

Yes

Example

# Get a record
retrieve some invoices records from oracle fusion whose InvoiceNumber is "12345678"
use the above as the invoice

# Delete the record
delete an invoices record in oracle fusion
  the record is the invoice

Important Notes:

  • The record data must include a primary key field to identify which record to delete

  • Primary key fields vary by resource (e.g., InvoiceId for invoices, PurchaseOrderId for purchase orders)


Child Operation Procedures

Resources can have child resources. For instance, records from the invoices resource have a list of InvoiceLines as children. Discovering a resource also enables procedures for working with its children.

1. Retrieve Child Records

Retrieve existing child records from a resource record.

retrieve some [RESOURCE RECORD]'s [CHILD_NAME] records from oracle fusion

Parameters

Parameter
Description
Required?

the limit is [NUMBER]

Maximum number of records to retrieve

Optional

the offset is [NUMBER]

Number of records to skip for pagination

Optional

whose [FIELD] is [VALUE]

Filter records by specific criteria

Optional

Examples

# Get a parent record
retrieve some invoices records from oracle fusion whose InvoiceNumber is "12345678"
use the above as the invoice

# Get all child records
retrieve the invoice's InvoiceLines records from oracle fusion

# Get first 10 child records
retrieve the invoice's InvoiceLines records from oracle fusion
  the limit is 10

# Get child records with pagination
retrieve the invoice's InvoiceLines records from oracle fusion
  the limit is 10
  the offset is 20

# Get child records with filter
retrieve the invoice's InvoiceLines record from oracle fusion whose "LineNumber" is 2

Returns: A list of child records for the specified resource record.


2. Create Child Record

Create a new child record for a resource record.

create a [RESOURCE RECORD]'s [CHILD_NAME] record in oracle fusion

Parameters

Parameter
Description
Required?

the body is [DATA]

The data for the new child record

Yes

Example

# Get a parent record
retrieve some invoices records from oracle fusion whose InvoiceNumber is "12345678"
use the above as the invoice

# Create the data structure
create a json
use the above as the line body
the line body's "LineNumber" is 5
the line body's "AccountingDate" is "2025-08-29"
the line body's "LineAmount" is 8001
the line body's "Description" is "Test from discover"

# Then create the child record
create the invoice's InvoiceLines record in oracle fusion
  the body is the line body

Returns: The newly created child record with all fields populated, including system-generated values.


Action Procedures

Some resources support executing complex actions on their records. Discovering a resource will also allow the usage of procedures that execute these actions.

Execute Action

Execute a specific action on a resource record.

execute a [ACTION_NAME] action for the [RESOURCE RECORD]

Parameters

Parameter
Description
Required?

the body is [DATA]

The data required for the action

Optional*

*Some actions require a body with specific fields, while others do not.

Example

# Get a record
retrieve some invoices records from oracle fusion whose InvoiceNumber is "12345678"
use the above as the invoice

# Create the action data structure
the string is '{"ProcessAction": "Validate"}'
get the string as json
use the above as the validation body

# Execute the action
execute a validateInvoice action for the invoice
  the body is the validation body

Returns: The result of the action execution.

Important Notes:

  • Different resources have different actions that can be executed

  • Check the procedures returned when discovering a resource to see available actions

  • Some actions require specific data to be passed in the body

  • Required body fields vary from action to action


Complete Workflow Examples

1. Working with Invoices

This example demonstrates discovering invoices, creating, retrieving, updating, and working with invoice lines:

# 1. Discover the invoices resource
discover "invoices" from oracle fusion

# 2. Create a new invoice
create a json
use the above as the invoice body
the invoice body's "InvoiceNumber" is "INV-2025-001"
the invoice body's "InvoiceCurrency" is "USD"
the invoice body's "InvoiceAmount" is "7000"
the invoice body's "InvoiceDate" is "2025-02-20"
the invoice body's "BusinessUnit" is "US Business Unit"

create an invoices record in oracle fusion where
  the body is the invoice body
use the above as the created invoice

# 3. Retrieve invoices with filter
retrieve some invoices records from oracle fusion whose InvoiceNumber is "INV-2025-001"
  the limit is 10

# 4. Update the invoice
set the created invoice's "InvoiceAmount" to "8000"
update an invoices record in oracle fusion
  the record is the created invoice

# 5. Add invoice lines (child records)
create a json
use the above as the line body
the line body's "LineNumber" is 1
the line body's "AccountingDate" is "2025-02-20"
the line body's "LineAmount" is 4000
the line body's "Description" is "Professional Services"

create the created invoice's InvoiceLines record in oracle fusion where
  the body is the line body

# 6. Retrieve invoice lines
retrieve the created invoice's InvoiceLines records from oracle fusion
  the limit is 10

# 7. Execute an action (validate invoice)
the string is '{"ProcessAction": "Validate"}'
get the string as json
use the above as the validation body

execute a validateInvoice action for the created invoice
  the body is the validation body

2. Working with Purchase Orders

This example shows how to work with purchase orders and their lines:

# 1. Discover the purchase orders resource
discover "purchaseOrders" from oracle fusion

# 2. Retrieve purchase orders with pagination
retrieve some purchaseOrders records from oracle fusion
  the limit is 20
  the offset is 0

# 3. Filter by specific criteria
retrieve some purchaseOrders records from oracle fusion whose Status is "APPROVED"
  the limit is 10
use the first record as the purchase order

# 4. Retrieve purchase order lines
retrieve the purchase order's PurchaseOrderLines records from oracle fusion

# 5. Create a new purchase order line
create a json
use the above as the po line body
the po line body's "LineNumber" is 10
the po line body's "ItemDescription" is "Office Supplies"
the po line body's "Quantity" is 100
the po line body's "UnitPrice" is 25.50

create the purchase order's PurchaseOrderLines record in oracle fusion where
  the body is the po line body

3. Managing Suppliers

This example demonstrates working with suppliers:

# 1. Discover the suppliers resource
discover "suppliers" from oracle fusion

# 2. Create a new supplier
create a json
use the above as the supplier body
the supplier body's "SupplierName" is "ACME Corporation"
the supplier body's "TaxpayerId" is "12-3456789"
the supplier body's "SupplierType" is "VENDOR"

create a suppliers record in oracle fusion where
  the body is the supplier body
use the above as the new supplier

# 3. Retrieve suppliers by name
retrieve some suppliers records from oracle fusion whose SupplierName is "ACME Corporation"

# 4. Update supplier information
set the new supplier's "SupplierType" to "PREFERRED_VENDOR"
update a suppliers record in oracle fusion
  the record is the new supplier

Understanding Procedure Groups

Oracle Cloud Fusion discovered resources have three procedure groups:

Procedure Group
Operations
Purpose
Use Case

Basic Operations

Create, Retrieve, Update, Delete

Standard CRUD operations on resource records

Managing main resource records like invoices, orders, suppliers

Child Operations

Retrieve, Create

Work with nested/related records within a parent resource

Managing invoice lines, order lines, and other child entities

Actions

Execute

Perform complex business operations

Validating invoices, approving orders, processing payments

Typical Workflow

  1. Discover the resource to generate all procedures

  2. Use Basic Operations to manage parent records

  3. Use Child Operations to manage related child records

  4. Use Actions to execute business processes on records

Best Practices

  • Always set appropriate limits when retrieving large datasets

  • Include primary key fields when updating or deleting records

  • Check available actions after discovery to understand resource capabilities

  • Use filtering to retrieve specific records efficiently

  • Handle pagination properly for large result sets

Last updated

Was this helpful?