Friday, January 19, 2024

Maximo Outbound Object Structure Integration Customization Functions in Automation Script

Maximo Integration Framework supports customization of Object Structure in Java, Automation Script or both at the same time.

Object Structure processing can be Outbound or Inbound:
  • Outbound Object Structure custom processing can be performed during the serialization of Maximo business object (MBO) data into a json or XML message
  • Inbound Object Structure custom processing will happen in inbound json or XML message before it is mapped to MBO business object data
What ? Outbound Object Structure processing functions using Automation Script

Why? Java Customizations for Integration processing needs an outage for deployment. Using Automation Script is more like a configuration and doesn't need any deployment or restart for a change.

Conditional Skipping (or excluding) columns and Overriding field values from other MBOs can't be achieved using processing rule configuration. 

How to Implement ? Create an Outbound Object Structure processing script by selecting Create Integration Scripts from the Automation Scripting application. Choose any Object structure name - MXPR and select Outbound Definition check box.
 
Maximo will create a script with name OSOUT.<ObjectStructureName> and call the methods while processing Object Structure outbound operation.

                            

 


from psdi.util import HTML

def overrideValues (ctx):
    if ctx.getMboName() == "PR" or ctx.getMboName() == "PRLINE":
        # remove html tags from pr and prline description
        ctx.overrideCol("DESCRIPTION_LONGDESCRIPTION", 
			HTML.toPlainText(ctx.getMbo().getString("DESCRIPTION_LONGDESCRIPTION")))
		
def skipCols(ctx):
  if ctx.getMboName()=='PRLINE':
    # remove extra fields from outbound message to reduce payload size
    ctx.skipCol(['RL1','RL2','RL3','RL4'])
	
def skipMbo(ctx):
  if ctx.getMboName()=='PR':
    if ctx.getMbo().getMboSet("PRLINE").isEmpty():
      ctx.skipTxn()
  elif ctx.getMboName()=='PR':
    # skip MBOs that are COMP or in history status
    if ctx.getMbo().getInternalStatus() == "COMP" or ctx.getMbo().getBoolean("HISTORYFLAG") :
      ctx.skipMbo()  

References: