Sunday, March 10, 2024

Set Label Names Dynamically in Maximo

Set Label Names dynamically in Maximo fields, section/section header or table column/header.

A few scenarios like displaying costs for decommissioned/not ready assets, Hazards and Precautions information for Work Order and Date table column in Assignment Manager application requires labels to have dynamic values to make relevance for current record.

Dynamic Label Names can be set in following places:
  • Field Name based on a sigoption condition by a property label
  • Section or Section Header Name using parameter values
  • Table column label using "Label Source ID" and "Label Attributes"
Field Name change by label property using sigoption condition

In WO application, we have configured "WOPRIORITY" field name based on the work type value condition. If it is PM based WO, then set the label as "PM Priority" else "WO Priority". 



Section Header or Table Control Name using parameter values
We can set a section header with a dynamic label using parameter value properties.

Parameter Values Control  <paramvalues> - contains a list of parameter values with positions that can be replaced with values in label of Section Header

Parameter Value <paramvalue> control defines the datasrc and dataattribute with position for label property. 

datasrc - you can set any datasource that is different than parent control i.e., table or section. If you don't set any datasource, then it inherits the parent's data source. If parent dont have a data source or parent is application, then primary data source of the application MAINRECORD will be taken

dataattribute - based on the datasource we can use an attribute name or any related record. 

position - the number in position will replace the label text in the sectionheader




Table Column - Label Source ID and Label Attributes:

We can dynamically set value for a table column using label source ID and Label attribute tags in table column properties. 

In Assignment Manager application (WORKMAN.xml), Maximo has defined a datasource on CALENDARVIEW mbo which is used for referencing the label source ID and label attributes. 

<datasrc id="AMcalendarview" mboname="calendarview"/>

<tablecol 
classname="rowbg_gray" dataattribute="labor.day1" filterable="false"  id="select_labor_col_7" label="{0}" labelattributes="day1" labelsrcid="AMcalendarview"    mxevent="assignlabgrid" sortable="false" targetid="select_labor_col_7" type="event"/>





References:

Wednesday, February 14, 2024

Maximo Average Calculation Methods for Continuous Meter readings

Continuous Meters for Locations or Assets will have an Average Calculation Method specified for calculating the Average Units per day value. Gauge and Characteristic type meters do not have Average calculation method.

Continuous Meters are used to measure consumption or cumulative values. These meters record items like mileage, hours worked, fuel usage or number of items produced. Reading type can be Actual (cumulative) or Delta (incremental). New reading value must be greater than or equal to last reading. 

Maximo calculates the daily Average based on the meter readings and average calculation method, There are four types of Average Calculation Methods available: ALL, SLIDING-DAYS,SLIDING-READINGS,STATIC.

ALL 
Daily Average is calculated based on all meter readings recorded so far for the meter

Average = (Sum of all delta readings  -  Delta reading of earliest date)  /

                           ( Last reading date – Earliest reading date)

Let us find the Average for ALL calculation type:

Current Date Time - 10-Feb-2024 18:00:00 

Average Units per day 
= Sum of all delta readings  -  Delta reading of Earliest Date (31-Jan-2024)   /
   Last reading date(10-Feb-2024 7:00:07) - Earliest Meter reading date(31-Jan-2024 7:00:07)
= (80+70+50+65+60+70+55+75+65+70+80)  - 80  / 10
= 660 / 10 = 66  

SLIDING-DAYS 
Daily Average is calculated based on last N days of meter readings. 
N - SLIDING Window Size

It's used for scenarios where the complete set of odometer readings doesn't make any relevance than taking the last 180/365 days of readings to know the exact overhaul or maintenance requirement.

Average = 

(Sum of all delta readings for Sliding days range - Delta reading of earliest date)  /

( Last reading Date – Earliest reading date from meter readings Set )

Let us find the Average for 10 Sliding Days:



Current Date Time - 10-Feb-2024 18:00:00 
Sliding Date Range starts from = Current Date Time - 10 Days = 31-Jan-202418:00
Meter Readings Range starts from values greater than 31-Jan-2024 18:00  
Earliest Meter Reading Date = 01-Feb-2021 7:00:07 ( from image list )

Average Units per day 
= Sum of all delta readings from 01-Feb-2024 to 10-Feb-2024  -  Delta reading of Earliest Date (01-Feb-2024)   /
   Last reading date (10-Feb-2024 7:00:07) - Earliest Meter reading date (1-Feb-2024 7:00:07)
= (80+70+50+65+60+70+55+75+65+70)  - 70  / 9
= 590 / 9 = 65.55  

SLIDING-READINGS 
Daily Average is calculated based on last N number of meter readings. 
N - SLIDING Window Size

Average = 

Sum of all delta readings for N sliding readings - Delta reading of earliest date  /

 ( Last reading Date – Earliest reading date from meter readings Set )

Let us find the Average for 5 Sliding readings.


Average Units per day 
Sum of all readings from 06-Feb-2024 to 10-Feb-2024  -  Reading of Earliest Date (06-Feb-2024)   /
Last reading date (10-Feb-2024 7:00:07) - Earliest Meter reading date (6-Feb-2024 7:00:07)
= (80+70+50+65+60)  - 60  / 5
= 265 / 5 = 53

STATIC
User need to manually enter a static value for Average Units/day field

References:

Friday, January 19, 2024

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: