In the Past
In previous releases of OSC, if a record needs to update based on custom business logic then we may have to rely on external code that executes the logic and update the records in OSC through web services or update using batch data load. Now with R12 and R13, this approach has changed, we will now be able to schedule business logic code using enterprise scheduler and update records easily.
What is Schedule Business Logic?
An Object function can be called at a scheduled time using enterprise scheduler. This new feature can be used to update a set of records on a daily, weekly basis, asynchronously, in scenarios where the is no need to see the change immediately on the UI. This feature can only be applied to object function.
The object function that needs to be scheduled should have the visibility as Callable by External System. This option enables the object function to be called by any external system in our case it will be called by the Enterprise Scheduler.
The object function can contain a groovy script that solves a complex custom logic. The scripts will act on a smaller manageable set of records in batches by breaking the data into smaller chunks.
The object function that needs to be scheduled should have the visibility as Callable by External System. This option enables the object function to be called by any external system in our case it will be called by the Enterprise Scheduler.
The object function can contain a groovy script that solves a complex custom logic. The scripts will act on a smaller manageable set of records in batches by breaking the data into smaller chunks.
Where Can Scheduling Business Logic be used?
This new feature to schedule business logic comes handy for several scenarios, to name a few;
- Mass update of records based on certain criteria
- Used to trigger workflows based on criteria that will occur / will be met in the future – workaround to time-based workflows
- Custom logic with heavy updates that can be scheduled during off-hours
How to Schedule Business Logic?
Creating Object function:
- Activate a sandbox.
- Navigate to Application Composer and select CRM Cloud as the application.
- Expand Standard Objects.
- Select Opportunity and then Server Scripts to go to the Server Scripts Opportunity page.
- Go to the Object Functions tab.
- Click Add to create an object function.
- Enter the applicable values. Set visibility to Callable by External Systems.
- Click Validate and then Save and Close.
Scheduling the Process:
- Go to the Schedule Processes page.
- Click Schedule New Process.
- Search for the Schedule Custom Groovy Object Functions – Developers Preview job.
- Enter applicable information, keep in mind that the entries in this page are Case-sensitive
- Application Name (required in R12): the name of the application (such as sales, crmCommon, or service).
- The name of the object that is the REST service name of that object.
- To get object name see REST API for Oracle Sales Cloud R13 on Oracle Help Centre.
- The name of the object function you created using Application Composer
- Click Advanced to schedule the process or to run ” As soon as possible”.
Points to consider
- Object function without parameter is only eligible for scheduled invocation.
- The object where the function is defined must have at least one record. Create records if already not created before the execution. If there are no records found during the schedule then the execution will fail and the schedule Process page would show error in the status of the job. For example, there should be opportunity records created before scheduling the Opty_Update job which will update the existing Opportunity records.
- Object function of the child objects cannot be scheduled for invocation.
- Current release R13(Update 18A and 18B) doesn’t support the following object: Account, Contact, and Partners.
- Break the work into multiple object functions if required due to limitations; object function execution time is limited to one minute. Also, the maximum fetch size, which controls the number of rows returned, is set to 500 rows by default. This number can be changed using the method setMaxFetchsize().
- Values returned by the invoked object function are not reported through the ESS framework.