Corticon supplies a REST API that lets client applications execute against remote Decision Services. The endpoint to this REST API is:

http://<base>/axis/corticon/execute 

where <base> is the Corticon Server's IP or DNS-resolvable name and port.

Note: REST API online documentation—The REST API in static format is available in Java Server's install directory for Java and .NET (but not propagated to the IIS Server), and at https://documentation.progress.com/output/Corticon/6.3/RESTDoc/

The payload set to the REST API is a JSON object that contains the Decision Service and related data to execute against. The format of the JSON object is:

{
  "name": <string>,
  "majorVersion":<number - optional>,
  "minorVersion": <number - optional>,
  "Objects": <JSONArray of JSONObjects>
}

where name, majorVersion, and minorVersion values specify which Decision Service will be used for the execution, and the Objects value is the payload of the data to be processed.

On the Corticon Server, you can use REST to execute a JSON-formatted Corticon Request by specifying the target Decision Service. The REST method supported is HTTP POST in the form:
HTTP POST:base/axis/corticon/execute
where base is the Corticon Server's IP or DNS-resolvable name and port. For example:
{
  "name": "ProcessOrder",
  "majorVersion":"1",
  "minorVersion": "16",
  "Objects": <JSONArray of JSONObjects>
}

Success and error responses

The response returned by the server has two parts:
  • A HTTP status code
  • An HTTP header containing message execution info

Success response - In addition to the processed request, when execution is successful, the response message's body contains the updated JSON string. A successful execution's shows its status (200) and header.

Error behavior

For all REST executions, an error (an HTTP status code other than 200) provides messages in the response body.

Example:


 
            	
{"error": {

"type": "com.corticon.eclipse.rest.delegates.CcRestDelegateRequestErrorException",
"message": "retrieveServiceProperties(String,String,String) 
           Could not find decision service: \"Process Order \"",
"cause":{
"stackTrace": [...],

"type": "com.corticon.service.ccserver.exception.CcServerDecisionServiceNotRegisteredException",
"message": "CcServer.lookupCcServerPoolHighestVersionNumber() 
           Decision Service: Process Order is not registered. Update failed."},
"stackTrace": [...],"parentError": {"stackTrace": [...],

"type": "com.corticon.service.ccserver.exception.CcServerDecisionServiceNotRegisteredException",
"message": "CcServer.lookupCcServerPoolHighestVersionNumber() 
           Decision Service: Process Order is not registered. Update failed."}}}