Supporting Python Script
Banks can extend the Transact Explorer’s API framework (tb-server API) to customise the validations that allow them to define Python hooks rather than changing the core framework. The customised Python hooks are part of the initial configuration process, which are stored separately from core changes. That is, once configured, the user cannot change any information during execution.
The Python method definitions are predefined as pre-process and post-process, which allows you to invoke customized validations before and after the request processing in Temenos Transact.
Configuring Deployment Environment
To configure the deployment environment, you need to configure the generic config microservice.

Following section provides the details to save Python scripts with their respective names for configuring the environment.
Mapping Resource with Operation ID
Define and store operation Id for each resource.
Group Id | Purpose |
---|---|
com.temenos.irf.uxpb.resource.mapping | Stores resource and its operation Id |
Below is the sample URL.
http://localhost:7006/ms-genericconfig-api/api/v2.0.0/system/configurationGroups/com.temenos.irf.uxpb.resource.mapping/configuration/operationIds
Mapping Operation ID with Extension Function
Define and store extension function for operation Id.
Group Id | Purpose |
---|---|
com.temenos.irf.uxpb.validations | Stores extension function for operation Id |
Below is the sample URL.
http://localhost:7006/ms-genericconfig-api/api/v2.0.0/system/configurationGroups/com.temenos.irf.uxpb.validations/configuration/createAccountUxpb
Mapping Script with Script Content
Once the resource mapping and the extension function are mapped, then you can encode the script content with base64 and post the following MS URL to make the mapping between the script and script content.
Group Id | Purpose |
---|---|
com.temenos.irf.uxpb.extensions.irf-rp-services | Stores python script content with the script file name. |
http://localhost:7006/ms-genericconfig-api/api/v2.0.0/system/configurationGroups/com.temenos.irf.uxpb.extensions.irf-rp-services/configuration/createAccount.py
Configuring Environment variables
To enable the Python script validation, you should set the below properties in environment variable as shown below:
- -Dtemn.config.service.base.pathurl= http://localhost:7006/ms-genericconfig-api/api/
- -Dextension.script.home=C:\temp\extension
Sample screenshot with the properties is shown below.
You should map every resource to operation id, which must be mapped with a Python script to invoke Python script validation. The existing UXPB mapping and its script files can be used as such in Transact Explorer.
Defining and Storing Script in System Path
You can place the extension Python scripts in any local system directory. You can use the below system property to configure the absolute path.
-Dextension.script.home= ”C:\temp\extension”
Sample screenshot with the property is shown below.
Configuring Module Dependency
Validate the Python by verifying the presence of server module dependency configurations.
To perform the validation,
- Verify the availability of the jar files under the Validation module.
- Check the updated module.xml file for the relevant file name.
-
Ensure that the Validation module is available in the JBoss standalone-utp.xml file.
Python Script In and Out Parameters
To perform validation on request or response payload in Python scripts, the IN and OUT parameters are constructed at runtime and sent as HashMap Objects.
IN Parameters
Parameter | Description |
---|---|
jsonData | Request or Response of the processing record in JSON format. |
userId | User ID or SignOn name of the logged in user. |
companyId | The company ID of the logged in user. |
userRole | The role of the logged in user. |
Authorization | If IDP is configured, indicates the JWT token, else indicates the OsToken of the user’s session. |
tbServerUrl | The base tb-server URL. |
resource | The current resource to which the extension is attached. |
operationId | The operation ID of the current resource. |
domainId | Unique ID of the domain (uxpb or te). Defaults to ‘uxpb’ if the operation ID ends with Uxpb, else defaults to ‘te’. |
pythonScriptName | The python script file name. |
recordId | The transaction ID of the processing record. |
OUT Parameters
Parameter | Description |
---|---|
Python Response |
The Python response contains the below components:
|
Below is the sample script file:
Invoking REST API from Python Script
You can use Python native Requests module when you need to call API from the Python script. This option allows you to avail all the functional features with respect to Queryparams, special character URLs, different content types, URL encoding, and decoding cases.

The python scripts can include the external module requests to make any REST call from the scripts.
To configure the Python native Requests module, ensure that the following is available in the system.
- Python-2.7.15 version is used and compatible with the jython-standalone-2.7.2 library.
- The Requests module and its transitive libraries version.

To configure the Python native module requests,
-
Create the Lib folder under <UTP DEV pack>\Temenos\jboss\modules\com\temenos\validation\main\lib and place the mentioned libraries.
Ensure that the folder name is Lib. -
Start the server to consume the python Requests module in scripts.
You have now configured the Python native module requests.
Configuring Python through Workbench UUX
The Workbench UUX serves as the UI for configuring Python extensions for TE within GCMS. There have been no alterations to the Workbench UI with respect to TE. Same UX resource extension that supports UXPB is used for TE. You can access the options within the Workbench for configuring Python files and their respective mappings accordingly.
Below is the sample execution.
Enquiry -ENQ CUSTOMER
Sample Script -CustomerEnq.py
In this topic