Maximo Application Suite
Search This Blog
Thursday, May 11, 2023
MAXIMO BASICS: Broken Sequence BMXAA8010E - Record Already exists erros
Sunday, April 16, 2023
MAXIMO : DBC-Scripts for Quick and Easy Migration
MAXIMO : Automation Scripts Quick Overview
Maximo Automation
Script
Automation scripts are a powerful Maximo feature that allows you to
automate your business processes. They enable you to create a
custom application and process the data with just a few clicks.
Kindly refer attach PDF for overview
Monday, February 13, 2023
MAXIMO : Run SQL statements from Automation Scripts
This article details Maximo automation script needing to execute plain SQL statements instead of Maximo Mbo and MboSet related methods.
Broadly there are two way's to handle SQL statement exeuction , first is you can simply follow standard java.sql package and use respective connection and allied objects and the next which is recommended one is to use maximo DBShortcut class from framework which supports connection pool optimized way in terms of performance/resource usage and clean up aspects.
Below are sample code snippet which can show how to use these two approaches
1. JDBC Connection:
from psdi.security import UserInfo
from psdi.server import MXServervsql = "update workorder set priority='1' where wonum=1002"mxserver = MXServer.getMXServer() conKey = mxserver.getSystemUserInfo().getConnectionKey() cnx = mxserver.getDBManager().getConnection(conKey) stmt = cnx.createStatement() stmt.executeUpdate(vsql) stmt.close() cnx.commit() mxserver.getDBManager().freeConnection(conKey)2. DBShortcut Class:
from psdi.mbo import DBShortcut, SqlFormat
from psdi.server import MXServer vsql = "update workorder set priority='1' where wonum=1002" mxserver = MXServer.getMXServer() conKey = mxserver.getSystemUserInfo().getConnectionKey() dbs = DBShortcut() dbs.connect(conKey) sqf = SqlFormat(vsql) dbs.execute(1, sqf) dbs.commit() dbs.close()MAXIMO - DBC Script Guide
Here I am sharing IBM guide for DBC.
This will be helpful DevOps automation towards most of maximo configuration migrations put under typical pipeline tools like Jenkins.