Exploring Oracle Cloud ESS Job REST API

Oracle Fusion Cloud ESS Job REST API

Enterprise Scheduler Service (ESS) is a feature in Oracle Fusion Cloud Applications that allows to run or schedule critical, complex or time-consuming tasks and reports. We can run the scheduled jobs on ad hoc basis or on a future date and time. We can schedule the tasks or reports and send notifications on completion of the task.

Oracle REST APIs for managing ESS jobs in Fusion Cloud Applications was introduced in Version 23B. Using this REST API we can automate, orchestrate and integrate ESS jobs using Oracle Integration Cloud service or any third-party integration tools.

Using the scheduler REST API we can perform ESS tasks like submitting a new job request, query existing job requests, schedule new job request, cancel or hold requests also we can register a call back URL to trigger another task on completion of current request.

Base path of ESS Job REST API is /ess/rest/scheduler/v1/requests/.The path should be appended to the oracle cloud applications host name  as mentioned below https://serverhostname.fa.ocs.oraclecloud.com/ess/rest/scheduler/v1/requests/

Some of the basic operations are as mentioned below:

GET :

1.        List all the resources of the REST API – Path: ess/rest/scheduler/v1

2.        Query job requests in a range – Path: ess/rest/scheduler/v1/query/{application}/requests

3.        Query all job requests – Path: ess/rest/scheduler/v1/requests

4.        Query all job requests with Page index – Path: ess/rest/scheduler/v1/requests/search/{pageIndex}

5.        Get specific request information – Path: ess/rest/scheduler/v1/requests/{requestId}

e.g

ess/rest/scheduler/v1/requests/?q=state eq “RUNNING”

ess/rest/scheduler/v1/requests/{requestId}?fields=@full

ess/rest/scheduler/v1/requests/{requestId}?fields=@basic

6.        Get permission details of  a request – Path: ess/rest/scheduler/v1/requests/{requestId}/permissions

PATCH :

1.        To update the specific scheduler request – Path: ess/rest/scheduler/v1/requests/{requestId}

Using this method we can update request parameters, schedule information and callback URL also

POST :

1.        To submit a new job request – Path: ess/rest/scheduler/v1/requests

2.        To cancel any ongoing request – Path: ess/rest/scheduler/v1/requests/{requestId}/cancel

3.        To validate cancelling state of request – Path: ess/rest/scheduler/v1/requests/{requestId}/checkInCancelling

4.        To change the status of request execution – Path: ess/rest/scheduler/v1/requests/{requestId}/executionStatus

5.        To cancel a running request – Path: ess/rest/scheduler/v1/requests/{requestId}/forceCancel

6.        To hold a running request – Path: ess/rest/scheduler/v1/requests/{requestId}/hold

7.        To release request – Path: ess/rest/scheduler/v1/requests/{requestId}/release

8.        To register a callback URL – Path: ess/rest/scheduler/v1/requests/{requestId}/subscribe

DELETE :

1.        To update a running request as deleted – Path: ess/rest/scheduler/v1/requests/{requestId}

If parent request is marked as deleted then child requests too will be automatically marked as deleted and the requests will not be available to be viewed in the scheduler UI.

2.        To cancel callback subscription – Path: ess/rest/scheduler/v1/requests/{requestId}/subscribe

References :  https://docs.oracle.com/en/cloud/saas/applications-common/24c/farca/api-scheduler.html

Use Cases :

1.        Method to get all the requests of the instance

Method : GET

URL : https://server.fa.ocs.oraclecloud.com/ess/rest/scheduler/v1/requests

Authentication : Basic

Response :

{

“count”: 200,

“items”: [

{

“requestId”: 8630160,

“state”: “SUCCEEDED”,

“stateDescription”: “Succeeded”

},

{

“requestId”: 8630162,

“state”: “WAIT”,

“stateDescription”: “Wait”

},

….

….

],

“links”: [

{

“href”: “https://server.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests”,

“rel”: “SELF”

}

],

“pageIndex”: 1

}

2.        Method to get all details of a request

Method : GET

URL : https://server.fa.ocs.oraclecloud.com/ess/rest/scheduler/v1/requests/8630160/?fields=@full

Authentication :  Basic

Response :

