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
Task Signals definations for ShoppingCart that need to be used in Processing Information
Status codes that need to be used in Processing Information
Example-1:Basic Skeleton of the Processing Information JavaScript Code
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 CodeRequest
Path Parameters
-
component_name(required): string
Identifier of the TMF Component
Supported Media Types
- application/javascript;charset=utf-8
Security
-
oAuth2AuthCodeForSupportSpecialistRole: oauth2
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>
Response
Supported Media Types
- application/json;charset=utf-8
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. "
Root Schema : Error
Type:
object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
401 Response
Unauthorized
Root Schema : Error
Type:
object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
403 Response
Forbidden
Root Schema : Error
Type:
object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
405 Response
Method Not allowed
Root Schema : Error
Type:
object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
409 Response
Conflict
Root Schema : Error
Type:
object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
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"
Root Schema : Error
Type:
object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension