Hi,
there are at least two issues here.
First one is related to the way how the OS info is being published. The outbound processing differs depending on whether it is Maximo publishing event or maybe it's REST API request. When MX is publishing information (e.g. Publish Channel event listener active) then it serializes whole OS on all levels. In such case overrideValues(ctx)
function always called for every MBO in the OS hierarchy.
When you request data through the REST API then a lot depends on your oslc.select
parameter. Namely for root OS Mbo you will always get overrideValues(ctx)
function called but for lower hierarchy levels this function gets called only when you're using nested objects notation (e.g. for MXAPIWODETAIL
OS you may have oslc.select=wonum,asset{assetnum,description}
). You will NOT get the overrideValues(ctx)
function called when using dot-notation, simply trying to inline include related object details (e.g. oslc.select=wonum,asset.assetnum,asset.description
or oslc.select=wonum,rel.asset{assetnum,description}
).
This leads us to the second issue. Namely you may think that for DOCLINKS
following will work: oslc.select=wonum,doclinks{weburl}
. Unfortunately it doesn't work! JSON serialization logic calls overrideValues(ctx)
function for DOCLINKS
objects but it ignores the result as it always follows quite "special" (hardcoded) way of serializing the data.
How to overcome that? Nothing reliable springs to my mind... Maybe others can help!
------------------------------
Andrzej Więcław
Maximo Technical SME
ZNAPZ B.V.
Wrocław, Poland
------------------------------
Original Message:
Sent: Fri April 11, 2025 06:51 PM
From: Sivakumar Chittu Damodharan
Subject: Maximo Outbound Integration Scripting
Hi,
I am trying to replace a URL from a REST API call using the outbound integration script, but the ctx is not working.Mbo() seems to go only to the parent MBO, but the WEBURL I am trying to replace is at the child level. My object structure consists of WORKORDER, WOACTIVITY, DOCLINKS, and DOCINFO. Below is a sample script I am using.
from psdi.server import MXServer
from psdi.mbo import MboConstants
from psdi.util.logging import MXLogger
from psdi.util.logging import MXLoggerFactory
logger = MXLoggerFactory.getLogger("maximo.script")
def overrideValues(ctx):
print(ctx)
logger.debug("********************************************Beginning OSOUT.ASSETINSPECTION********************************************")
if ctx.getMosDetailInfo().getObjectName() == "DOCINFO":
ctx.overrideCol("weburl", "https:\\dev")
I appreciate any help you can provide.
Thanks,
Siva
------------------------------
Sivakumar Chittu Damodharan
------------------------------