{

“absParentRequestId”: 8630160,

“application”: “CrmEss”,

“cause”: “PROCESS_SUCCESS”,

“causeDescription”: “Request execution was successful”,

“completedTime”: “2024-06-30T10:24:07.723Z”,

“deployedApplicationName”: “ORA_CRM_ESSAPP”,

“description”: “Publish Active Predefined Rules”,

“dispatcher”: “ESS_SOAServer_1”,

“dmsRID”: “0:566:1”,

“ecid”: “e2d877fd-b9cc-4177-906a-aed16ce50f75-00000971”,

“elapsedTime”: 381300,

“enterpriseId”: 1,

“executableState”: “SUCCEEDED”,

“executionAttempt”: 1,

“executionMode”: “NONE”,

“executionType”: “JAVA_TYPE”,

“flowId”: “0000P1cd^vU66UqLsM4EyX1aWJ1z00000w”,

“instanceParentExecAttempt”: 1,

“instanceParentId”: 8630160,

“isAsyncRecoverable”: false,

“isAsynchronous”: true,

“isCancellable”: false,

“isHoldable”: false,

“isRecoverable”: false,

“isTimedOut”: false,

“jobDefinitionId”: “JobDefinition://oracle/apps/ess/crmCommon/workMgmt/assignmentMgr/CacheRefresher”,

“jobDescription”: “Publishes assignment rules and objects, synchronizes configuration, and refreshes the candidate information used in assignment.”,

“jobDisplayName”: “Perform Assignment Data Publish, Refresh, and Synchronization”,

“jobType”: “JobType://oracle/as/ess/ext/JavaJobType”,

“lastScheduleInstanceId”: 0,

“lastSubRequestSet”: 0,

“parentExecAttempt”: 0,

“pausedCount”: 0,

“postProcessStatus”: “PROCEED”,

“preprocessStatus”: “PROCEED”,

“previousState”: “COMPLETED”,

“priority”: 4,

“processEndTime”: “2024-06-30T10:24:04.242Z”,

“processGroup”: “FADomain##ESS_SOACluster”,

“processPhase”: “Complete”,

“processPhaseDescription”: “Complete”,

“processStartTime”: “2024-06-30T10:17:42.942Z”,

“processor”: “ESS_SOAServer_1”,

“product”: “MOW”,

“requestId”: 8630160,

“requestMode”: “Fusion”,

“requestParameters”: [

{

“name”: “jobExecutesVirusScanOnOutputFiles”,

“paramType”: “BOOLEAN”,

“value”: “false”

},

{

“name”: “essAppName”,

“paramType”: “STRING”,

“value”: “ORA_CRM_ESSAPP”

},

{

“name”: “aflogLevel”,

“paramType”: “STRING”,

“value”: “N”

},

{

“name”: “EXT_PortletContainerWebModule”,

“paramType”: “STRING”,

“value”: “ORA_CRM_UI”

},

{

“name”: “jobDisplayName”,

“paramType”: “STRING”,

“value”: “Perform Assignment Data Publish, Refresh, and Synchronization”

},

{

“name”: “TENANT_UUID”,

“paramType”: “STRING”,

“value”: “00000000-0000-0000-0000-000000000000”

},

{

“name”: “parametersVO”,

“paramType”: “STRING”,

“value”: “oracle.apps.crmCommon.workMgmt.assignmentMgr.publicEssModel.view.CacheRefresherVO”

},

{

“name”: “publishFlag”,

“paramType”: “BOOLEAN”,

“value”: “false”

},

{

“name”: “jobPackageName”,

“paramType”: “STRING”,

“value”: “/oracle/apps/ess/crmCommon/workMgmt/assignmentMgr”

},

{

“name”: “oracle.apps.fnd.applcp.invokeIncrementProcIfPresent”,

“paramType”: “BOOLEAN”,

“value”: “true”

},

{

“name”: “jobExecutesVirusScanOnLogFiles”,

“paramType”: “BOOLEAN”,

“value”: “false”

},

{

“name”: “cpAsynchJobWrapper”,

“paramType”: “STRING”,

“value”: “oracle.apps.fnd.applcp.request.exec.AsyncExecutableWrapper”

},

{

“name”: “logLevel”,

“paramType”: “STRING”,

“value”: “1”

},

{

“name”: “cpSqlFileFlag”,

“paramType”: “STRING”,

“value”: “F”

},

{

“name”: “submit.argument5”,

“paramType”: “STRING”,

“value”: “false”

},

{

“name”: “filePersistenceMode”,

“paramType”: “STRING”,

“value”: “content”

},

{

“name”: “submit.argument4”,

“paramType”: “STRING”,

“value”: “true”

},

{

“name”: “submit.argument3”,

“paramType”: “STRING”,

“value”: “MOW”

},

{

“name”: “submit.argument2”,

“paramType”: “STRING”,

“value”: “PREDEFINED_RULE_PUBLISH”

},

{

“name”: “srsFlag”,

“paramType”: “STRING”,

“value”: “Y”

},

{

“name”: “candidateObjectCode”

},

{

“name”: “jobDefinitionName”,

“paramType”: “STRING”,

“value”: “CacheRefresher”

},

{

“name”: “jobDesc”,

“paramType”: “STRING”,

“value”: “Publishes assignment rules and objects, synchronizes configuration, and refreshes the candidate information used in assignment.”

},

{

“name”: “parentRequest”,

“paramType”: “STRING”,

“value”: “0”

},

{

“name”: “completionText”

},

{

“name”: “productCode”

},

{

“name”: “jobDefinitionApplication”,

“paramType”: “STRING”,

“value”: “MOW”

},

{

“name”: “requestStepPath”

},

{

“name”: “TENANT_NAME”,

“paramType”: “STRING”,

“value”: “GLOBAL”

},

{

“name”: “cpJavaJobWrapper”,

“paramType”: “STRING”,

“value”: “oracle.apps.fnd.applcp.request.exec.ExecutableWrapper”

},

{

“name”: “ownerModule”

},

{

“name”: “shadowClassName”,

“paramType”: “STRING”,

“value”: “oracle.apps.crmCommon.workMgmt.assignmentMgr.ess.program.CacheRefresher”

}

],

“requestType”: “SINGLETON”,

“requestedStartTime”: “2024-06-30T10:17:13.047Z”,

“retriedCount”: 0,

“runAsUser”: “FUSION_APPS_CRM_ESS_APPID”,

“scheduledTime”: “2024-06-30T10:17:13.047Z”,

“state”: “SUCCEEDED”,

“stateChangeTime”: “2024-06-30T10:24:04.242Z”,

“stateDescription”: “Succeeded”,

“stepId”: “0”,

“subRequestSet”: 0,

“submissionTime”: “2024-06-30T10:17:13.047Z”,

“submitter”: “FUSION_APPS_CRM_ESS_APPID”,

“submitterDmsECID”: “e2d877fd-b9cc-4177-906a-aed16ce50f75-00000971”,

“submitterDmsRID”: “0”,

“submitterGUID”: “C74BC0A0CC03D92FE050F90A79B05A17”

}

