17 August 2025

One source of truth for Maximo automation scripts: how to avoid costly mistakes

If you need to change the same piece of code in two places - I will almost guarantee you’ll forget one and that’s not just a Maximo issue, it’s a human one, that can easily escalate into big production problems. In this post I continue my series on common Automation Script traps in Maximo, sharing lessons and advice from a software engineer’s perspective.

A non-technical person should be able to read and modify scripts in Maximo - that’s the goal to keep in mind when writing complex configurations. At the same time simple copy-paste coding which happens a lot in case of modifications creates technical debt and can lead to unexpected results in production.

So how to cope with it? Let's dive in.

When you check 'Allow invoking Script functions' you can define methods in one library script and call them across automation scripts. This would be your one source of truth, nod duplicates anymore.

Example:

def yourMethodName(param1,param2):
    smthtoreturn = False	
    try:
        # your code
        smthtoreturn = True
    except:
        # your exception
    return smthtoreturn   

In order to call this method from other scripts:

smthtoreturn = service.invokeScript("UTILSCRIPT", "yourMethodName", [param1, param2])

But here comes the real secret: library scripts reduce technical debt and make your Maximo environment easier to support long-term only if they’re transparent and well-documented!! Otherwise, they’re just another black box.

Remember in my previous post I was talking about smart logging practices for Maximo? Your library script is a place where you need to use comments to clarify what the method does, where it’s used, why it exists, when it runs and what the outcome or possible errors will be.

And please don't use library scripts if your team doesn’t have a process for versioning and documentation of scripts or/and it adds complexity without clear business value.

Need advice for an expert? Book an appotiment now! info@annacode.nl

Anna van den Akker

Experienced IBM Maximo consultant with a solid software engineering background. I help businesses improve their systems effectively, handling tough tasks and delivering great outcomes.
Category

Share this post on: