Operation override
Less than to read
In the API operation function (GESAPIOPE), any operation can be replaced and overridden by filling in the Operation override field.
- The specific Create mutation may include specific business rules or any new specific properties and extend the node and/or the UI page.
Operation type and operation method (GESAPIOPE)
For a CRUD Operation type (Create/Update/Delete):
- The Operation method is restricted to Import or Object.
- Note: There is no control or impact of the GraphQL Operation name for a CRUD operation defined in the API operation function (GESAPIOPE).
- If the framework bypasses the Operation name to identify the CRUD mutation of the node, the CRUD operation will be executed by virtue of the Operation type (Create, Update, or Delete), regardless of the GraphQL Operation name.
- The framework only uses the Operation type to identify the operation to be executed for a CRUD mutation and not the operation name.
- For a Custom type Operation:
- The Operation method is restricted to Import or Script.
Overriding an operation by another
- For a custom operation:
- A specific Custom operation can override a standard Custom operation, but not override a CRUD operation (Create, Update or Delete).
- If the overridden Operation method is Script, the new script must have the same parameters and response bindings. Therefore, it must have the same parameters definition.
- For a CRUD operation:
- A specific CRUD operation (Create, Update, or Delete) can override a standard CRUD operation.
- Note: Only the Operation methods Import or Object are allowed as replacements.
- A script cannot be overridden by an Import or an Object and vice versa.
- If an overriding operation exists, X3 will execute it as a replacement of the standard one.
- Note: X3 doesn’t control if there are multiple operations replacing the same one. X3 executes the first active replacing operation found alphabetically.
- On the package generator, the operation is assigned to an override operation, the operation will be ignored and not generated.
- Consequently, the GraphQL operation name does not matter for an operation created to override another one.
- Only the overridden operation is generated for the node.
- The overriding operation is only useful on X3’s side as a replacement for another one.
Customizing standard operations
Script (Transient operations) | Import/Object (Node based operaitons) | |
---|---|---|
How to customize operation methods | Duplicate and customize the subprogram. |
Sage standard is protected. Duplicate and customize the standard import templates. |
How to customize operations |
An Operation override field is available for partners to override any operation on a node. Script are only used for Custom mutation when:
|
An Operation override field is available for partners to override any operation on a node. If used as a CRUD mutation:
|
How to customize pages |
Adding or overriding properties on standard pages is allowed by using page extensions. In other cases, develop a specific page. |
On non-transient pages, the partner will do an extension to the page and add their custom fields. There will be a node extension containing these custom fields, and the framework will submit the entire node payload to X3 API. If the mapping on the API operation has custom properties, then it will be used. On transient pages, the new fields will not be submitted to X3 in the payload. In such cases, the standard page will have to be duplicated in the custom package and adapted to match the requirement. |
Example
Owner | Mutation type | Node name | GraphQL Operation name | Operation code | Operation override | Mutation method | Active |
---|---|---|---|---|---|---|---|
SAGE | Custom | customer | setCreditLimit | SAL_BPC_SET_CREDIT_LIMIT | Script | X | |
PARTNER1 | Custom | customer | partner1SetCreditLimit | SPE_P1_BPC_SET_LIMIT (1) | SAL_BPC_SET_CREDIT_LIMIT | Script | X |
PARTNER2 | Custom | customer | partner2SetCreditLimit | SPE_P2_BPC_SET_LIMIT (2) | Import | X | |
SAGE | Create | customer | createImp | SAL_BPC_CREATE | Import | X | |
SAGE | Create | customer | createObj | SAL_BPC_CREATE_BIS | Object | X | |
SAGE | Update | customer | update | SAL_BPC_UPDATE | Import | X | |
SAGE | Delete | customer | delete | SAL_BPC_DELETE | Object | X | |
PARTNER1 | create | customer | partner1Create1 | SPE_P1_BPC_CREATE (3) | SAL_BPC_CREATE | Import | |
PARTNER1 | create | customer | partner1Create2 | SPE_P1_BPC_CREATE_2 (4) | SAL_BPC_CREATE | Object | X |
PARTNER2 | create | customer | partner2Create2 | SPE_P2_BPC_CREATE (5) | SAL_BPC_CREATE | Import | X |
(1) This operation is defined to override the standard operation on the node.
(2) This operation is a new operation fully managed in a specific way by the partner.
(3) This operation is defined to override the standard operation on the node. It is set as inactive on the folder and will not be executed.
(4) This operation is defined to override the standard operation on the node. It is set as active on the folder and will be executed.
(5) The operation SPE_P2_BPC_CREATE is defined to override the standard operation on the node. It is set as active on the folder, but it will not be executed as it comes afterwards of the active operation SPE_P1_BPC_CREATE in alphabetical order.