Tuesday, April 26, 2016

using array in Maximo Automation script


from psdi.util.logging import MXLogger
from psdi.util.logging import MXLoggerFactory
from psdi.mbo import MboConstants
from jarray import array

logger = MXLoggerFactory.getLogger("maximo.script");
logger.debug("==================== ATT_WO_WOPRIORITY." + launchPoint + ": START =====================")

# declaring as a set of double values
arrSubDiv = array([1,2,3,4,5,6],'d')

woPriority = mbo.getDouble("WOPRIORITY")

for i in arrSubDiv:
 if (i==woPriority):
   mbo.setFieldFlag("JUSTIFYPRIORITY",MboConstants.REQUIRED, True)
else:
   mbo.setFieldFlag("JUSTIFYPRIORITY",MboConstants.REQUIRED, False)


logger.debug("==================== ATT_WO_WOPRIORITY." + launchPoint + ": END =====================")





----------------------------------------------------------------------------
 All the messagesbelow 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.

Tuesday, April 19, 2016

Get a list of included/excluded/Non Persistent/Persistent fields used in a Integration Object in Maximo.

Below query fetches list of records which have been used in integration object in Maximo .Here i took the example of Integration Object = MXASSET

select * from (
select distinct i.intobjectname,m.objectname,m.attributename,   'INCLUDE' as intobjfldtype from maximo.maxattribute m,maximo.MAXINTOBJCOLS i, maximo.MAXINTOBJDETAIL intobjdtl  where i.INTOBJECTNAME in ('MXASSET')
and intobjdtl.INTOBJECTNAME in ('MXASSET') and m.objectname=intobjdtl.objectname and m.attributename not in (select b.name from maximo.MAXINTOBJCOLS b where b.INTOBJECTNAME in ('MXASSET')) and m.persistent != 0
union
select distinct i.intobjectname, m.objectname,m.attributename, i.intobjfldtype from maximo.maxattribute m,maximo.MAXINTOBJCOLS i where i.INTOBJECTNAME in ('MXASSET') and i.intobjfldtype='EXCLUDE'
and m.objectname=i.objectname and m.attributename in (select  b.name from maximo.MAXINTOBJCOLS b where b.INTOBJECTNAME in ('MXASSET')  and intobjfldtype in ('EXCLUDE')) and m.persistent != 0
union
select distinct i.intobjectname, m.objectname,m.attributename, i.intobjfldtype from maximo.maxattribute m,maximo.MAXINTOBJCOLS i where i.INTOBJECTNAME in ('MXASSET') and i.intobjfldtype='NONPERSISTENT'
and m.objectname=i.objectname and m.attributename in (select  b.name from maximo.MAXINTOBJCOLS b where b.INTOBJECTNAME in ('MXASSET')  and intobjfldtype='NONPERSISTENT')) order by objectname,attributename



----------------------------------------------------------------------------
 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.