Update a business logical extension

patch

/publisher/apiManagement/processingInformation/shoppingcartAdapter/shoppingCart/v4/schemas/oracle/buying/{component_name}

This method is used to create Processing Information file(PI). The Processing Information file is JavaScript file that is associated with a particular business entity - example - ShoppingCartOracle. The PI file will be stored in the Object Storage with POST operation and the processing information file will be used for ShoppingCartOracle POST and PATCH requests for processing the external busieness logic defined inside this file. Every processing information file should have the two functions defined in them, handleSignal and handleTaskSplittingResult. Therefor you can think of each Processing Information file as a javascript file that must implement a sort of interface that defines those two functions. The naming of these functions corresponds to the purpose these functions serve in the underlying framework that allows for the extensibility of business objects.


JavaScript Methods that need to be overriden in Processing Information
Method Name Usage
handleTaskSplittingResult() This is pre-processing method which gets executed before shoppingCart is created. This is callled "pre-processing" logic.
handleSignal() This is post-processing method which gets executed after shoppingCart is created.This is callled the functionality defined here the "post-processing" logic.

Task Signals definations for ShoppingCart that need to be used in Processing Information
Task Signal Name Usage
shoppingcart-pre-process This signal name is used to read the ShoppingCartOracle object from shoppingcart service as pre processing payload before cart is created and business logical extensions applied on the payload and return ShoppingCartOracle object as response.
shoppingcart-post-process This signal name is used to read the ShoppingCartOracle object from shoppingcart service as post processing payload after cart is created and business logical extensions applied on the payload and return ShoppingCartOracle object as response.
audit-info-signal-pre-process This signal name is used to update the audit details inside Processing Information for pre-processing business logic and emit this task signal.
audit-info-signal-post-process This signal name is used to update the audit details inside Processing Information for post-processing business logic and emit this task signal.

Status codes that need to be used in Processing Information
Status code Usage
SUCCESS This status code is used when successful response from spoke system.
WARNING This status code is used when error response from spoke system and still want to process the ShoppingCart and return error to user.
FAILURE This status code is used when successful response from spoke system and don't want to process the ShoppingCart and return error to user.

Example-1:Basic Skeleton of the Processing Information JavaScript Code
  import { MappingContext, SignalDefinition } from "src/it/resources/com/oracle/cx/sdk/providers/it/lib/oracle-builtins.mjs";
import { DataSignal, DIRECTION, ActionableDataSignal, SignalMetaMap, SPOKE_ID, ACTION } from "src/it/resources/com/oracle/cx/sdk/providers/it/lib/signals.mjs";
export const spokeDiscriminator = () => "oracle";
export const providedSignals = () => [];
export const handleSignal = async (payload, ctx, signalInfo) => {
}
export const handleTaskSplittingResult = async (requestJson, ctx, {apiName, apiVersion, pathId, requestHTTPMethod, sourcePropertyName}) => {
}  
Example-1:Basic Skeleton of the Processing Information JavaScript Code

Request

Path Parameters
Supported Media Types
Security
  • Type: oauth2
    Description: The DX4C BuyingX Rest APIs are protected with OAuth2.0 Token-based Authentication and Role-based Authorization. The Roles are segregated based on different sets of Rest APIs. This OAuth2 Security scheme represents the below Role. This scheme is added to all the required Rest end-points protected by the below role. <ul> <li><b>Support Specialist</b> : Grants full access to BuyingX Runtime Rest APIs in the context of an Agent</li> </ul>
Back to Top

Response

Supported Media Types

201 Response

Updated. After successful updation of processing information.

400 Response

Bad Request. Refer Error schema for information of the errors returned for different validation scenarios. For example, if an invalid action is provided in the request body, the following error message is populated.

"code" "CXI-BUY-0022", "reason" "Invalid body", "message" "Action specified on the cart items [cartItem[0]] is either empty or not one of the supported types. "

Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source

401 Response

Unauthorized
Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source

403 Response

Forbidden
Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source

405 Response

Method Not allowed
Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source

409 Response

Conflict
Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source

500 Response

Internal Server Error. Refer Error schema for information of the errors returned for different scenarios. For example, if issue is related to processing the request because of server errors, the following error message is populated.

"code" "CXI-BUY-0001",
"reason" "Internal Server Error"

Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
Back to Top