3.        Method to get basic details of a request

Method :  GET

URL : https://server.fa.ocs.oraclecloud.com/ess/rest/scheduler/v1/requests/8630160/?fields=@basic

Response :

{

“absParentRequestId”: 8630160,

“application”: “CrmEss”,

“cause”: “PROCESS_SUCCESS”,

“causeDescription”: “Request execution was successful”,

“deployedApplicationName”: “ORA_CRM_ESSAPP”,

“description”: “Publish Active Predefined Rules”,

“executionType”: “JAVA_TYPE”,

“instanceParentId”: 8630160,

“isAsynchronous”: true,

“jobDefinitionId”: “JobDefinition://oracle/apps/ess/crmCommon/workMgmt/assignmentMgr/CacheRefresher”,

“jobType”: “JobType://oracle/as/ess/ext/JavaJobType”,

“priority”: 4,

“processGroup”: “FADomain##ESS_SOACluster”,

“processPhase”: “Complete”,

“processPhaseDescription”: “Complete”,

“product”: “MOW”,

“requestId”: 8630160,

“requestType”: “SINGLETON”,

“state”: “SUCCEEDED”,

“stateDescription”: “Succeeded”,

“stepId”: “0”

}

4.        Submit a simple request

Method : POST

URL http://servername.fa.us2.oraclecloud.com/ess/rest/scheduler/ess/rest/scheduler/v1/requests

Sample Payload :

{

“description”: “Identifies customer contracts”,

“jobDefinitionId”: “JobDefinition://oracle/apps/ess/financials/revenueManagement/contractObligation/IdentifyContractObligation”,

“application”: “FscmEss”,

“requestParameters”:

[{

“name”: “submit.argument1”,

“paramType”: “STRING”,

“value”: “300000003474495”

},

{

“name”: “submit.argument2”,

“paramType”: “STRING”,

“value”: “D”

},

{

“name”: “submit.argument3”,

“paramType”: “STRING”,

“value”: “2024-03-20”

},

{

“name”: “submit.argument4”,

“paramType”: “STRING”,

“value”: “S”

},

{

“name”: “submit.argument5”,

“paramType”: “STRING”,

“value”: “N”

},

{

“name”: “submit.argument6”,

“paramType”: “STRING”,

“value”: “N”

},

{

“name”: “submit.argument7”,

“paramType”: “STRING”,

“value”: “Y”

},

{

“name”: “submit.argument8”,

“paramType”: “STRING”,

“value”: “Y”

},

{

“name”: “submit.argument9”,

“paramType”: “STRING”,

“value”: “”

}

]

}

Response :

{

“id”: 8748368,

“links”: [

{

“href”: “https://servername.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/8748368”,

“rel”: “SELF”

},

{

“href”: “https://servername.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/8748368/cancel”,

“rel”: “CANCEL”

},

{

“href”: “https://servername.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/8748368/hold”,

“rel”: “HOLD”

},

{

“href”: “https://servername.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/8748368/release”,

“rel”: “RELEASE”

},

{

“href”: “https://servername.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/”,

“rel”: “PARENTREQUEST”

}

]

}

