Search This Blog

Friday, June 2, 2023

MAXIMO : Automation Script - Execute SQL for data correction without having DB access

Here is an example of an automation script that can be used to for any data correction situation where it needs to execute update/SQL scripts on backend database directly and it can be done without having direct DB access to execute SQLs using DB client tools. 

For example we are needing to correct PO details such that PO have corrupt status and receipts completion and need back end correction. 

We will need to update latest revision status to APPR and previous revision status to REVISD along with marking receipts complete on latest revision by running SQL Update , Insert statements using automation Script. High level steps :

 1.  We will need to create automation script without any launchpoint. 
 2.  We will have to pass required values in request parameters for identification records to be updated  
      e.g. PONUM , SITED in this case. 
3.   We will call the automation script as rest call passing parameter values and script code will run 
      required SQL statements 
     
 e.g. Update PO details for revisions , insert status history records in POSTATUS etc.

 ****************Code snippet*************************

Using this script we will make a POST request call for Maximo REST API.
The request will be authenticated using your login session or require username and password can be passed in parameters as like any REST API call. 

Automation script is fetching connection key and other details using MXserver references and calling SQL statements 

e.g. Update PO statuses for revisions and insert status history details over the connection established using MXServer. 

No comments: