Maximo Automation Scripts: Overwriting Maximo Business Logic with MboConstants

Phil Runion, Technical Account Manager, Projetech
June 12, 2023

Intro

Maximo, a comprehensive asset management system from IBM, allows users to manage their assets, work orders, and maintenance operations. One powerful feature of Maximo is the ability to use automation scripts to customize the system to meet specific business needs. In this article, we will discuss the best practices for using Maximo automation scripts, the importance of using proper validation and access checks, and alternative methods for achieving similar goals.

Overwriting Maximo Business Logic with MboConstants

When working with automation scripts and Java code written for Maximo, a wide range of MboConstants can be used to control how the script interacts with Maximo's business logic. It is crucial to choose the right constants for your code to ensure it works correctly and does not compromise the system's integrity. Approach each use case with the least intrusive MboConstants that work for the situation.   

For example, the NOVALIDATION_AND_NOACTION or 9L constant represents no validation and no action, meaning the script will not trigger any additional automation or check the entered values. While this may be useful in some cases, it can lead to undesired results or even break Maximo's business logic. A more appropriate constant for most situations is NOVALIDATION or 1L, which allows the script to run without validating the data that is being set or suppressing other MBO logic.

Commonly Used MboConstants

All available constants can be found in the Java Docs: https://ibm.ent.box.com/v/maximojavadocs 

Different Ways to Utilize MboConstants 

There are a few ways to reference the MboConstants. IBM code often uses a long value like “2L,” which can be difficult to read unless you have the reference table memorized. Using the written-out constant value greatly increases readability. You can either do this by importing the MboConstants class or by referencing the MBO. In the examples below, the NOACCESSCHECK is set in three different ways.

No Constant

        mbo.setValue("DESCRIPTION","Test Value")

Value MboConstants

        mbo.setValue("DESCRIPTION","Test Value",2L)

Importing MboConstants class

        from psdi.mbo import MboConstants

        mbo.setValue("DESCRIPTION","Test Value",MboConstants.NOACCESSCHECK)

MBO to Pull MboConstants

        mbo.setValue("DESCRIPTION","Test Value",mbo.NOACCESSCHECK)

Bonus: Combining Constants with Java Pipe

mbo.setValue("DESCRIPTION","Test Value",mbo.NOACCESSCHECK|mbo.NOVALIDATION)

Share this post
Phil Runion, Technical Account Manager, Projetech
June 12, 2023
IBM Maximo Tips & Tricks

More Blogs

Navigating Control Desk End of Support and Understanding Maximo IT

Navigating Control Desk End of Support and Understanding Maximo IT

On September 19th, 2023, IBM announced that Control Desk would reach End of Support on September 30th, 2025. Since this announcement was made, there has been confusion about what the Control Desk end of support date means, and the options existing Control Desk customers have.
Read post
New Lifecycle Policy for MAS: 3+1+3 Structure

New Lifecycle Policy for MAS: 3+1+3 Structure

With upcoming changes in EAM, specifically the Maximo Application Suite, IBM has announced a new product release and support lifecycle structure that will match support cycles for all versions of MAS beginning with 9.0.
Read post
Projetech: A Strategic Partner for Your Maximo Application Suite Upgrade

Projetech: A Strategic Partner for Your Maximo Application Suite Upgrade

As the end-of-support for IBM Maximo 7.6 approaches in September 2025, businesses face the critical decision of upgrading their systems. Projetech offers a strategic partnership for transitioning to the Maximo Application Suite (MAS), providing a cloud solution that minimizes the technical and financial burdens of an in-house upgrade. With Projetech's deep expertise and robust infrastructure, businesses can navigate this significant technological shift smoothly, ensuring a future-proof, efficient asset management system.
Read post

Become a part of our thriving community with over 4,000 Maximo users.

MORE offers users a platform to discover valuable resources and engage in insightful discussions surrounding the intricacies of Maximo software. Connect with peers and experts to explore the depths of possibilities and enhance your expertise.