Tuesday, September 13, 2016

Maximo Automation Script : To make field value to remove special characters and to make it in upper case

Below script is used to remove the special characters and make values in the field to uppercase

Script
------
Name : ASSET-DESCRIPTION-REMOVE-SPLCASE
Language : jython

Launch Points
-------------
Name : ATT-REMOVE-SPLCASE
Active : 1
Object : Asset
Attribute : DESCRIPTION

Autoscript
----------

from psdi.util.logging import MXLogger
from psdi.util.logging import MXLoggerFactory
from psdi.mbo import MboConstants
from psdi.util import MXApplicationException

logger = MXLoggerFactory.getLogger("maximo.script");
logger.debug("==================== ATT-REMOVE-SPLCASE." + launchPoint + ": START =====================")

#This script reformats the Description field to only have alphanumeric uppercase characters
#Characters A-Z and 0-9 inclusive are permitted.

description = mbo.getString("DESCRIPTION")
description = ''.join(i for i in description if i.isalnum())
description = description.upper()
mbo.setValue("DESCRIPTION", str(description), 2)

logger.debug("==================== ATT-REMOVE-SPLCASE." + launchPoint + ": END =====================")
----------------------------------------------------------------------------
All the messages
below are just forwarded messages if some one feels hurt about it please add your comments we will remove the post.Host/author is not responsible for these posts.

Discardable MBOSET / MBO in IBM Maximo

·         These can be used on MBOSETS which are used for traversing forward only ie looping in
·         They should not be used while doing edit/save etc operations
·         Mboset will not cache the MBOs as it fetches from directly from database. This will minimise the JVM memory usage.
·         Discardable Mbo Sets are always read only.

Example below to make a MBOset discardable

MboSetRemote personSet = getMboSet("PERSON");
personSet.setFlag(MboConstants.DISCARDABLE, true);




----------------------------------------------------------------------------
All the messages below are just forwarded messages if some one feels hurt about it please add your comments we will remove the post.Host/author is not responsible for these posts.