API Extension
This section explains how to search, create, or edit a new extension between a Transact API and regular expressions for basic field level validations, python script validation or field defaulting with constants.
Creating and Editing API Extension
This section details about creating and editing API Extension.
Creating API Extension
To create an API Extension,
- Navigate to Extensions > API Extension, on the dashboard’s left pane.
- Click Add New API Extension on the Search page.
- Enter the following details in the New API Extension screen.
Field Action Required Mandatory – YES/NO Default Value War Name Select the relevant war in which the Transact API is bundled. YES First value in the list Domain Name Select a Domain name as in Create Provider API from the dropdown. YES First value in the list Operation Name This will list the operation names for a selected domain. If operation name doesn’t exist then we show a warning: 'There are no operationIds for the selected warName and Domain'. YES Version Name Enter Semantic version number prefixed with v. YES v1.0.0 Attribute ID API Field name which needs to assign default value. YES (if Python and RegEx Attribute Validation is not given) Default Value Constant value to be defaulted with. YES (if Python and RegEx Attribute Validation is not given) Script Name Select Python Validation script name. YES (if Attribute Defaulting and RegEx Attribute Validation is not given) Attribute ID API Field name against which Regular expression will be validated. YES (if Attribute Defaulting Python Validation is not given) Regular Expression ID Select a Regular Expression ID from content assist. YES (if Attribute Defaulting Python Validation is not given) Error Code Customised error code. YES (if Attribute Defaulting Python Validation is not given)
- Enter the mandatory fields and any one or all the sections, that is, Attribute Defaulting, Python validation or Regular Expression Attribute Validations.
- Click Create to create the mapping between API and attribute validations.
Editing API Extension
To edit an existing API Extension,
- Navigate to menu Extensions > API Extension on the dashboard’s left pane.
- Search for the API Extension record and click Edit.
- Update and Click Save.
Packaging API Extension
As a prerequisite, Extension configuration for API Extension must be defined as System properties. Refer Configuration Parameter Reference section for more information.
- If Workbench is configured with non-Git mode, Add to Package button is available in all the screens.
- If Workbench is configured with Git mode, Add to Project button is available in all the screens.
To Package an existing API extension,
- Navigate to Extensions > API Extension, on the dashboard’s left pane.
- Search for an API Extension record and click Edit.
- Select a package or project from the top app bar and,
- Click Add to Package/Add to Project.
- On the appbar, click the '+' icon and click either Add to Package/Add to Project, or Add All to add API Extensions to the package or project.
- Click Add to Package/Add to Project.
In this topic