IBM Support

Automation scripts and non-persistent objects

Troubleshooting


Problem

This document provides some info about working with non-persistent objects and automation scripts.

Symptom

Automation Scripts not working for some non-persistent objects, such as ASCHANGESTATUS or USERSTATUSCHANGE

1. Steps to replicate:

Create an object level automation script using the following

Object Level Launch Point

Launch Point = OBJ-ASSET-STATUS
Description = Object Asset Status History
Object = ASCHANGESTATUS
Active = Y
Add = Y
update = Y
Initialize = N
Delete = N

No required variables.

Script = OBJ-ASSET-STATUS-SCRIPT
Description = Object asset status history
Log Level = DEBUG
Status = Active
language = jython

Script should be like below :

from psdi.util.logging import MXLogger
from psdi.util.logging import MXLoggerFactory
from psdi.mbo import MboConstants
from java.util import Date
logger = MXLoggerFactory.getLogger("maximo.script");
logger.debug("==OBJ-ASSET-STATUS-SCRIPT." + launchPoint + ": START ==")
assetnum = mbo.getOwner().getString("assetnum");
logger.debug("==OBJ-ASSET-MSM-SCRIPT.assetnum=="+ assetnum)
logger.debug("==OBJ-ASSET-STATUS-SCRIPT." + launchPoint + ": END ==")


After going to Logging app and making sure that the script logger is set to DEBUG, you will observe that there is no log file messages getting generated with assetnum value, in the log files.

NOTE : This was tested with persistent object called PERSON and it works.
But not for non-persistent object, such as ASCHANGESTATUS or USERSTATUSCHANGE.

Resolving The Problem

As per product designers, there is a fundamental difference between non persistent mbos and persistent mbos. The non persistent mbos are not persisted ie they are never "saved" - so save level events - like "add", "update", "delete" does not apply to them.

However all mbos (non persistent or persistent) are initialized - hence "init" event will apply universally to all mbo types. For example, if you chose init event - your script would be invoked. But it will never be invoked for "add" or "update" as there is no such concept for non persistent mbos.

The most important thing is to understand that the ASCHANGESTATUS mbo on "OK" would go and update something (say status) in the ASSET persistent mbo - so if you are really interested in doing some logic (scripting) on "change status" - do it at the ASSET "update" launch point - not for the non persistent mbo that causes it as there will never be any add/update/delete for that.

Although non-persistent objects are never saved , we should not state that "non-persistent objects will not work with automation scripts" , because it works for certain events.

They will never work for "save" events (add,update,delete) , as np objects are never saved , but as mentioned before - "init" event will work. Also attribute launch point will work as is for these objects so a lot of scripting will work for these, and only a few will not work.

[{"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.5;7.6","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
17 June 2018

UID

swg21967449