IBM Support

Maximo Automation Script (AS) help creating Maximo Debug logs to assist with Maximo PM WOGEN DATE type issues

Question & Answer


Question

How can I create an AS that helps in creating Maximo Debug logs to assist with Maximo PM WOGEN DATE type issues?

Answer

1. Attribute(PM.LASTCOMPDATE) Launch Point

In the Automation Scripts application on the List tab, choose 'Create > Script with Attribute Launch Point' and create the script with the following values:



N.B!!--> Set Script field to the appropriate PMR number to find the start of the printed stack trace so replace PMR51324,019,866 with your PMR number





Copy and paste the following script for use with this Launch Point:

#=============================================================================================
from psdi.iface.mic import MicUtil
from java.lang import Exception
from psdi.mbo import MboConstants

#MicUtil.INTEGRATIONLOGGER.debug("51324,019,866*****START SETVALUE " + launchPoint)

MicUtil.INTEGRATIONLOGGER.debug("51324,019,866*****START SETVALUE " + launchPoint)
MicUtil.INTEGRATIONLOGGER.debug("51324,019,866 : " + mbo.getName() + "[" + str(mbo.hashCode()) + "]." + launchPoint + " SET TO " + mbo.getString(launchPoint) + " for PMNUM:SITEID " + mbo.getString("pmnum") + ":" + mbo.getString("siteid"))
MicUtil.INTEGRATIONLOGGER.debug("51324,019,866 : " + mbo.getName() + "[" + str(mbo.hashCode()) + "].LASTSTARTDATE=" + mbo.getString("LASTSTARTDATE"))
if mbo.getThisMboSet().getCompleteWhere() is not None:
MicUtil.INTEGRATIONLOGGER.debug("51324,019,866 : RELATIONSHIP IS: " + mbo.getThisMboSet().getCompleteWhere())
else:
MicUtil.INTEGRATIONLOGGER.debug("51324,019,866 : RELATIONSHIP IS NULL.")
if mbo.getThisMboSet().getRelationName() is not None:
MicUtil.INTEGRATIONLOGGER.debug("51324,019,866 : RELATIONSHIP NAME IS: " + mbo.getThisMboSet().getRelationName())
else:
MicUtil.INTEGRATIONLOGGER.debug("51324,019,866 : RELATIONSHIP NAME IS NULL.")
owner=mbo.getOwner()
j = 0
while owner is not None:
MicUtil.INTEGRATIONLOGGER.debug(str(j) + ">51324,019,866 : OWNER: " + owner.getName() + "[" + str(mbo.hashCode()) + "]")

if owner.getThisMboSet().getCompleteWhere() is not None:
MicUtil.INTEGRATIONLOGGER.debug(str(j) + ">51324,019,866 : OWNER RELATIONSHIP IS: " + owner.getThisMboSet().getCompleteWhere())
else:
MicUtil.INTEGRATIONLOGGER.debug(str(j) + ">51324,019,866 : OWNER RELATIONSHIP IS NULL.")

if owner.getThisMboSet().getRelationName() is not None:
MicUtil.INTEGRATIONLOGGER.debug(str(j) + ">51324,019,866 : OWNER RELATIONSHIP NAME IS: " + owner.getThisMboSet().getRelationName())
else:
MicUtil.INTEGRATIONLOGGER.debug(str(j) + ">51324,019,866 : OWNER RELATIONSHIP NAME IS NULL.")

owner=owner.getOwner()
j=j+1

MicUtil.INTEGRATIONLOGGER.debug("51324,019,866 stack A", Exception())
MicUtil.INTEGRATIONLOGGER.debug("51324,019,866*****END SETVALUE " + launchPoint + "**********************************************************************\n")
#=============================================================================================



2. In the Logging application, change the Integration logger level to DEBUG:


=======================================================================================================================================

To avoid unnecessary logging, do not enable the scripts and logger until you are ready to make the error happen.
That is, if there are any steps in Maximo to get to the point just before executing the transaction that causes the error, do those first to avoid logging information not pertinent to the problem.

Also, make sure of the following:

>the integration logger is using a Rolling File appender so the debug statements will be logged to a file.
>the Active check box on the Launch Points tab is selected for both scripts.

The server does not need to be restarted. Once the scripts and Integration logger are implemented and activated, the problem can be reproduced and logged.

After running PM wogen for the problematic PM or PMs, search the log file for occurrences of '51324,019,866' to insure that the logging worked correctly. When the debug statements have been successfully logged, you can then turn off the logging by deactivating the Integration logger and each script's launch point.

[{"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.5;7.6","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
17 June 2018

UID

swg21997847