5.        Submit a Scheduled Request

Method : POST

URL : https://servername.fa.ocs.oraclecloud.com/ess/rest/scheduler/v1/requests/

Sample Payload:

{

“description”: “Identifies customer contracts”,

“jobDefinitionId”: “JobDefinition://oracle/apps/ess/financials/revenueManagement/contractObligation/IdentifyContractObligation”,

“application”: “FscmEss”,

“requestParameters”:

[{

“name”: “submit.argument1”,

“paramType”: “STRING”,

“value”: “300000003474495”

},

{

“name”: “submit.argument2”,

“paramType”: “STRING”,

“value”: “D”

},

{

“name”: “submit.argument3”,

“paramType”: “STRING”,

“value”: “2024-03-20”

},

{

“name”: “submit.argument4”,

“paramType”: “STRING”,

“value”: “S”

},

{

“name”: “submit.argument5”,

“paramType”: “STRING”,

“value”: “N”

},

{

“name”: “submit.argument6”,

“paramType”: “STRING”,

“value”: “N”

},

{

“name”: “submit.argument7”,

“paramType”: “STRING”,

“value”: “Y”

},

{

“name”: “submit.argument8”,

“paramType”: “STRING”,

“value”: “Y”

},

{

“name”: “submit.argument9”,

“paramType”: “STRING”,

“value”: “”

}

],

“schedule”: {

“recurrences”: [

{

“icalString”: “FREQ=MINUTELY;INTERVAL=15;”

}

]

}

}

 

Response:

{

“id”: 8748575,

“links”: [

{

“href”: “https://fa-eply-dev10-saasfaprod1.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/8748575”,

“rel”: “SELF”

},

{

“href”: “https://fa-eply-dev10-saasfaprod1.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/8748575/cancel”,

“rel”: “CANCEL”

},

{

“href”: “https://fa-eply-dev10-saasfaprod1.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/8748575/hold”,

“rel”: “HOLD”

},

{

“href”: “https://fa-eply-dev10-saasfaprod1.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/8748575/release”,

“rel”: “RELEASE”

},

{

“href”: “https://fa-eply-dev10-saasfaprod1.fa.ocs.oraclecloud.com:443/ess/rest/scheduler/v1/requests/”,

“rel”: “PARENTREQUEST”

}

]

}

6.        Submit a Scheduled Request with Callback Service.

Method : POST

URL : https://servername.fa.ocs.oraclecloud.com/ess/rest/scheduler/v1/requests/

Sample Payload :

{

“description”: “Identifies customer contracts”,

“jobDefinitionId”: “JobDefinition://oracle/apps/ess/financials/revenueManagement/contractObligation/IdentifyContractObligation”,

“application”: “FscmEss”,

“requestParameters”:

[{

“name”: “submit.argument1”,

“paramType”: “STRING”,

“value”: “300000003474495”

},

{

“name”: “submit.argument2”,

“paramType”: “STRING”,

“value”: “D”

},

{

“name”: “submit.argument3”,

“paramType”: “STRING”,

“value”: “2024-03-20”

},

{

“name”: “submit.argument4”,

“paramType”: “STRING”,

“value”: “S”

},

{

“name”: “submit.argument5”,

“paramType”: “STRING”,

“value”: “N”

},

{

“name”: “submit.argument6”,

“paramType”: “STRING”,

“value”: “N”

},

{

“name”: “submit.argument7”,

“paramType”: “STRING”,

“value”: “Y”

},

{

“name”: “submit.argument8”,

“paramType”: “STRING”,

“value”: “Y”

},

{

“name”: “submit.argument9”,

“paramType”: “STRING”,

“value”: “”

}

],

“callbackSubscription”:

{

“callbackUrlPrefix”: “https://oicservername.integration.ocp.oraclecloud.com”,

“callbackResourcePath”: “/ic/ws/integration/v1/flows/erp/SAMPLEINTEGRATION/1.0/”

},

“schedule”: {

“recurrences”: [

{

“icalString”: “FREQ=MINUTELY;INTERVAL=15;”

}

]

}

}

Summary :

Oracle Fusion Cloud ESS Job REST API gives multiple options to schedule an ESS job, submit adhoc jobs. It can be triggered from OIC Server, VBCS Applications and other third party applications with ease.

Author Details

Saravanan Kanagasabapathy

Oracle Cloud Certified ERP Technical Consultant with experience in implementing, integrating, customizing, supporting and extending the features of Oracle E-business Suite (Applications) 11i & R12, Oracle Financials Cloud across various Finance modules like Payables (AP), Receivables (AR) , General ledger(GL) and SCM modules like Order Management (OM), Purchasing (PO) ,and Leasing and Financing (OLFM) , Advance Global Intercompany System (AGIS) & third party applications like Vertex.

Leave a Comment

Your email address will not be published. Required fields are marked *