Showing posts with label mif. Show all posts
Showing posts with label mif. Show all posts

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: 

Thursday, October 1, 2020

Multiplication control to create records for multiple Sites or Orgs in Enterprise service

There are scenarios wherein we need to create a record to multiple Organizations or Sites from a single payload.

A multiplication control is a cross-reference control that copies, or multiplies, an inbound message for multiple organizations or sites. 

We can create Cross Reference Control from the Enterprise Services application --> Select Action menu --> Create Integration Controls.
 
In the dialog box, click the button "Add New Control" -->  Select Cross Reference Control (Add New Xref Control).

It has one Default External value and multiple Maximo Default values.


Associate ORGMUL to Enterprise Service. Open an enterprise service from Enterprise Services application. From the Select Action menu --> Associate integration controls
select ORGMUL, then click OK.

Assign Multiplication Control: Open an enterprise service from Enterprise Services application.
Select ORGMUL as the Multiplication Control in the Multiplication Control field.

Create an Enterprise Service Rule to replace the value on an inbound transaction using a key value pair.

Create a Rule, for example, SETORG. Action=Replace. 
Click Add/Modify Conditions. Click New Row in the Conditions section. Click New Row in the XML Field Section. Choose the Field you wish to do the replace on and leave the Evaluation Type as NOTEQUALS and the Evaluate When as ALWAYS. Choose the Value Radio Button and click OK.

Click the Sub-Record Fields button. Click New Row, choose the field you wish to do the Replace on and then choose the Integration Control.


Input XML for testing: 

Reference: https://rb.gy/urcuxa

https://www.ibm.com/support/pages/using-rules-replace-value-list-inbound-transaction