Showing posts with label scripting. Show all posts
Showing posts with label scripting. Show all posts

Tuesday, 21 January 2020

Maximo DocInfo Inbound Processing | IBM Maximo

Create Maximo automation script for inbound document transaction from external system.

--create script for integration
--select enterprise service
--select service name
--SYNC.NPP_DOCINFO.EXTEXIT.IN

from com.ibm.tivoli.maximo.util.mbo import IterableMboSet
from java.math import BigDecimal


from java.io import File
from java.rmi import RemoteException
from psdi.mbo import *
from psdi.util import MXException
from psdi.app.doclink import Docinfo
from psdi.app.doclink import DocinfoSet
from psdi.app.doclink import DocinfoSetRemote
from psdi.app.doclink import DoclinksSetRemote
from java.lang import SecurityException
import sys


erData.breakData()

docinfoid = erData.getCurrentData("DOCINFOID")
dociset = MXServer.getMXServer().getMboSet("DOCINFO",MXServer.getMXServer().getUserInfo('MAXADMIN'))
dociset.setWhere("docinfoid="+str(docinfoid))
dociset.reset()
contentuid = dociset.moveFirst().getString("CONTENTUID")

erData.setCurrentData("CONTENTUID",contentuid)


# Code to delete the file from server
URLTYPE = dociset.moveFirst().getString("URLTYPE");
if (URLTYPE=='FILE'):
    URLNAME = dociset.moveFirst().getString("URLNAME");
    print('**** deletefilefromserver... ')
    deletefile = File(URLNAME)
    if (deletefile.exists()):
        print('**** Deleting file... '+URLNAME)
        deletefile.delete()
        print('**** File Deleted... '+URLNAME)



Friday, 12 October 2018

Database configuration formula | Maximo

Formulas are introduced from Maximo 7606 on ward, which leveraged us to make calculation related things easier as we were already doing it through auto scripts.

Although it is not new after 761 release but still not very common.

There are 2 types of DB formulas; attribute formulas and Object level formulas.

Below mentioned is one example of Attribute formula in database configuration.

In this example we write a simple Excel style IF condition formula.


Wednesday, 16 December 2015

Collection of Automation Scripts - IBM Maximo

A Collection of Automation scripts by Mr. MayOn at IBM Developerworks community. IBM Official scripting guide  is here and another Developerworks community is here Maximo Automation Scripting

Automation Script Template by Chon - IBM Maximo

Another great article I found today at Chon's website; Maximo Times. A lot of matured material we read there, and once again very important, informative, tip and a complete template to import classes in jython in Maximo, this article is about to automation script.
Article or how to contains ready-made Template for Automation script shared and developed by Chan to use whenever we need instead of creating and writing again and again.