Maximo

 View Only

Maximo Formulas: A Logical Approach to Maximo Customization

By HANBALI YOUSSEF posted Wed October 11, 2023 02:41 PM

  

After scripting (automation scripts) in Maximo, Maximo formulas represent the next logical step in customizing #Maximo. Maximo formulas follow a grammar similar to Excel to define expressions that use input variables to calculate a value. Unlike scripting, where most variables must be predefined and linked to Maximo attributes/properties/variables, formula expressions can use any of these Maximo attributes/properties/variables within the expression without ever needing to predefine or link them.

Before rushing to think that formulas replace scripting, let's define their scope. Maximo formulas are limited to mathematical expressions and can only be used to calculate numeric values. Furthermore, expressions are not complete programming constructs. In contrast, automation scripting leverages all the features of dynamic scripting languages like JavaScript/Python. So, while they are a powerful and quick way to obtain calculated values, formulas serve a specific purpose and cannot replace automation scripts.

A formula can be associated with either an Mbo attribute or an Mbo itself:

  1. Attribute Formula: It is very similar to an attribute launch point in the scripting world. It allows associating a formula with an Mbo attribute. The value of this Mbo attribute is calculated using the formula. Typically, calculated values are represented using non-persistent attributes in Maximo.

  2. Object Formula: This is a formula not associated with any Mbo attribute but only with the Mbo entity itself. They are often referred to as dynamic non-persistent attributes because these expressions can be evaluated for an Mbo, and their values used as input for other formulas, just like you use an attribute value in other formulas. The difference is that we do not need to explicitly create these non-persistent Mbo attributes (using the database configuration application and Admin mode, for example) just to store a calculation.

Here is a list of supported operators: 

Aucun texte alternatif pour cette image

Here is a list of supported functions: 

Aucun texte alternatif pour cette image

In usage examples, all variables, namely variables a and b, would be replaced with Maximo artifacts. A Maximo artifact can be:

  • An Mbo attribute.
  • A maxvar.
  • A Maximo property.
  • A Maximo condition.
  • Another expression.
  • A literal value.

Each formula is executed in the context of an Mbo. An Mbo attribute in the expression will reference an attribute or a linked attribute of that Mbo.

The example below describes the use of each element in the context of an Asset Mbo. Suppose we wanted to calculate the priority score (ranging from 1 to 3) for an asset based on the value of its pressure sensor. The formula below can be used for this purpose:

IF(pressuremeter$lastreading>60, 1, IF(pressuremeter$lastreading>20 && pressuremeter$lastreading<59, 2, 3))

Note that instead of using the dot notation <relation>.<attribute>, we use the $ symbol as a separator. This is because the Maximo formula grammar does not allow the "." separator.

Aucun texte alternatif pour cette image

In conclusion, Maximo formulas offer a convenient and quick solution for performing numerical calculations within the scope of Maximo customization. They allow linking mathematical expressions to Mbo attributes and relationships, providing greater flexibility in calculating computed values. However, it is essential to note that formulas do not replace automation scripts that harness the full power of dynamic scripting languages like JavaScript or Python. Maximo formulas are particularly useful for specific calculations and cannot be considered a complete alternative to automation scripts. By leveraging Maximo formulas in the right context, users can enhance the efficiency and accuracy of their calculations in Maximo.

Note: The article in French on LinkedIn, feel free to share.

#Maximo IBM #autoscript #FormulesMaximo #MaximoFormulas #scripting#MaximoIntegrationandScripting

------------------------------
HANBALI YOUSSEF
Architect Solutions IBM Maximo
------------------------------


                    
0 comments
27 views

Permalink