Skip to main contentCarbon Design System

MBO constants

When writing automation scripts, just like you would in Java, there are times where you will need to utilize flags in Maximo that are referenced in the MboConstants class. For example, if you try to set a value on an attribute in Maximo that is set as read-only without suppressing the access check, your automation script will generate an error. If you know the literal value, you could use it (2L in this case) but that is difficult for another developer to read, especially when multiple flags are combined together. Instead you should utilize MboConstants for your flag.

You could import the following class and then reference it in your code:

from psdi.mbo import MboConstants
mbo.setValue("DESCRIPTION","My description",MboConstants.NOACCESSCHECK)

However, that is not typically required. For most of your automation scripts you will be working with an MBO while typically utilizing the implicit variable “mbo”. The MboConstants are implemented in the MBO class, so every class that extends the MBO class, which is every MBO in Maximo exposes these constants for you automatically. For example, you could have written the code in the following way:

mbo.setValue("DESCRIPTION","My description",mbo.NOACCESSCHECK)

If you have multiple flags to set you can combine them like:

mbo.setValue("DESCRIPTION","My description",mbo.NOACCESSCHECK|mbo.NOVALIDATION)